chore: update shortcut definition

This commit is contained in:
Steven
2023-11-10 09:54:05 +08:00
parent 6ed9ecffde
commit b3e766926d
5 changed files with 210 additions and 170 deletions

View File

@ -17,8 +17,8 @@ service ShortcutService {
}
// GetShortcut returns a shortcut by name.
rpc GetShortcut(GetShortcutRequest) returns (GetShortcutResponse) {
option (google.api.http) = {get: "/api/v2/shortcuts/{name}"};
option (google.api.method_signature) = "name";
option (google.api.http) = {get: "/api/v2/shortcuts/{id}"};
option (google.api.method_signature) = "id";
}
// CreateShortcut creates a shortcut.
rpc CreateShortcut(CreateShortcutRequest) returns (CreateShortcutResponse) {
@ -30,15 +30,15 @@ service ShortcutService {
// UpdateShortcut updates a shortcut.
rpc UpdateShortcut(UpdateShortcutRequest) returns (UpdateShortcutResponse) {
option (google.api.http) = {
put: "/api/v2/shortcuts/{shortcut.name}"
put: "/api/v2/shortcuts/{shortcut.id}"
body: "shortcut"
};
option (google.api.method_signature) = "shortcut,update_mask";
}
// DeleteShortcut deletes a shortcut by name.
rpc DeleteShortcut(DeleteShortcutRequest) returns (DeleteShortcutResponse) {
option (google.api.http) = {delete: "/api/v2/shortcuts/{name}"};
option (google.api.method_signature) = "name";
option (google.api.http) = {delete: "/api/v2/shortcuts/{id}"};
option (google.api.method_signature) = "id";
}
}
@ -65,7 +65,9 @@ message Shortcut {
Visibility visibility = 11;
OpenGraphMetadata og_metadata = 12;
int32 view_count = 12;
OpenGraphMetadata og_metadata = 13;
}
message OpenGraphMetadata {
@ -93,7 +95,7 @@ message ListShortcutsResponse {
}
message GetShortcutRequest {
string name = 1;
int32 id = 1;
}
message GetShortcutResponse {
@ -119,7 +121,7 @@ message UpdateShortcutResponse {
}
message DeleteShortcutRequest {
string name = 1;
int32 id = 1;
}
message DeleteShortcutResponse {}