friendcommon.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package friend
  2. import userservices "bet24.com/servers/micros/userservices/proto"
  3. const (
  4. MAX_GIVETIMES = 3 //最多赠送次数
  5. GIFT_STATUS_NOT = 0 //0=没有礼物
  6. GIFT_STATUS_HAVE = 1 //1=有礼物还没领
  7. GIFT_STATUS_RECEIVED = 2 //2=有礼物已领取
  8. GIVE_STATUS_NOT = 0 //0=没有赠送
  9. GIVE_STATUS_HAVE = 1 //1=已赠送
  10. GIVE_GOLD = 100000 //赠送金币
  11. DEFAULT_FRIEND_COUNT = 100 //默认好友上限数量
  12. )
  13. const (
  14. CANNOT_ADD_ONESELF = iota // 0=不能申请自己
  15. ADD_SUCCESS // 1=申请成功
  16. ALREADY_A_FRIEND // 2=已经是好友
  17. ADD_TO_EXAMINE // 3=已添加,待审核
  18. FRIEND_LIMIT // 4=好友上限
  19. )
  20. const (
  21. Friend_Notify_All = iota //0=刷新好友及申请列表
  22. Friend_Notify_Friend //1=刷新好友列表
  23. Friend_Notify_Verify //2=刷新申请列表
  24. Friend_Notify_Gift //3=刷新领取礼物
  25. Friend_Notify_Status //4=好友状态
  26. Friend_Notify_RoomInvite //5=房间邀请(私人场)
  27. )
  28. const (
  29. GameStatus_Online = "Online"
  30. GameStatus_Offline = "Offline"
  31. GameStatus_Playing = "Playing"
  32. GameStatus_Hall = "Hall"
  33. )
  34. const (
  35. FriendShip_Normal = 0 // 0=普通
  36. FriendShip_Friend = 1 // 1=好友
  37. FriendShip_AlreadyApplied = 2 // 2=已申请(自己申请的,待对方审核)
  38. FriendShip_ToBeReviewed = 3 // 3=待审核(对方申请的,待自己审核)
  39. FriendShip_Black = 4 // 4=黑名单
  40. )
  41. type FriendBase struct {
  42. FriendID int // 好友ID
  43. NickName string // 昵称
  44. Sex int // 性别
  45. FaceID int // 头像ID
  46. FaceUrl string // 头像URL
  47. UserWords string // 个性签名
  48. GameStatus string // 游戏状态 离线/在线/在xxxx游戏中
  49. VipLevel int // Vip
  50. VipExpire int
  51. PrivateRoomCount int // 私人场局数
  52. Currency string // 币种
  53. Level int // 人物等级
  54. Gold int // 金币
  55. Charm int // 魅力值
  56. Decorations []userservices.UserDecoration `json:",omitempty"`
  57. }
  58. type FriendItem struct {
  59. FriendBase
  60. IsGift int // 是否有礼物领取 0,没有礼物, 1,有礼物还没领取,2,有礼物已领取
  61. GiftTime int // 领取时间戳
  62. IsGive int // 是否可以赠送礼物
  63. GiveTime int // 赠送时间戳
  64. }
  65. type SearchInfo struct {
  66. FriendBase
  67. IsFriend int // 是否好友
  68. }
  69. type RoomInviteInfo struct {
  70. Id int
  71. UserID int
  72. NickName string
  73. RoomNo int
  74. Invalid bool
  75. }
  76. // 好友数量
  77. type FriendCount struct {
  78. Base int // 基础好友数
  79. Extra int // 额外好友数
  80. }
  81. // 潜在好友,最近有一起玩游戏的,赠送礼物的
  82. type PotentialFriend struct {
  83. UserId int
  84. FriendID int
  85. MetTime int
  86. Memo string
  87. // 以下变量数据库不存
  88. NickName string
  89. FaceID int
  90. FaceUrl string
  91. Decorations []userservices.UserDecoration `json:",omitempty"`
  92. }
  93. // 拉黑好友
  94. type BlackItem struct {
  95. UserId int // 黑名单用户id
  96. Crdate string // 时间
  97. }