admin_email.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package forms
  2. import "errors"
  3. type AdminEmailListReq struct {
  4. ListReq
  5. Sender string `json:"sender" form:"sender"`
  6. OperatorId int64 `json:"operatorId" form:"operatorId"`
  7. CreatedAt []int64 `json:"createdAt" form:"createdAt"`
  8. IsExport int `json:"isExport" form:"isExport"`
  9. }
  10. func (req *AdminEmailListReq) Check() error {
  11. if req.CreatedAt != nil && len(req.CreatedAt) != 2 {
  12. return errors.New("生成时间必须选择一个区间或者留空")
  13. }
  14. if len(req.CreatedAt) == 2 {
  15. if req.CreatedAt[0] > req.CreatedAt[1] {
  16. return errors.New("生成时间选择的区间值不合理")
  17. }
  18. // 默认是毫秒
  19. req.CreatedAt[0] = req.CreatedAt[0] / 1000
  20. req.CreatedAt[1] = req.CreatedAt[1] / 1000
  21. }
  22. return nil
  23. }
  24. type AdminEmailListRes struct {
  25. ListRes
  26. }
  27. type AdminEmailAddReq struct {
  28. Id int64 `json:"id"`
  29. Title string `json:"title"` // 标题
  30. Content string `json:"content"` // 内容
  31. Ext []struct {
  32. Id string `json:"id"`
  33. Count string `json:"count"`
  34. } `json:"ext"` // 奖励材料
  35. SendType int32 `json:"sendType"` // 1 立即发送 0 待发送
  36. SendAt int64 `json:"sendAt"` // 准备发送的时间
  37. Expired int32 `json:"expired"` // 过期天数
  38. ReceiptType int32 `json:"receiptType"` // 收件类型 1全服 2指定服 3指定玩家
  39. ServerIds []int32 `json:"serverIds"`
  40. PlayerIds []string `json:"playerIds"`
  41. Remark string `json:"remark"`
  42. }
  43. type AdminEmailAddRes struct {
  44. }
  45. type AdminEmailVerifyReq struct {
  46. Id int64 `json:"id"`
  47. VerifyStatus int `json:"verifyStatus"`
  48. }
  49. type AdminEmailVerifyRes struct {
  50. }