chore: update tag service

This commit is contained in:
Steven
2023-10-03 09:39:39 +08:00
parent 69d575fd5b
commit 1542f3172a
8 changed files with 703 additions and 79 deletions

View File

@@ -7,9 +7,15 @@ import "google/api/annotations.proto";
option go_package = "gen/api/v2";
service TagService {
rpc UpsertTag(UpsertTagRequest) returns (UpsertTagResponse) {
option (google.api.http) = {post: "/api/v2/tags"};
}
rpc ListTags(ListTagsRequest) returns (ListTagsResponse) {
option (google.api.http) = {get: "/api/v2/tags"};
}
rpc DeleteTag(DeleteTagRequest) returns (DeleteTagResponse) {
option (google.api.http) = {delete: "/api/v2/tags"};
}
}
message Tag {
@@ -17,6 +23,14 @@ message Tag {
int32 creator_id = 2;
}
message UpsertTagRequest {
string name = 1;
}
message UpsertTagResponse {
Tag tag = 1;
}
message ListTagsRequest {
int32 creator_id = 1;
}
@@ -24,3 +38,9 @@ message ListTagsRequest {
message ListTagsResponse {
repeated Tag tags = 1;
}
message DeleteTagRequest {
Tag tag = 1;
}
message DeleteTagResponse {}