rpc.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. package model
  2. import (
  3. "encoding/json"
  4. "go-common/library/log"
  5. "go-common/library/time"
  6. )
  7. // ArgMid arg mid.
  8. type ArgMid struct {
  9. Mid int64
  10. RealIP string
  11. }
  12. // ArgMid2 arg mid2.
  13. type ArgMid2 struct {
  14. Mid int64 `form:"mid" validate:"min=1,required"` // 用户mid
  15. RealIP string
  16. }
  17. // ArgMemberMid is.
  18. type ArgMemberMid struct {
  19. Mid int64 `json:"mid"`
  20. RemoteIP string `json:"remoteIP"`
  21. }
  22. // ArgMemberMids are.
  23. type ArgMemberMids struct {
  24. Mids []int64 `json:"mids"`
  25. RemoteIP string `json:"remoteIP"`
  26. }
  27. // ArgOfficialDoc arg official doc
  28. type ArgOfficialDoc struct {
  29. Mid int64 `json:"mid"`
  30. Name string `json:"name"`
  31. Role int8 `json:"role"`
  32. Title string `json:"title"`
  33. Desc string `json:"desc"`
  34. Realname int8 `json:"realname"`
  35. Operator string `json:"operator"`
  36. Telephone string `json:"telephone"`
  37. Email string `json:"email"`
  38. Address string `json:"address"`
  39. Company string `json:"company"`
  40. CreditCode string `json:"credit_code"` // 社会信用代码
  41. Organization string `json:"organization"` // 政府或组织名称
  42. OrganizationType string `json:"organization_type"` // 组织或机构类型
  43. BusinessLicense string `json:"business_license"` // 企业营业执照
  44. BusinessScale string `json:"business_scale"` // 企业规模
  45. BusinessLevel string `json:"business_level"` // 企业登记
  46. BusinessAuth string `json:"business_auth"` // 企业授权函
  47. Supplement string `json:"supplement"` // 其他补充材料
  48. Professional string `json:"professional"` // 专业资质
  49. Identification string `json:"identification"` // 身份证明
  50. OfficialSite string `json:"official_site"` // 官网地址
  51. RegisteredCapital string `json:"registered_capital"` // 注册资金
  52. SubmitSource string `json:"submit_source"` // 提交来源
  53. }
  54. // Log define user login log.
  55. type Log struct {
  56. Mid int64 `json:"mid,omitempty"`
  57. IP uint32 `json:"loginip"`
  58. Location string `json:"location"`
  59. LocationID int64 `json:"location_id,omitempty"`
  60. Time time.Time `json:"timestamp,omitempty"`
  61. Type int8 `json:"type,omitempty"`
  62. }
  63. // Msg is user login status msg.
  64. type Msg struct {
  65. Notify bool `json:"notify"`
  66. Log *Log `json:"log"`
  67. }
  68. // ArgUpdateSex is.
  69. type ArgUpdateSex struct {
  70. Mid int64 `json:"mid"`
  71. Sex int64 `json:"sex"`
  72. RemoteIP string `json:"remoteIP"`
  73. }
  74. // ArgUpdateFace is.
  75. type ArgUpdateFace struct {
  76. Mid int64 `json:"mid"`
  77. Face string `json:"face"`
  78. RemoteIP string `json:"remoteIP"`
  79. }
  80. // ArgUpdateRank is.
  81. type ArgUpdateRank struct {
  82. Mid int64 `json:"mid"`
  83. Rank int64 `json:"rank"`
  84. RemoteIP string `json:"remoteIP"`
  85. }
  86. // ArgUpdateBirthday is.
  87. type ArgUpdateBirthday struct {
  88. Mid int64 `json:"mid"`
  89. Birthday time.Time `json:"birthday"`
  90. RemoteIP string `json:"remoteIP"`
  91. }
  92. // ArgUpdateUname arg for update uname.
  93. type ArgUpdateUname struct {
  94. Mid int64 `json:"mid"`
  95. Name string `json:"name"`
  96. RemoteIP string `json:"remoteIP"`
  97. }
  98. // ArgUpdateSign arg for udpate sign.
  99. type ArgUpdateSign struct {
  100. Mid int64 `json:"mid"`
  101. Sign string `json:"sign"`
  102. RemoteIP string `json:"remoteIP"`
  103. }
  104. // ArgAddExp addexp arg.
  105. type ArgAddExp struct {
  106. Mid int64 `json:"mid,omitempty" form:"mid" validate:"min=1,required"` // 用户mid
  107. Count float64 `json:"count,omitempty" form:"count" validate:"required"` // 修改数量
  108. Reason string `json:"reason,omitempty" form:"reason" validate:"required"` // 修改原因
  109. Operate string `json:"operate,omitempty" form:"operate" validate:"required"` // 操作类型
  110. IP string `json:"ip" form:"ip"`
  111. }
  112. // ExpStat user exp stat.
  113. type ExpStat struct {
  114. Login bool `json:"login"`
  115. Watch bool `json:"watch_av"`
  116. Coin int64 `json:"coins_av"`
  117. Share bool `json:"share_av"`
  118. }
  119. // ArgRealnameApply realname apply
  120. type ArgRealnameApply struct {
  121. MID int64
  122. CaptureCode int
  123. Realname string
  124. CardType int8
  125. CardCode string
  126. Country int16
  127. HandIMGToken string
  128. FrontIMGToken string
  129. BackIMGToken string
  130. }
  131. // ArgRealnameAlipayConfirm is
  132. type ArgRealnameAlipayConfirm struct {
  133. MID int64
  134. Pass bool
  135. Reason string
  136. }
  137. // ArgRealnameAlipayApply is
  138. type ArgRealnameAlipayApply struct {
  139. MID int64
  140. CaptureCode int
  141. Realname string
  142. CardCode string
  143. IMGToken string
  144. Bizno string
  145. }
  146. // ArgAddUserMonitor is
  147. type ArgAddUserMonitor struct {
  148. Mid int64
  149. Operator string
  150. Remark string
  151. }
  152. // ArgAddPropertyReview is.
  153. type ArgAddPropertyReview struct {
  154. Mid int64 `form:"mid" validate:"min=1,required"` // 用户mid
  155. New string `form:"new"` // 新的值
  156. State int8 `form:"state"` // 0 待审核,1 通过,2 驳回,10 自动审核中
  157. Property int8 `form:"property"` // 0 无意义,1 头像,2 签名,3 昵称
  158. Extra map[string]interface{} // 审核扩展字段 extra
  159. }
  160. // ExtraStr is.
  161. func (arg *ArgAddPropertyReview) ExtraStr() string {
  162. if arg.Extra == nil {
  163. return "{}"
  164. }
  165. bs, err := json.Marshal(arg.Extra)
  166. if err != nil {
  167. log.Error("Failed to marshal extra: %+v, error: %+v", arg.Extra, err)
  168. return "{}"
  169. }
  170. return string(bs)
  171. }