medal.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. const (
  6. // OwnerActivated medal_owner is_activated=1 .
  7. OwnerActivated = int8(1)
  8. // OwnerNotActivated medal_owner is_activated=0 .
  9. OwnerNotActivated = int8(0)
  10. // MaxCount medal batch add max.
  11. MaxCount = 2000
  12. // MedalSourceTypeAdmin medal source type admin.
  13. MedalSourceTypeAdmin = int8(1)
  14. )
  15. // Medal medal info .
  16. type Medal struct {
  17. ID int64 `form:"id" json:"id"`
  18. GID int64 `form:"gid" validate:"required" json:"gid"`
  19. Name string `form:"name" validate:"required" json:"name"`
  20. Description string `form:"description" validate:"required" json:"description"`
  21. Image string `form:"image" validate:"required" json:"image"`
  22. ImageSmall string `form:"image_small" validate:"required" json:"image_small"`
  23. Condition string `form:"condition" validate:"required" json:"condition"`
  24. Level int8 `form:"level" validate:"min=1,max=3" json:"level"`
  25. LevelRank string `form:"level_rank" validate:"required" json:"level_rank"`
  26. Sort int `form:"sort" validate:"required" json:"sort"`
  27. IsOnline int `form:"is_online" json:"is_online"`
  28. CTime xtime.Time `json:"ctime,omitempty"`
  29. MTime xtime.Time `json:"mtime,omitempty"`
  30. }
  31. // MedalGroup nameplate group .
  32. type MedalGroup struct {
  33. ID int64 `form:"id" json:"id"`
  34. PID int64 `form:"pid" json:"pid"`
  35. Rank int8 `form:"rank" validate:"required" json:"rank"`
  36. IsOnline int8 `form:"is_online" json:"is_online"`
  37. Name string `form:"name" validate:"required" json:"name"`
  38. PName string `form:"pname" json:"pname,omitempty"`
  39. CTime xtime.Time `json:"ctime,omitempty"`
  40. MTime xtime.Time `json:"mtime,omitempty"`
  41. }
  42. // MedalOwner nameplate owner .
  43. type MedalOwner struct {
  44. ID int64 `json:"id"`
  45. MID int64 `json:"mid"`
  46. NID int64 `json:"nid"`
  47. IsActivated int8 `json:"is_activated"`
  48. IsDel int8 `json:"is_del"`
  49. CTime xtime.Time `json:"ctime"`
  50. MTime xtime.Time `json:"mtime"`
  51. }
  52. // MedalInfo struct.
  53. type MedalInfo struct {
  54. *Medal
  55. GroupName string `json:"group_name"`
  56. ParentGroupName string `json:"parent_group_name"`
  57. }
  58. // MedalMemberMID struct.
  59. type MedalMemberMID struct {
  60. ID int64 `json:"id"`
  61. NID int64 `json:"nid"`
  62. MedalName string `json:"medal_name"`
  63. IsActivated int8 `json:"is_activated"`
  64. IsDel int8 `json:"is_del"`
  65. }
  66. // MedalMemberAddList struct.
  67. type MedalMemberAddList struct {
  68. ID int64 `json:"id"`
  69. MedalName string `json:"medal_name"`
  70. }
  71. // MedalOperLog struct.
  72. type MedalOperLog struct {
  73. OID int64 `json:"oper_id"`
  74. Action string `json:"action"`
  75. CTime xtime.Time `json:"ctime"`
  76. MTime xtime.Time `json:"mtime"`
  77. OperName string `json:"oper_name"`
  78. MID int64 `json:"mid"`
  79. MedalID int64 `json:"medal_id"`
  80. SourceType int8 `json:"source_type"`
  81. }