Compare commits
2 Commits
28cf6b55ed
...
b36d1cfc08
| Author | SHA1 | Date | |
|---|---|---|---|
| b36d1cfc08 | |||
| df6121df20 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@teacinema/contracts",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"description": "Protocol Buffers contracts for microservices",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
|
||||
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 = {
|
||||
AUTH: join(__dirname, '../../proto/auth.proto'),
|
||||
ACCOUNT: join(__dirname, '../../proto/account.proto'),
|
||||
USERS: join(__dirname, '../../proto/users.proto'),
|
||||
} as const
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user