You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
4.0 KiB
Protocol Buffer

syntax = "proto3";
package pb;
option go_package = "./pb";
// model
message User {
int64 id = 1;
string username = 2;
// platform
string platform = 3;
string pUid = 4;
string pUname = 5;
string pAvatar = 6;
int32 nobilityLevel = 7; // 贵族等级
int64 integral = 8; // 用户积分(充值)
}
message Empty {}
// req
message PlatformUserReq {
string platform = 1;
string pUid = 2;
}
message PlatformUserResp {
User user = 1;
}
message UserIdResp {
int64 userId = 1;
}
message ChangeIntegralReq {
int64 userId = 1; // 系统用户ID
int64 change = 2; // 变更数量
}
message ChangeIntegralResp {
int64 userId = 1; // 系统用户ID
int64 change = 2; // 本次变更积分数量,负数为扣减
int64 integral = 3; // 用户当前总积分
}
message UserIntegralResp {
int64 userId = 1; // 用户ID
int64 integral = 2; // 用户当前总积分
}
message UserSendGiftReq {
string platform = 1; // 平台
string pUid = 2; // 平台用户ID
string roomId = 3; // 直播间ID
int64 giftId = 4; // 礼物ID
string giftName = 5; // 礼物名
int64 num = 6; // 赠送数量
int64 price = 7; // 礼物单价(系统不存在对应礼物数据时使用)
bool isPaid = 8; // 是否收费礼物
}
message UserSendGiftResp {
User user = 1; // 系统用户信息
ChangeIntegralResp integral = 10; // 积分变动
}
message UserBuyNobilityReq {
string platform = 1; // 平台
string pUid = 2; // 平台用户ID
string roomId = 3; // 直播间ID
int64 giftId = 4; // 礼物ID
string giftName = 5; // 礼物名
int64 num = 6; // 赠送数量
int64 price = 7; // 礼物单价(系统不存在对应礼物数据时使用)
int64 level = 8; // 贵族等级
int64 startTime = 9; // 开始时间
int64 endTime = 10; // 结束时间
}
message UserBuyNobilityResp {
User user = 1; // 系统用户信息
ChangeIntegralResp integral = 10; // 积分变动
}
// 通知-PvP杀兵营(人) statistics.pvp.kill
message StatPvPKillReq {
int64 uid = 1; // 用户ID
int64 targetUid = 2; // 目标用户
bool isGeneral = 3; // targetUid是否名将
}
// 通知-PvP一血 statistics.pvp.first
message StatPvPFirstBloodReq {
int64 uid = 1; // 用户ID
int32 type = 2; // 1-拿到一血 2-被破一血
}
// 通知-PvP战报 statistics.pvp.report
message StatPvPReportReq {
message Item {
int64 uid = 1; // 用户ID
int64 damage = 2; // 伤害量
int64 deDamage = 3; // 承受伤害
int64 killUnit = 4; // 击杀单位数量
int64 deKillUnit = 5; // 被杀单位数量
}
int32 winCamp = 1; // 获胜阵营 1-蓝 2-红
int64 generalUid = 2; // 名将UID
repeated Item winItems = 3; // 获胜方数据
repeated Item lostItems = 4; // 战败方数据
}
// rank
message RankPvpReq {
int32 type = 1; // rank类型
int32 topN = 2; // TopN
}
message RankPvpResp {
message Item {
int64 uid = 1;
string uname = 2;
int64 score = 3;
string avatar = 4;
}
int32 type = 1; // rank类型
repeated Item items = 2; // rank数据
}
service userCenter {
/// @ZeroGroup: platform_user
// retrievePlatformUser 新增或获取用户
rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp);
// getUserIdByPUid 通过平台用户id获取系统用户ID
rpc getUserIdByPUid(PlatformUserReq) returns (UserIdResp);
/// @ZeroGroup: integral
//ChangeIntegral 新增用户积分
rpc ChangeIntegral(ChangeIntegralReq) returns (ChangeIntegralResp);
//GetUserIntegral 获取用户积分
rpc GetUserIntegral(UserIdResp) returns (UserIntegralResp);
/// @ZeroGroup: gift
// UserSendGift 用户赠送礼物
rpc userSendGift(UserSendGiftReq) returns(UserSendGiftResp);
rpc userBuyNobility(UserBuyNobilityReq) returns(UserBuyNobilityResp);
/// @ZeroGroup: statistics
rpc statPvpKill(StatPvPKillReq) returns (Empty);
rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty);
rpc statPvpReport(StatPvPReportReq) returns (Empty);
/// @ZeroGroup: rank
// rankPvp pvp排行
rpc rankPvp(RankPvpReq) returns(RankPvpResp);
}