38 lines
587 B
Protocol Buffer
38 lines
587 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package user;
|
|
|
|
message GetUsersRequest {
|
|
}
|
|
|
|
message User {
|
|
int32 id = 1;
|
|
string name = 2;
|
|
string email = 3;
|
|
}
|
|
|
|
message UserListResponse {
|
|
repeated User users = 1;
|
|
}
|
|
|
|
message GetUserRequest {
|
|
int32 id = 1;
|
|
}
|
|
|
|
message CreateUserRequest {
|
|
string name = 1;
|
|
string email = 2;
|
|
}
|
|
|
|
message UserResponse {
|
|
int32 id = 1;
|
|
string name = 2;
|
|
string email = 3;
|
|
}
|
|
|
|
service UserService {
|
|
rpc GetUsers(GetUsersRequest) returns (UserListResponse);
|
|
rpc GetUser(GetUserRequest) returns (UserResponse);
|
|
rpc CreateUser(CreateUserRequest) returns (UserResponse);
|
|
}
|