sample/proto/sample.proto

82 lines
2.3 KiB
Protocol Buffer
Raw Permalink Normal View History

2025-09-23 22:25:19 +08:00
syntax = "proto3";
package sample;
option go_package = ".;sample";
import "blocks.proto";
// sample(会员通行证)模块-数据
service Account{
// 通过会员所有信息
rpc Get(Empty) returns (GetFullReply) {}
// 更新会员的信息数据,字段值为空或是0将不更新此数据
rpc SetData(SetDataRequest) returns (StatusReply) {}
// 更新会员的密码
rpc SetPassword(SetPasswordRequest) returns (StatusReply) {}
// 新增标签
rpc TagCreate(TagItem) returns (StatusReply) {}
// 删除标签
rpc TagRemove(IdentRequest) returns (StatusReply) {}
// 获取会员的相关统计数据
rpc Statistics(StatisticsRequest) returns (StatisticsReply) {}
}
// 获取会员的完整信息
message GetFullReply {
string identity = 1; // 唯一标识
string account = 2; // 帐号
string phone = 3; // 手机号码 必填
string email = 4; // 验证码
string rights = 5; // 权限
string nickname = 6; // 昵称
string avatar = 7; // 头像
string birthday = 8; // 生日
int32 sex = 9; // 性别1为男性2为女性
int32 country = 10; // 国家
int32 province = 11; // 省
int32 city = 12; // 市
int32 area = 13; // 区
string sign = 14; // 签名
string cover = 15; // 背景&封面
int32 score = 16; // 积分
int32 level = 17; // 等级
map<string,bool> verify = 18; // 数据
repeated TagItem tags = 19;
}
message TagItem {
string name = 1;
string icon = 2;
}
message SetDataRequest {
string nickname = 1; //昵称
string avatar = 2; //头像
string birthday = 3; //生日
int32 sex = 4; //性别1为男性2为女性
int32 country = 5; // 国家
int32 province = 6; //省
int32 city = 7; //市
int32 area = 8; //区
string sign = 9; //签名
string cover = 10; // 背景&封面
int32 score = 11; // 积分
int32 level = 12; // 等级
}
message SetPasswordRequest {
string old_password = 3; // 旧密码
string new_password = 4;// 新密码
}
message StatisticsRequest {
repeated string field = 1; //要获取的统计数据字段。
}
message StatisticsReply {
map<string,int64> Data=1; //数据以Map格式输出
}