protobufs/users.proto

58 lines
1002 B
Protocol Buffer
Raw Normal View History

2022-07-17 01:09:09 +00:00
syntax = "proto3";
2022-07-17 08:42:58 +00:00
option go_package = "git.itzana.me/strafesnet/go-grpc/users";
2022-07-17 01:09:09 +00:00
package users;
service UsersService {
rpc Get(IdMessage) returns (UserResponse);
rpc GetList(IdList) returns (UserList);
rpc Update(UserRequest) returns (NullResponse);
rpc Create(UserRequest) returns (IdMessage);
rpc Delete(IdMessage) returns (NullResponse);
rpc List(ListRequest) returns (UserList);
}
message IdList {
repeated int64 ID = 1;
}
message IdMessage {
int64 ID = 1;
}
message UserResponse {
int64 ID = 1;
string Username = 2;
int32 StateID = 3;
}
message UserRequest {
int64 ID = 1;
optional string Username = 2;
optional int32 StateID = 3;
}
message UserFilter {
optional int64 ID = 1;
optional string Username = 2;
optional int32 StateID = 3;
}
message UserList {
repeated UserResponse Users = 1;
}
message ListRequest {
UserFilter Filter = 1;
Pagination Page = 2;
}
message Pagination {
int32 Size = 1;
int32 Number = 2;
}
message NullResponse {
}