user_poster.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package entity
  2. import "time"
  3. type PosterInfoRequest struct {
  4. PosterID int64 `form:"id" binding:"required"`
  5. }
  6. type UserPosterInfo struct {
  7. Code ResCode
  8. Msg string
  9. Body UserPoster
  10. }
  11. type UserPosterInfoForApi struct {
  12. Code ResCode
  13. Msg string
  14. Body struct {
  15. Poster UserPoster `json:"poster"`
  16. }
  17. }
  18. type UserPostersForApi struct {
  19. Code ResCode `json:"code"`
  20. Msg string `json:"msg"`
  21. Body map[string][]PostersListForApi `json:"body"`
  22. }
  23. type PostersListForApi struct {
  24. Id int64 `json:"id"`
  25. Name string `json:"name"`
  26. Preview string `json:"preview"`
  27. Status int64 `json:"status"`
  28. Visits int64 `json:"visits"`
  29. CreateAt time.Time `json:"createTime"`
  30. }
  31. type UserPoster struct {
  32. PosterID int64 `gorm:"column:poster_id" json:"id"`
  33. Name string `gorm:"column:poster_name" json:"name"`
  34. UUID string `gorm:"column:uuid" json:"uuid"`
  35. Uid int64 `gorm:"column:uid" json:"uid"`
  36. PosterKeywords string `gorm:"column:poster_keywords" json:"poster_Keywords"`
  37. PosterJson string `gorm:"column:poster_json" json:"json"`
  38. Preview string `gorm:"column:preview" json:"preview"`
  39. Visit string `gorm:"column:visit" json:"visit"`
  40. Status string `gorm:"column:status;default:1" json:"status"`
  41. CreateAt time.Time `gorm:"column:create_at" json:"create_at"`
  42. UpdateAt time.Time `gorm:"column:update_at;default:CURRENT_TIMESTAMP" json:"update_at"`
  43. }
  44. type PosterJson struct {
  45. Id string `json:"id"`
  46. Name string `json:"name"`
  47. Width uint `json:"w"`
  48. Height uint `json:"h"`
  49. Use string `json:"use"`
  50. Background string `json:"bgc"`
  51. BackgroundUrl string `json:"bgUrl"`
  52. Type string `json:"type"`
  53. Quality int `json:"quality"`
  54. Scale float64 `json:"scale"`
  55. Key string `json:"key"`
  56. Items []Items `json:"items"`
  57. }
  58. type Items struct {
  59. Type string `json:"t"`
  60. Remark string `json:"name"`
  61. UUID string `json:"uuid"`
  62. X int `json:"x"`
  63. Y int `json:"y"`
  64. Width uint `json:"w"`
  65. Height uint `json:"h"`
  66. ZIndex int `json:"z"`
  67. Angle int `json:"angle"`
  68. Size int `json:"s"`
  69. Color string `json:"c"`
  70. Background string `json:"bgc"`
  71. Value string `json:"v"`
  72. Name string `json:"vd"`
  73. Font string `json:"fn"`
  74. St int `json:"st"`
  75. Active bool `json:"active"`
  76. Lock bool `json:"lock"`
  77. AspectRatio bool `json:"aspectRatio"`
  78. P int `json:"p,omitempty"`
  79. Align *string `json:"a,omitempty"`
  80. Wrap *bool `json:"wrap,omitempty"`
  81. Bius *string `json:"bius,omitempty"`
  82. }