mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-15 20:37:49 +00:00
feat: initial buf proto files
This commit is contained in:
13
proto/api/v2/common.proto
Normal file
13
proto/api/v2/common.proto
Normal file
@ -0,0 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
|
||||
enum RowStatus {
|
||||
ROW_STATUS_UNSPECIFIED = 0;
|
||||
|
||||
ACTIVE = 1;
|
||||
|
||||
ARCHIVED = 2;
|
||||
}
|
48
proto/api/v2/user_service.proto
Normal file
48
proto/api/v2/user_service.proto
Normal file
@ -0,0 +1,48 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
|
||||
import "api/v2/common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
|
||||
service UserService {
|
||||
rpc GetUser(GetUserRequest) returns (GetUserResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/users/{email}"};
|
||||
option (google.api.method_signature) = "email";
|
||||
}
|
||||
}
|
||||
|
||||
message User {
|
||||
int32 id = 1;
|
||||
|
||||
RowStatus row_status = 2;
|
||||
|
||||
int64 created_ts = 3;
|
||||
|
||||
int64 updated_ts = 4;
|
||||
|
||||
Role role = 6;
|
||||
|
||||
string email = 7;
|
||||
|
||||
string nickname = 8;
|
||||
}
|
||||
|
||||
enum Role {
|
||||
ROLE_UNSPECIFIED = 0;
|
||||
|
||||
ADMIN = 1;
|
||||
|
||||
USER = 2;
|
||||
}
|
||||
|
||||
message GetUserRequest {
|
||||
string email = 1;
|
||||
}
|
||||
|
||||
message GetUserResponse {
|
||||
User user = 1;
|
||||
}
|
Reference in New Issue
Block a user