user.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package constant
  2. // 用户JWTToken里的key信息
  3. const (
  4. UserMemberLevelKey = "memberLevel"
  5. UserUserNameKey = "username"
  6. UserUuid = "userUuid"
  7. UserDeviceIdKey = "deviceId"
  8. UserCountryKey = "country"
  9. UserAccountKey = "accountKey"
  10. UserAccountPwdKey = "accountPassword"
  11. UserCreateTimeKey = "createTime"
  12. UserIpKey = "userIp"
  13. UserStatus = "userStatus"
  14. UserActiveStatus = "userActiveStatus"
  15. UserRegistModeKey = "UserRegistModeKey"
  16. UserProviderKey = "UserProviderKey"
  17. )
  18. // 白名单用户
  19. const (
  20. WhitelistNormalUser = 1
  21. WhitelistUser = 2
  22. )
  23. // 测试用户
  24. const (
  25. TestNormalUser = 1
  26. TestUser = 2
  27. )
  28. // 会员类型,游客 1,普通会员 2
  29. const (
  30. UserMemberVisitorLevel0 = 1
  31. UserMemberAccountLevel = 2
  32. )
  33. // 从哪里注册
  34. const (
  35. RegistFromUnknown = 0 // 未知
  36. RegistFromGuest = 1 // 游客
  37. RegistFromApp = 2 // App
  38. RegistFromWeb = 3 // Web
  39. RegistFromPc = 4 // pc
  40. RegistFromInvalid = 9999 // invalid
  41. )
  42. const (
  43. AccountActivate = 1
  44. AccountUnActivate = 2
  45. )
  46. // 支付渠道: alipay-支付宝,wechat-微信,appstore-苹果支付,googleplay-谷歌支付,agent,portal-其他
  47. const (
  48. PayChannelAlipay = "alipay"
  49. PayChannelWechat = "wechat"
  50. PayChannelAppstore = "appstore"
  51. PayChannelGooglePlay = "googleplay"
  52. PayChannelAgent = "agent" // 代理商
  53. PayChannelPortal = "portal" //如:官网调用
  54. )
  55. // username, email, phone, wechat, qq, google, apple
  56. const (
  57. AccountTypeUsername = "username"
  58. AccountTypeEmail = "email"
  59. AccountTypePhone = "phone"
  60. AccountTypeWechat = "wechat"
  61. AccountTypeQQ = "qq"
  62. AccountTypeGoogle = "google"
  63. AccountTypeApple = "apple"
  64. )
  65. // 权益常量定义
  66. const (
  67. ServiceTypeCodeUserLevel = "user_level"
  68. ServiceTypeCodeDeviceLimit = "device_limit"
  69. ServiceTypeCodeSpeedLimit = "speed_limit"
  70. ServiceTypeCodeTrafficLimit = "traffic_limit"
  71. )
  72. const (
  73. ServiceChannelPlanSkuTrial = "app.flashlink.subscribe.1.trial" //默认试用套餐,如果没有指定套餐,默认试用这个套餐
  74. )