1. message留言
syntax = "proto3";
option go_package = ".;proto";
service Message{
rpc MessageList(MessageRequest) returns(MessageListResponse); //批量获取留言信息
rpc CreateMessage(MessageRequest) returns(MessageResponse); //添加留言
}
message MessageRequest{
int32 id = 1;
int32 userId = 2;
int32 messageType = 3;
string subject = 4;
string message = 5;
string file = 6;
}
message MessageResponse{
int32 id = 1;
int32 userId = 2;
int32 messageType = 3;
string subject = 4;
string message = 5;
string file = 6;
}
message MessageListResponse {
int32 total = 1;
repeated MessageResponse data = 2;
}
2. address收货地址
syntax = "proto3";
import "google/protobuf/empty.proto";
option go_package = ".;proto";
service Address{
rpc GetAddressList(AddressRequest) returns(AddressListResponse); //查看地址
rpc CreateAddress(AddressRequest) returns(AddressResponse); //新增地址
rpc DeleteAddress(AddressRequest) returns(google.protobuf.Empty); //删除地址
rpc UpdateAddress(AddressRequest) returns(google.protobuf.Empty); //修改地址
}
message AddressRequest{
int32 id = 1;
int32 userId = 2;
string province = 3;
string city = 4;
string district = 5;
string address = 6;
string signerName = 7;
string signerMobile = 8;
}
message AddressResponse{
int32 id = 1;
int32 userId = 2;
string province = 3;
string city = 4;
string district = 5;
string address = 6;
string signerName = 7;
string signerMobile = 8;
}
message AddressListResponse {
int32 total = 1;
repeated AddressResponse data = 2;
}
3. userfav用户收藏
syntax = "proto3";
import "google/protobuf/empty.proto";
option go_package = ".;proto";
service UserFav{
rpc GetFavList(UserFavRequest) returns(UserFavListResponse); //过滤收藏信息
rpc AddUserFav(UserFavRequest) returns(google.protobuf.Empty); //添加收藏
rpc DeleteUserFav(UserFavRequest) returns(google.protobuf.Empty); //删除收藏
rpc GetUserFavDetail(UserFavRequest) returns(google.protobuf.Empty); //查看用户是否已经收藏某件商品
}
message UserFavRequest{
int32 userId = 1;
int32 goodsId = 2;
}
message UserFavResponse{
int32 userId = 1;
int32 goodsId = 2;
}
message UserFavListResponse {
int32 total = 1;
repeated UserFavResponse data = 2;
}