sysmail.go 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package model
  2. import "fmt"
  3. // TSysMailTemplate [...]
  4. type TSysMailTemplate struct {
  5. Id int64 `db:"id" json:"id"`
  6. Content map[string]SystemMailContent `db:"content" json:"content"` // 模板内容
  7. Remark string `db:"remark" json:"remark"` // 注释
  8. }
  9. // TableName get sql table name.获取数据库表名
  10. func (TSysMailTemplate) TableName() string {
  11. return "crazygod_api_config.t_sys_mail_template"
  12. }
  13. type SystemMailContent struct {
  14. Title string `db:"title" json:"title"`
  15. Body string `db:"body" json:"body"`
  16. }
  17. // TSysMailSchedule [...]
  18. type TSysMailSchedule struct {
  19. SysMailScheduleSub
  20. Days int64 `db:"days" json:"days"` // 显示天数
  21. OnlineStart int64 `db:"online_start" json:"online_start"`
  22. OnlineEnd int64 `db:"online_end" json:"online_end"`
  23. LevelStart int64 `db:"level_start" json:"level_start"` // 等级区间
  24. LevelEnd int64 `db:"level_end" json:"level_end"` // 等级区间
  25. ScoreStart int64 `db:"score_start" json:"score_start"` // 积分区间
  26. ScoreEnd int64 `db:"score_end" json:"score_end"` // 积分区间
  27. Sid int64 `db:"sid" json:"sid"` // 设备
  28. Langs []string `db:"langs" json:"langs"` // 语言编码
  29. Version []string `db:"version" json:"version"` // 版本范围
  30. }
  31. // TableName get sql table name.获取数据库表名
  32. func (TSysMailSchedule) TableName() string {
  33. return "crazygod_api_config.t_sys_mail_schedule"
  34. }
  35. // SysMailScheduleSub [...]
  36. type SysMailScheduleSub struct {
  37. Id int64 `db:"id" json:"id"`
  38. TemplateId int64 `db:"template_id" json:"template_id"`
  39. Rewards []PropPrize `db:"rewards" json:"rewards"` // 邮件奖励
  40. Remark string `db:"remark" json:"remark"` // 注释
  41. Uids string `db:"uids" json:"uids"` // uid列表
  42. AliveStart int64 `db:"alive_start" json:"alive_start"`
  43. AliveEnd int64 `db:"alive_end" json:"alive_end"`
  44. CreateTime int64 `db:"create_time" json:"create_time"` // 创建时间
  45. Operator string `db:"operator" json:"operator"` // 创建时间
  46. }
  47. // TableName get sql table name.获取数据库表名
  48. func (SysMailScheduleSub) TableName() string {
  49. return "crazygod_api_config.t_sys_mail_schedule"
  50. }
  51. type SysMailScheduleShow struct {
  52. Id int64 `json:"id"`
  53. Template string `json:"template"`
  54. Rewards []PropPrize `json:"rewards"` // 邮件奖励
  55. Remark string `json:"remark"` // 注释
  56. Type int64 `json:"type"` // 发送类型
  57. Status int64 `json:"status"` // 发送状态
  58. CreateTime string `json:"create_time"` // 创建时间
  59. Operator string `json:"operator"` // 创建时间
  60. }
  61. // UserSysMail [...]
  62. type UserSysMail struct {
  63. Id int64 `db:"id" json:"id"` // 邮件id
  64. Uid int64 `db:"uid" json:"uid"` // 玩家id
  65. Msgid int64 `db:"msgid" json:"msgid"` // 邮件模板id
  66. Got int64 `db:"got" json:"got"` // 状态:(0:未读,1:已读,2:已领)
  67. Rewards []PropPrize `db:"rewards" json:"rewards"` // 奖励
  68. Expire int64 `db:"expire" json:"expire"` // 过期时间
  69. CreateTime int64 `db:"create_time" json:"create_time"` // 创建时间
  70. Supplement *DocModel `db:"supplement" json:"supplement"` // 补充内容
  71. }
  72. type DocModel struct {
  73. Title []string `json:"title"`
  74. Body []string `json:"body"`
  75. }
  76. // TableName get sql table name.获取数据库表名
  77. func (UserSysMail) TableName(uid int64) string {
  78. return fmt.Sprintf("crazygod_user_sysmail.user_sysmail_%d", uid%100)
  79. }
  80. type SendMailRewardsConf struct {
  81. Uids []int64 `json:"uids"`
  82. MsgId int64 `json:"msgId"`
  83. Rewards []PropPrize `json:"rewards"`
  84. }