feat: add update shortcut api

This commit is contained in:
Steven
2023-11-10 08:51:19 +08:00
parent 033c007654
commit f5f8616f2e
6 changed files with 584 additions and 132 deletions

View File

@ -5,6 +5,7 @@ package slash.api.v2;
import "api/v2/common.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/field_mask.proto";
option go_package = "gen/api/v2";
@ -25,6 +26,14 @@ service ShortcutService {
body: "shortcut"
};
}
// UpdateShortcut updates a shortcut.
rpc UpdateShortcut(UpdateShortcutRequest) returns (UpdateShortcutResponse) {
option (google.api.http) = {
put: "/api/v2/shortcuts/{shortcut.name}"
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}"};
@ -98,6 +107,16 @@ message CreateShortcutResponse {
Shortcut shortcut = 1;
}
message UpdateShortcutRequest {
Shortcut shortcut = 1;
google.protobuf.FieldMask update_mask = 2;
}
message UpdateShortcutResponse {
Shortcut shortcut = 1;
}
message DeleteShortcutRequest {
string name = 1;
}