account.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package model
  2. import (
  3. accmdl "go-common/app/service/main/account/api"
  4. )
  5. // NavNum nav num struct.
  6. type NavNum struct {
  7. Video int64 `json:"video"`
  8. Bangumi int `json:"bangumi"`
  9. Channel *Num `json:"channel"`
  10. Favourite *Num `json:"favourite"`
  11. Tag int `json:"tag"`
  12. Article int `json:"article"`
  13. Playlist int `json:"playlist"`
  14. Album int64 `json:"album"`
  15. Audio int `json:"audio"`
  16. }
  17. // Num num struct.
  18. type Num struct {
  19. Master int `json:"master"`
  20. Guest int `json:"guest"`
  21. }
  22. // UpStat up stat struct.
  23. type UpStat struct {
  24. Archive struct {
  25. View int64 `json:"view"`
  26. } `json:"archive"`
  27. Article struct {
  28. View int64 `json:"view"`
  29. } `json:"article"`
  30. }
  31. // AccInfo account info.
  32. type AccInfo struct {
  33. Mid int64 `json:"mid"`
  34. Name string `json:"name"`
  35. Sex string `json:"sex"`
  36. Face string `json:"face"`
  37. Sign string `json:"sign"`
  38. Rank int32 `json:"rank"`
  39. Level int32 `json:"level"`
  40. JoinTime int32 `json:"jointime"`
  41. Moral int32 `json:"moral"`
  42. Silence int32 `json:"silence"`
  43. Birthday string `json:"birthday"`
  44. Coins float64 `json:"coins"`
  45. FansBadge bool `json:"fans_badge"`
  46. Official accmdl.OfficialInfo `json:"official"`
  47. Vip struct {
  48. Type int32 `json:"type"`
  49. Status int32 `json:"status"`
  50. } `json:"vip"`
  51. IsFollowed bool `json:"is_followed"`
  52. TopPhoto string `json:"top_photo"`
  53. Theme interface{} `json:"theme"`
  54. }
  55. // AccBlock acc block
  56. type AccBlock struct {
  57. Status int `json:"status"`
  58. IsDue int `json:"is_due"`
  59. IsAnswered int `json:"is_answered"`
  60. }
  61. // TopPhoto top photo struct.
  62. type TopPhoto struct {
  63. SImg string `json:"s_img"`
  64. LImg string `json:"l_img"`
  65. }
  66. // Relation .
  67. type Relation struct {
  68. Relation interface{} `json:"relation"`
  69. BeRelation interface{} `json:"be_relation"`
  70. }
  71. // FromCard from account card.
  72. func (ai *AccInfo) FromCard(c *accmdl.ProfileStatReply) {
  73. ai.Mid = c.Profile.Mid
  74. ai.Name = c.Profile.Name
  75. ai.Rank = c.Profile.Rank
  76. ai.Face = c.Profile.Face
  77. ai.Sex = c.Profile.Sex
  78. ai.JoinTime = c.Profile.JoinTime
  79. ai.Silence = c.Profile.Silence
  80. ai.Birthday = c.Profile.Birthday.Time().Format("01-02")
  81. ai.Sign = c.Profile.Sign
  82. ai.Level = c.Profile.Level
  83. ai.Official = c.Profile.Official
  84. ai.Vip.Type = c.Profile.Vip.Type
  85. ai.Vip.Status = c.Profile.Vip.Status
  86. ai.Coins = c.Coins
  87. }
  88. var (
  89. // DefaultProfileStat .
  90. DefaultProfileStat = &accmdl.ProfileStatReply{
  91. Profile: DefaultProfile,
  92. LevelInfo: accmdl.LevelInfo{},
  93. }
  94. // DefaultProfile .
  95. DefaultProfile = &accmdl.Profile{
  96. Name: "bilibili",
  97. Sex: "保密",
  98. Face: "https://static.hdslb.com/images/member/noface.gif",
  99. Sign: "哔哩哔哩 (゜-゜)つロ 干杯~-bilibili",
  100. Rank: 5000,
  101. }
  102. )