mcn.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // EmailState .
  6. type EmailState int8
  7. // const .
  8. const (
  9. EmailStateSendNone EmailState = 1
  10. EmailStateSendSucc EmailState = 2
  11. )
  12. // MCNSignState .
  13. type MCNSignState int8
  14. // const .
  15. const (
  16. // MCNSignStateNoApply 未申请
  17. MCNSignStateNoApply MCNSignState = 0
  18. // MCNSignStateOnReview 待审核
  19. MCNSignStateOnReview MCNSignState = 1
  20. // MCNSignStateOnReject 已驳回
  21. MCNSignStateOnReject MCNSignState = 2
  22. // MCNSignStateOnSign 已签约
  23. MCNSignStateOnSign MCNSignState = 10
  24. // MCNSignStateOnCooling 冷却中
  25. MCNSignStateOnCooling MCNSignState = 11
  26. // MCNSignStateOnExpire 已到期
  27. MCNSignStateOnExpire MCNSignState = 12
  28. // MCNSignStateOnBlock 已封禁
  29. MCNSignStateOnBlock MCNSignState = 13
  30. // MCNSignStateOnClear 已清退
  31. MCNSignStateOnClear MCNSignState = 14
  32. // MCNSignStateOnPreOpen 待开启
  33. MCNSignStateOnPreOpen MCNSignState = 15
  34. // MCNSignStateOnDelete 已移除
  35. MCNSignStateOnDelete MCNSignState = 100
  36. )
  37. // NotDealState .
  38. func (mss MCNSignState) NotDealState() bool {
  39. if mss == MCNSignStateNoApply || mss == MCNSignStateOnReview || mss == MCNSignStateOnReject ||
  40. mss == MCNSignStateOnBlock || mss == MCNSignStateOnClear || mss == MCNSignStateOnDelete ||
  41. mss == MCNSignStateOnExpire {
  42. return true
  43. }
  44. return false
  45. }
  46. // MCNSignInfo .
  47. type MCNSignInfo struct {
  48. SignID int64 `json:"sign_id"`
  49. McnMid int64 `json:"mcn_mid"`
  50. McnName string `json:"mcn_name"`
  51. CompanyName string `json:"company_name"`
  52. CompanyLicenseID string `json:"company_license_id"`
  53. CompanyLicenseLink string `json:"company_license_link"`
  54. ContractLink string `json:"contract_link"`
  55. ContactName string `json:"contact_name"`
  56. ContactTitle string `json:"contact_title"`
  57. ContactPhone string `json:"contact_phone"`
  58. ContactIdcard string `json:"contact_idcard"`
  59. BeginDate xtime.Time `json:"begin_date"`
  60. EndDate xtime.Time `json:"end_date"`
  61. PayExpireState int8 `json:"pay_expire_state"`
  62. State MCNSignState `json:"state"`
  63. RejectTime xtime.Time `json:"reject_time"`
  64. RejectReason string `json:"reject_reason"`
  65. Ctime xtime.Time `json:"ctime"`
  66. Mtime xtime.Time `json:"mtime"`
  67. }
  68. // SignPayInfo .
  69. type SignPayInfo struct {
  70. SignPayID int64 `json:"sign_pay_id"`
  71. McnMid int64 `json:"mcn_mid"`
  72. McnName string `json:"mcn_name"`
  73. SignID int64 `json:"sign_id"`
  74. State int8 `json:"state"`
  75. DueDate xtime.Time `json:"due_date"`
  76. PayValue int64 `json:"pay_value"` // thousand bit
  77. }
  78. // GetDueDate used for template
  79. func (s *SignPayInfo) GetDueDate() string {
  80. return s.DueDate.Time().Format(TimeFormatDay)
  81. }
  82. // GetPayValue for template
  83. func (s *SignPayInfo) GetPayValue() float64 {
  84. return float64(s.PayValue) / 1000.0
  85. }
  86. // MCNUPState .
  87. type MCNUPState int8
  88. // const .
  89. const (
  90. // MCNUPStateNoAuthorize 未授权
  91. MCNUPStateNoAuthorize MCNUPState = 0
  92. // MCNUPStateOnRefuse 已拒绝
  93. MCNUPStateOnRefuse MCNUPState = 1
  94. // MCNUPStateOnReview 待审核
  95. MCNUPStateOnReview MCNUPState = 2
  96. // MCNSignStateOnReject 已驳回
  97. MCNUPStateOnReject MCNUPState = 3
  98. // MCNUPStateOnSign 已签约
  99. MCNUPStateOnSign MCNUPState = 10
  100. // MCNUPStateOnFreeze 已冻结
  101. MCNUPStateOnFreeze MCNUPState = 11
  102. // MCNUPStateOnExpire 已到期
  103. MCNUPStateOnExpire MCNUPState = 12
  104. // MCNUPStateOnBlock 已封禁
  105. MCNUPStateOnBlock MCNUPState = 13
  106. // MCNUPStateOnClear 已解约
  107. MCNUPStateOnClear MCNUPState = 14
  108. // MCNUPStateOnPreOpen 待开启
  109. MCNUPStateOnPreOpen MCNUPState = 15
  110. // MCNUPStateOnDelete 已删除
  111. MCNUPStateOnDelete MCNUPState = 100
  112. )
  113. // MCNUPInfo .
  114. type MCNUPInfo struct {
  115. SignUpID int64 `json:"sign_up_id"`
  116. SignID int64 `json:"sign_id"`
  117. McnMid int64 `json:"mcn_mid"`
  118. UpMid int64 `json:"up_mid"`
  119. BeginDate xtime.Time `json:"begin_date"`
  120. EndDate xtime.Time `json:"end_date"`
  121. ContractLink string `json:"contract_link"`
  122. UpAuthLink string `json:"up_auth_link"`
  123. RejectTime xtime.Time `json:"reject_time"`
  124. RejectReason string `json:"reject_reason"`
  125. State MCNUPState `json:"state"`
  126. StateChangeTime xtime.Time `json:"state_change_time"`
  127. Ctime xtime.Time `json:"ctime"`
  128. Mtime xtime.Time `json:"mtime"`
  129. UpName string `json:"up_name"`
  130. FansCount int64 `json:"fans_count"`
  131. ActiveTid int64 `json:"active_tid"`
  132. }
  133. // NotDealState .
  134. func (mus MCNUPState) NotDealState() bool {
  135. if mus == MCNUPStateNoAuthorize || mus == MCNUPStateOnRefuse || mus == MCNUPStateOnReview ||
  136. mus == MCNUPStateOnReject || mus == MCNUPStateOnFreeze || mus == MCNUPStateOnExpire ||
  137. mus == MCNUPStateOnBlock || mus == MCNUPStateOnClear || mus == MCNUPStateOnDelete {
  138. return true
  139. }
  140. return false
  141. }