mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-19 11:14:01 +00:00
feat: add create shortcut api
This commit is contained in:
@@ -9,6 +9,7 @@ import "google/api/client.proto";
|
||||
option go_package = "gen/api/v2";
|
||||
|
||||
service ShortcutService {
|
||||
// ListShortcuts returns a list of shortcuts.
|
||||
rpc ListShortcuts(ListShortcutsRequest) returns (ListShortcutsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/shortcuts"};
|
||||
}
|
||||
@@ -17,6 +18,13 @@ service ShortcutService {
|
||||
option (google.api.http) = {get: "/api/v2/shortcuts/{name}"};
|
||||
option (google.api.method_signature) = "name";
|
||||
}
|
||||
// CreateShortcut creates a shortcut.
|
||||
rpc CreateShortcut(CreateShortcutRequest) returns (CreateShortcutResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/shortcuts"
|
||||
body: "shortcut"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Shortcut {
|
||||
@@ -76,3 +84,11 @@ message GetShortcutRequest {
|
||||
message GetShortcutResponse {
|
||||
Shortcut shortcut = 1;
|
||||
}
|
||||
|
||||
message CreateShortcutRequest {
|
||||
Shortcut shortcut = 1;
|
||||
}
|
||||
|
||||
message CreateShortcutResponse {
|
||||
Shortcut shortcut = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user