wx_user.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. }
  58. // TableName get sql table name.获取数据库表名
  59. func (m *WxUser) TableName() string {
  60. return "wx_user"
  61. }
  62. // WxUserColumns get sql column name.获取数据库列名
  63. var WxUserColumns = struct {
  64. UserID string
  65. OpenID string
  66. UnionID string
  67. Subscribe string
  68. CompanyID string
  69. NickName string
  70. RealName string
  71. UserCode string
  72. Mobile string
  73. BindAccount string
  74. WxCode string
  75. Profession string
  76. Email string
  77. Telephone string
  78. Sex string
  79. Province string
  80. City string
  81. Country string
  82. SubscribeTime string
  83. Remark string
  84. Headimgurl string
  85. Privilege string
  86. Unionid string
  87. FirstLogin string
  88. Enabled string
  89. CreatedTime string
  90. LastUpdatedTime string
  91. Seller string
  92. Note string
  93. IsNote string
  94. FromType string
  95. ApplyMethod string
  96. Position string
  97. IsMaker string
  98. BusinessCardURL string
  99. MobileTwo string
  100. DepartmentName string
  101. ReportLastViewTime string
  102. RegisterTime string
  103. IsFreeLogin string
  104. LoginTime string
  105. RegisterPlatform string
  106. SessionKey string
  107. CountryCode string
  108. IsRegister string
  109. Source string
  110. IsDeal string
  111. OutboundMobile string
  112. OutboundCountryCode string
  113. IsMsgOutboundMobile string
  114. }{
  115. UserID: "user_id",
  116. OpenID: "open_id",
  117. UnionID: "union_id",
  118. Subscribe: "subscribe",
  119. CompanyID: "company_id",
  120. NickName: "nick_name",
  121. RealName: "real_name",
  122. UserCode: "user_code",
  123. Mobile: "mobile",
  124. BindAccount: "bind_account",
  125. WxCode: "wx_code",
  126. Profession: "profession",
  127. Email: "email",
  128. Telephone: "telephone",
  129. Sex: "sex",
  130. Province: "province",
  131. City: "city",
  132. Country: "country",
  133. SubscribeTime: "subscribe_time",
  134. Remark: "remark",
  135. Headimgurl: "headimgurl",
  136. Privilege: "privilege",
  137. Unionid: "unionid",
  138. FirstLogin: "first_login",
  139. Enabled: "enabled",
  140. CreatedTime: "created_time",
  141. LastUpdatedTime: "last_updated_time",
  142. Seller: "seller",
  143. Note: "note",
  144. IsNote: "is_note",
  145. FromType: "from_type",
  146. ApplyMethod: "apply_method",
  147. Position: "position",
  148. IsMaker: "is_maker",
  149. BusinessCardURL: "business_card_url",
  150. MobileTwo: "mobile_two",
  151. DepartmentName: "department_name",
  152. ReportLastViewTime: "report_last_view_time",
  153. RegisterTime: "register_time",
  154. IsFreeLogin: "is_free_login",
  155. LoginTime: "login_time",
  156. RegisterPlatform: "register_platform",
  157. SessionKey: "session_key",
  158. CountryCode: "country_code",
  159. IsRegister: "is_register",
  160. Source: "source",
  161. IsDeal: "is_deal",
  162. OutboundMobile: "outbound_mobile",
  163. OutboundCountryCode: "outbound_country_code",
  164. IsMsgOutboundMobile: "is_msg_outbound_mobile",
  165. }