82 lines
1.8 KiB
Protocol Buffer
Executable File
82 lines
1.8 KiB
Protocol Buffer
Executable File
syntax = "proto3";
|
|
|
|
package loafle.cms.proto.user;
|
|
|
|
option csharp_namespace = "Loafle.Cms.Proto.User";
|
|
option cc_enable_arenas = true;
|
|
option go_package = "git.loafle.net/cms/proto/user";
|
|
option java_package = "com.loafle.cms.proto.user";
|
|
option objc_class_prefix = "LF";
|
|
|
|
|
|
import "common/search-criteria.proto";
|
|
import "common/search-pagination.proto";
|
|
import "common/search-sort.proto";
|
|
import "user/user.proto";
|
|
|
|
message CreateUserRequest{
|
|
string api = 1;
|
|
User user = 2;
|
|
}
|
|
|
|
message CreateUserResponse{
|
|
string api = 1;
|
|
int64 id = 2;
|
|
}
|
|
|
|
message ReadUserByIdRequest{
|
|
string api = 1;
|
|
int64 id = 2;
|
|
}
|
|
|
|
message ReadUserByUsernameRequest{
|
|
string api = 1;
|
|
string username = 2;
|
|
}
|
|
|
|
message ReadUserResponse{
|
|
string api = 1;
|
|
User user = 2;
|
|
}
|
|
|
|
message UpdateUserRequest{
|
|
string api = 1;
|
|
User user = 2;
|
|
}
|
|
|
|
message UpdateUserResponse{
|
|
string api = 1;
|
|
int64 updated = 2;
|
|
}
|
|
|
|
message DeleteUserRequest{
|
|
string api = 1;
|
|
int64 id = 2;
|
|
}
|
|
message DeleteUserResponse{
|
|
string api = 1;
|
|
int64 deleted = 2;
|
|
}
|
|
|
|
message ReadAllUsersRequest{
|
|
string api = 1;
|
|
loafle.cms.proto.common.SearchPagination pagination = 2;
|
|
loafle.cms.proto.common.SearchSort sort = 3;
|
|
repeated loafle.cms.proto.common.SearchCriteria criteria = 4;
|
|
}
|
|
|
|
message ReadAllUsersResponse{
|
|
string api = 1;
|
|
int32 totalCount = 2;
|
|
repeated User users = 3;
|
|
}
|
|
|
|
service UserService {
|
|
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
|
|
rpc ReadUserById(ReadUserByIdRequest) returns (ReadUserResponse);
|
|
rpc ReadUserByUsername(ReadUserByUsernameRequest) returns (ReadUserResponse);
|
|
rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse);
|
|
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
|
|
rpc ReadAllUsers(ReadAllUsersRequest) returns (ReadAllUsersResponse);
|
|
}
|