init
This commit is contained in:
199
proto/message.proto
Normal file
199
proto/message.proto
Normal file
@@ -0,0 +1,199 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option go_package = "./";
|
||||
|
||||
package message;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service MessageService {
|
||||
|
||||
rpc CreateUser(CreateUserRequest) returns(CreateUserResponse);
|
||||
rpc UpdateUser(UpdateUserRequest) returns(UpdateUserResponse);
|
||||
rpc GetUserByToken(GetUserByTokenRequest) returns(GetUserResponse);
|
||||
rpc GetUserByEmail(GetUserByEmailRequest) returns(GetUserResponse);
|
||||
rpc ListUser(ListUserRequest) returns(ListUserResponse);
|
||||
|
||||
rpc CreateChat(CreateChatRequest) returns(CreateChatResponse);
|
||||
rpc UpdateChat(UpdateChatRequest) returns(UpdateChatResponse);
|
||||
rpc GetChat(GetChatRequest) returns(GetChatResponse);
|
||||
rpc ListChat(ListChatRequest) returns(ListChatResponse);
|
||||
|
||||
rpc CreateMessage(CreateMessageRequest) returns(CreateMessageResponse);
|
||||
rpc UpdateMessage(UpdateMessageRequest) returns(UpdateMessageResponse);
|
||||
rpc GetMessage(GetMessageRequest) returns(GetMessageResponse);
|
||||
rpc ListMessage(ListMessageRequest) returns(ListMessageResponse);
|
||||
|
||||
rpc GetVersion(google.protobuf.Empty) returns(GetVersionResponse);
|
||||
}
|
||||
|
||||
// User
|
||||
message CreateUserRequest {
|
||||
string email = 1;
|
||||
}
|
||||
|
||||
message CreateUserResponse {
|
||||
User data = 1;
|
||||
}
|
||||
|
||||
message UpdateUserRequest {
|
||||
int32 id = 1;
|
||||
optional string token = 2;
|
||||
optional string description = 3;
|
||||
}
|
||||
|
||||
message UpdateUserResponse {
|
||||
User data = 1;
|
||||
}
|
||||
|
||||
message GetUserByTokenRequest {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message GetUserByEmailRequest {
|
||||
string email = 1;
|
||||
}
|
||||
|
||||
message GetUserResponse {
|
||||
User data = 1;
|
||||
}
|
||||
|
||||
message ListUserRequest {
|
||||
int32 page = 1;
|
||||
repeated int32 user_ids = 2;
|
||||
}
|
||||
|
||||
message ListUserResponse {
|
||||
repeated User data = 1;
|
||||
}
|
||||
|
||||
message User {
|
||||
int32 id = 1;
|
||||
optional string token = 2;
|
||||
string email = 3;
|
||||
optional string description = 4;
|
||||
}
|
||||
|
||||
message UserForChatResponse {
|
||||
int32 id = 1;
|
||||
optional string token = 2;
|
||||
string email = 3;
|
||||
optional string description = 4;
|
||||
optional bool is_admin = 5;
|
||||
}
|
||||
|
||||
// User end
|
||||
|
||||
// Chat
|
||||
message CreateChatRequest {
|
||||
repeated UserForChat users = 1;
|
||||
// int32 type_id = 2;
|
||||
}
|
||||
|
||||
message UserForChat {
|
||||
int32 user_id = 1;
|
||||
optional bool is_admin = 2;
|
||||
}
|
||||
|
||||
message CreateChatResponse {
|
||||
Chat data = 1;
|
||||
}
|
||||
|
||||
message UpdateChatRequest {
|
||||
string id = 1;
|
||||
repeated UserForChat users = 2;
|
||||
}
|
||||
|
||||
message UpdateChatResponse {
|
||||
Chat data = 1;
|
||||
}
|
||||
|
||||
message GetChatRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetChatResponse {
|
||||
Chat data = 1;
|
||||
}
|
||||
|
||||
message ListChatRequest {
|
||||
int32 page = 1;
|
||||
repeated int32 user_ids = 2;
|
||||
repeated string chat_ids = 3;
|
||||
}
|
||||
|
||||
message ListChatResponse {
|
||||
repeated Chat data = 1;
|
||||
}
|
||||
|
||||
message Chat {
|
||||
string id = 1;
|
||||
int32 type_id = 3;
|
||||
repeated UserForChatResponse users = 5;
|
||||
}
|
||||
// Chat end
|
||||
|
||||
// Message
|
||||
message CreateMessageRequest {
|
||||
string chat_id = 2;
|
||||
int32 user_id = 3;
|
||||
optional string text = 4;
|
||||
optional string image = 5;
|
||||
optional string video = 6;
|
||||
optional string file = 7;
|
||||
}
|
||||
|
||||
message CreateMessageResponse {
|
||||
Message data = 1;
|
||||
}
|
||||
|
||||
message UpdateMessageRequest {
|
||||
int32 id = 1;
|
||||
string chat_id = 2;
|
||||
optional string text = 3;
|
||||
optional string image = 4;
|
||||
optional string video = 5;
|
||||
optional string file = 6;
|
||||
}
|
||||
|
||||
message UpdateMessageResponse {
|
||||
Message data = 1;
|
||||
}
|
||||
|
||||
message GetMessageRequest {
|
||||
int32 id = 1;
|
||||
}
|
||||
|
||||
message GetMessageResponse {
|
||||
Message data = 1;
|
||||
}
|
||||
|
||||
message ListMessageRequest {
|
||||
int32 page = 1;
|
||||
string chat_id = 2;
|
||||
}
|
||||
|
||||
message ListMessageResponse {
|
||||
repeated Message data = 1;
|
||||
}
|
||||
message Message {
|
||||
int32 id = 1;
|
||||
int32 user_id = 2;
|
||||
optional string text = 3;
|
||||
optional string image = 4;
|
||||
optional string video = 5;
|
||||
optional string file = 6;
|
||||
}
|
||||
|
||||
// Message end
|
||||
|
||||
// Version
|
||||
message GetVersionResponse {
|
||||
Version data = 1;
|
||||
}
|
||||
|
||||
message Version {
|
||||
int32 id = 1;
|
||||
string version = 2;
|
||||
}
|
||||
// Version end
|
||||
Reference in New Issue
Block a user