feat: add users proto methods
This commit is contained in:
parent
28cf6b55ed
commit
df6121df20
32
proto/users.proto
Normal file
32
proto/users.proto
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package users.v1;
|
||||||
|
|
||||||
|
service UsersService {
|
||||||
|
rpc GetMe (GetMeRequest) returns (GetMeResponse);
|
||||||
|
rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetMeRequest {
|
||||||
|
string id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetMeResponse {
|
||||||
|
User user = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CreateUserRequest {
|
||||||
|
string id = 1;
|
||||||
|
}
|
||||||
|
message CreateUserResponse {
|
||||||
|
bool ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message User {
|
||||||
|
string id = 1;
|
||||||
|
optional string name = 2;
|
||||||
|
optional string phone = 3;
|
||||||
|
optional string email = 4;
|
||||||
|
optional string avatar = 5;
|
||||||
|
}
|
||||||
@ -3,4 +3,5 @@ import { join } from 'node:path';
|
|||||||
export const PROTO_PATHS = {
|
export const PROTO_PATHS = {
|
||||||
AUTH: join(__dirname, '../../proto/auth.proto'),
|
AUTH: join(__dirname, '../../proto/auth.proto'),
|
||||||
ACCOUNT: join(__dirname, '../../proto/account.proto'),
|
ACCOUNT: join(__dirname, '../../proto/account.proto'),
|
||||||
|
USERS: join(__dirname, '../../proto/users.proto'),
|
||||||
} as const
|
} as const
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user