mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-15 12:27:49 +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;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ service UserService {
|
||||
option (google.api.http) = {get: "/api/v2/users/{id}"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// CreateUser creates a new user.
|
||||
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v2/users"
|
||||
|
Reference in New Issue
Block a user