wx_user.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package wx_user
  2. import (
  3. "time"
  4. )
  5. // WxUser 联系人表
  6. type WxUser struct {
  7. UserID uint64 `gorm:"primaryKey;column:user_id;type:bigint(20) unsigned;not null" json:"userId"` // 用户id
  8. OpenID string `gorm:"index:open_id;column:open_id;type:varchar(32)" json:"openId"` // open_id
  9. UnionID string `gorm:"column:union_id;type:varchar(64)" json:"unionId"`
  10. Subscribe int8 `gorm:"column:subscribe;type:tinyint(1)" json:"subscribe"` // 是否关注
  11. CompanyID int64 `gorm:"index:inx_company_id;column:company_id;type:bigint(20)" json:"companyId"` // 客户id
  12. NickName string `gorm:"index:nick_name;column:nick_name;type:varchar(32)" json:"nickName"` // 用户昵称
  13. RealName string `gorm:"column:real_name;type:varchar(32)" json:"realName"` // 用户实际名称
  14. UserCode string `gorm:"column:user_code;type:varchar(32)" json:"userCode"` // 用户编码
  15. Mobile string `gorm:"column:mobile;type:varchar(32)" json:"mobile"` // 手机号码
  16. BindAccount string `gorm:"column:bind_account;type:varchar(128);default:''" json:"bindAccount"` // 绑定时的账号
  17. WxCode string `gorm:"column:wx_code;type:varchar(32)" json:"wxCode"` // 微信号
  18. Profession string `gorm:"column:profession;type:varchar(32)" json:"profession"` // 职业
  19. Email string `gorm:"column:email;type:varchar(100)" json:"email"` // 邮箱
  20. Telephone string `gorm:"column:telephone;type:varchar(32)" json:"telephone"` // 座机
  21. Sex int64 `gorm:"column:sex;type:bigint(20)" json:"sex"` // 普通用户性别,1为男性,2为女性
  22. Province string `gorm:"index:province;column:province;type:varchar(30)" json:"province"` // 普通用户个人资料填写的省份
  23. City string `gorm:"index:city;column:city;type:varchar(30)" json:"city"` // 普通用户个人资料填写的城市
  24. Country string `gorm:"column:country;type:varchar(30)" json:"country"` // 国家,如中国为CN
  25. SubscribeTime time.Time `gorm:"column:subscribe_time;type:datetime" json:"subscribeTime"` // 关注时间
  26. Remark string `gorm:"column:remark;type:varchar(128)" json:"remark"` // 备注
  27. Headimgurl string `gorm:"column:headimgurl;type:varchar(512)" json:"headimgurl"` // 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空
  28. Privilege string `gorm:"column:privilege;type:text" json:"privilege"` // 用户特权信息,json数组,如微信沃卡用户为(chinaunicom)
  29. Unionid string `gorm:"column:unionid;type:varchar(32)" json:"unionid"` // 用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。
  30. FirstLogin int8 `gorm:"column:first_login;type:tinyint(1);default:1" json:"firstLogin"` // 是否第一次登陆
  31. Enabled int8 `gorm:"column:enabled;type:tinyint(1);not null;default:1" json:"enabled"` // 用户状态
  32. CreatedTime time.Time `gorm:"index:created_time;column:created_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createdTime"` // 创建时间
  33. LastUpdatedTime time.Time `gorm:"index:last_updated_time;column:last_updated_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"lastUpdatedTime"`
  34. Seller string `gorm:"column:seller;type:varchar(200)" json:"seller"` // 销售员
  35. Note string `gorm:"column:note;type:varchar(128)" json:"note"` // 客户备份信息
  36. IsNote int8 `gorm:"column:is_note;type:tinyint(1);default:0" json:"isNote"` // 是否备注过信息
  37. FromType string `gorm:"column:from_type;type:varchar(30);default:report" json:"fromType"` // report:研报,teleconference:电话会,advisory:每日资讯,
  38. ApplyMethod int8 `gorm:"column:apply_method;type:tinyint(2);default:0" json:"applyMethod"` // 0:未申请,1:已付费客户申请试用,2:非客户申请试用
  39. Position string `gorm:"column:position;type:varchar(50);default:''" json:"position"` // 职位
  40. IsMaker int8 `gorm:"column:is_maker;type:tinyint(4);default:0" json:"isMaker"` // 是否决策人,1:是,0:否
  41. BusinessCardURL string `gorm:"column:business_card_url;type:varchar(255);default:''" json:"businessCardUrl"` // 名片地址
  42. MobileTwo string `gorm:"column:mobile_two;type:varchar(32);default:''" json:"mobileTwo"` // 备用手机号
  43. DepartmentName string `gorm:"column:department_name;type:varchar(50);default:''" json:"departmentName"` // 部门名称
  44. ReportLastViewTime time.Time `gorm:"column:report_last_view_time;type:datetime" json:"reportLastViewTime"` // 最后一次阅读报告时间
  45. RegisterTime time.Time `gorm:"column:register_time;type:datetime" json:"registerTime"` // 注册时间
  46. IsFreeLogin int8 `gorm:"column:is_free_login;type:tinyint(4)" json:"isFreeLogin"` // 是否30天免登陆
  47. LoginTime time.Time `gorm:"column:login_time;type:datetime" json:"loginTime"` // 登录时间
  48. RegisterPlatform int8 `gorm:"column:register_platform;type:tinyint(4);default:1" json:"registerPlatform"` // 注册平台,1:微信端,2:网页端,3:管理后台,4:小程序端
  49. SessionKey string `gorm:"column:session_key;type:varchar(255)" json:"sessionKey"` // 微信小程序会话密钥
  50. CountryCode string `gorm:"column:country_code;type:varchar(255);default:''" json:"countryCode"` // 区号
  51. IsRegister int8 `gorm:"column:is_register;type:tinyint(4)" json:"isRegister"` // 是否注册:1:已注册,0:未注册
  52. Source int8 `gorm:"column:source;type:tinyint(4);default:0" json:"source"` // 来源,1:微信端,2:pc网页端,3:查研观向小程序,4:每日咨询,5:电话会
  53. IsDeal uint8 `gorm:"column:is_deal;type:tinyint(2) unsigned;default:0" json:"isDeal"` // 是否标记处理,0是未处理,1是已处理
  54. OutboundMobile string `gorm:"index:outbound_mobile;column:outbound_mobile;type:varchar(30);default:''" json:"outboundMobile"` // 外呼手机号
  55. OutboundCountryCode string `gorm:"column:outbound_country_code;type:varchar(10);default:''" json:"outboundCountryCode"` // 外呼手机号区号
  56. IsMsgOutboundMobile int8 `gorm:"column:is_msg_outbound_mobile;type:tinyint(1);not null;default:0" json:"isMsgOutboundMobile"` // 是否弹窗过绑定过外呼手机号
  57. QaAvatarUrl string `gorm:"column:qa_avatar_url;type:varchar(255);not null;default:''" json:"qaAvatarUrl"` // 问答社区头像
  58. }
  59. // TableName get sql table name.获取数据库表名
  60. func (wxUser *WxUser) TableName() string {
  61. return "wx_user"
  62. }
  63. // WxUserColumns get sql column name.获取数据库列名
  64. var WxUserColumns = struct {
  65. UserID string
  66. OpenID string
  67. UnionID string
  68. Subscribe string
  69. CompanyID string
  70. NickName string
  71. RealName string
  72. UserCode string
  73. Mobile string
  74. BindAccount string
  75. WxCode string
  76. Profession string
  77. Email string
  78. Telephone string
  79. Sex string
  80. Province string
  81. City string
  82. Country string
  83. SubscribeTime string
  84. Remark string
  85. Headimgurl string
  86. Privilege string
  87. Unionid string
  88. FirstLogin string
  89. Enabled string
  90. CreatedTime string
  91. LastUpdatedTime string
  92. Seller string
  93. Note string
  94. IsNote string
  95. FromType string
  96. ApplyMethod string
  97. Position string
  98. IsMaker string
  99. BusinessCardURL string
  100. MobileTwo string
  101. DepartmentName string
  102. ReportLastViewTime string
  103. RegisterTime string
  104. IsFreeLogin string
  105. LoginTime string
  106. RegisterPlatform string
  107. SessionKey string
  108. CountryCode string
  109. IsRegister string
  110. Source string
  111. IsDeal string
  112. OutboundMobile string
  113. OutboundCountryCode string
  114. IsMsgOutboundMobile string
  115. }{
  116. UserID: "user_id",
  117. OpenID: "open_id",
  118. UnionID: "union_id",
  119. Subscribe: "subscribe",
  120. CompanyID: "company_id",
  121. NickName: "nick_name",
  122. RealName: "real_name",
  123. UserCode: "user_code",
  124. Mobile: "mobile",
  125. BindAccount: "bind_account",
  126. WxCode: "wx_code",
  127. Profession: "profession",
  128. Email: "email",
  129. Telephone: "telephone",
  130. Sex: "sex",
  131. Province: "province",
  132. City: "city",
  133. Country: "country",
  134. SubscribeTime: "subscribe_time",
  135. Remark: "remark",
  136. Headimgurl: "headimgurl",
  137. Privilege: "privilege",
  138. Unionid: "unionid",
  139. FirstLogin: "first_login",
  140. Enabled: "enabled",
  141. CreatedTime: "created_time",
  142. LastUpdatedTime: "last_updated_time",
  143. Seller: "seller",
  144. Note: "note",
  145. IsNote: "is_note",
  146. FromType: "from_type",
  147. ApplyMethod: "apply_method",
  148. Position: "position",
  149. IsMaker: "is_maker",
  150. BusinessCardURL: "business_card_url",
  151. MobileTwo: "mobile_two",
  152. DepartmentName: "department_name",
  153. ReportLastViewTime: "report_last_view_time",
  154. RegisterTime: "register_time",
  155. IsFreeLogin: "is_free_login",
  156. LoginTime: "login_time",
  157. RegisterPlatform: "register_platform",
  158. SessionKey: "session_key",
  159. CountryCode: "country_code",
  160. IsRegister: "is_register",
  161. Source: "source",
  162. IsDeal: "is_deal",
  163. OutboundMobile: "outbound_mobile",
  164. OutboundCountryCode: "outbound_country_code",
  165. IsMsgOutboundMobile: "is_msg_outbound_mobile",
  166. }