|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 用户ID请求
|
|
|
|
message UserIdReq {
|
|
|
|
int64 userId = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 用户ID回复
|
|
|
|
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 UserCheckInResp {
|
|
|
|
bool success = 1; // 成功与否
|
|
|
|
string msg = 2; // 消息
|
|
|
|
int64 integralChange = 3; // 积分变动量
|
|
|
|
int64 integral = 4; // 变动后的积分量
|
|
|
|
bool isCritical = 5; // 是否发生了暴击奖励
|
|
|
|
}
|
|
|
|
|
|
|
|
// 用户送礼请求
|
|
|
|
message UserSendGiftReq {
|
|
|
|
string platform = 1; // 平台
|
|
|
|
int64 userId = 2; // 系统用户ID
|
|
|
|
string pUid = 3; // 平台用户ID
|
|
|
|
string roomId = 4; // 直播间ID
|
|
|
|
int64 giftId = 5; // 礼物ID
|
|
|
|
string giftName = 6; // 礼物名
|
|
|
|
int64 num = 7; // 赠送数量
|
|
|
|
int64 price = 8; // 礼物单价(系统不存在对应礼物数据时使用)
|
|
|
|
bool isPaid = 9; // 是否收费礼物
|
|
|
|
}
|
|
|
|
|
|
|
|
// 用户送礼回复
|
|
|
|
message UserSendGiftResp {
|
|
|
|
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
|
|
|
|
string uname = 2; // 用户名
|
|
|
|
int64 damage = 3; // 伤害量
|
|
|
|
int64 deDamage = 4; // 承受伤害
|
|
|
|
int64 killUnit = 5; // 击杀单位数量
|
|
|
|
int64 deKillUnit = 6; // 被杀单位数量
|
|
|
|
}
|
|
|
|
message General {
|
|
|
|
int64 uid = 1; // 名将UID
|
|
|
|
string uname = 2; // 名将用户名
|
|
|
|
}
|
|
|
|
int32 winCamp = 1; // 获胜阵营 1-蓝 2-红
|
|
|
|
General general = 2;
|
|
|
|
repeated Item winItems = 10; // 获胜方数据
|
|
|
|
repeated Item lostItems = 11; // 战败方数据
|
|
|
|
}
|
|
|
|
|
|
|
|
// 通知-PvP战报 回复
|
|
|
|
message StatPvPReportResp {
|
|
|
|
message Item {
|
|
|
|
int64 uid = 1; // 用户ID
|
|
|
|
string uname = 2; // 用户名
|
|
|
|
int64 addonIntegral = 3; // 本次获取的积分
|
|
|
|
}
|
|
|
|
Item general = 1; // 名将
|
|
|
|
repeated Item winItems = 10; // 获胜方数据
|
|
|
|
repeated Item lostItems = 11; // 战败方数据
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////// 礼包
|
|
|
|
|
|
|
|
enum GiftType {
|
|
|
|
starter = 0; // 新手礼包
|
|
|
|
subsistence = 1; // 低保
|
|
|
|
}
|
|
|
|
|
|
|
|
message GiftPackItem {
|
|
|
|
string giftType = 1; // 礼包类型 starter:新手礼包
|
|
|
|
int64 integral = 2; // 获取的积分
|
|
|
|
repeated string title = 3; // 获取的称号
|
|
|
|
}
|
|
|
|
|
|
|
|
message DrawGiftPackReq {
|
|
|
|
int64 uid = 1;
|
|
|
|
string uname = 2;
|
|
|
|
string giftType = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DrawGiftPackResp {
|
|
|
|
int64 uid = 1;
|
|
|
|
string uname = 2;
|
|
|
|
int32 code = 3; // 领取结果 200:成功 201100:已经领取过 201101:已领取完
|
|
|
|
string msg = 4; // 消息 [领取成功|已经领取过|该用户已领取(当日|每周|每月)完所有礼包]
|
|
|
|
GiftPackItem item = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////// rank
|
|
|
|
enum RankType {
|
|
|
|
Unknown = 0;
|
|
|
|
Damage = 1; // 伤害榜
|
|
|
|
DeDamage = 2; // 受伤榜
|
|
|
|
General = 3; // 名将榜
|
|
|
|
DeGeneral = 4; // 落马榜
|
|
|
|
KillUnit = 5; // 小兵击杀
|
|
|
|
DeKillUnit = 6; // 小兵被杀
|
|
|
|
KillPlayer = 7; // 击杀玩家
|
|
|
|
DeKillPlayer = 8; // 被杀榜
|
|
|
|
Win = 9; // 获胜榜
|
|
|
|
Lost = 10; // 战败榜
|
|
|
|
FirstBlood = 11; // 一血榜
|
|
|
|
DeFirstBlood = 12; // 被拿一血榜
|
|
|
|
}
|
|
|
|
|
|
|
|
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数据
|
|
|
|
}
|
|
|
|
|
|
|
|
// RankPvpSubmitReq 手动排行榜结算
|
|
|
|
message RankPvpSubmitReq {
|
|
|
|
int32 rankType = 1; // 待结算的排行榜类型
|
|
|
|
bool allRankType = 2; // 是否直接结算所有排行类型
|
|
|
|
}
|
|
|
|
|
|
|
|
message RankPvpSubmitResp {
|
|
|
|
message Result {
|
|
|
|
int64 userId = 1;
|
|
|
|
string username = 2;
|
|
|
|
string avatar = 3;
|
|
|
|
int64 integral = 4; // 获取到的积分数
|
|
|
|
string title = 5; // 获取到的称号
|
|
|
|
int64 titleDuration = 6; // 称号持续时间(单位: 秒,负数为无限长)
|
|
|
|
}
|
|
|
|
message Item {
|
|
|
|
int32 rankType = 1; // 排行榜类型
|
|
|
|
repeated Result results = 2; // 上榜玩家?
|
|
|
|
}
|
|
|
|
|
|
|
|
repeated Item items = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// UserRankReq 查询用户自己的排行
|
|
|
|
message UserRankReq {
|
|
|
|
int64 userId = 1; // 系统用户ID
|
|
|
|
string username = 2; // 用户名
|
|
|
|
int32 rankType = 3; // 排行榜类型
|
|
|
|
bool allRankType = 4; // 直接查询所有排行类型
|
|
|
|
}
|
|
|
|
|
|
|
|
message UserRankResp {
|
|
|
|
message Item {
|
|
|
|
int32 rankType = 1; // 排行类型
|
|
|
|
int32 pos = 2; // 名次
|
|
|
|
}
|
|
|
|
repeated Item items = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
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(UserIdReq) returns (UserIntegralResp);
|
|
|
|
//UserCheckIn 用户签到|打卡
|
|
|
|
rpc UserCheckIn(UserIdReq) returns (UserCheckInResp);
|
|
|
|
|
|
|
|
/// @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 (StatPvPReportResp);
|
|
|
|
|
|
|
|
/// @ZeroGroup: giftPack
|
|
|
|
|
|
|
|
rpc drawGiftPack(DrawGiftPackReq) returns(DrawGiftPackResp);
|
|
|
|
|
|
|
|
/// @ZeroGroup: rank
|
|
|
|
|
|
|
|
// rankPvp pvp排行
|
|
|
|
rpc rankPvp(RankPvpReq) returns(RankPvpResp);
|
|
|
|
rpc rankPvpSubmit(RankPvpSubmitReq) returns(RankPvpSubmitResp);
|
|
|
|
rpc userRankPvp(UserRankReq) returns (UserRankResp);
|
|
|
|
}
|