web.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package model
  2. import artmdl "go-common/app/interface/openplatform/article/model"
  3. var (
  4. // ArticleSortType article list sort types.
  5. ArticleSortType = map[string]int{
  6. "publish_time": artmdl.FieldDefault,
  7. "view": artmdl.FieldView,
  8. "fav": artmdl.FieldFav,
  9. }
  10. // PrivacyFields privacy allowed field.
  11. PrivacyFields = []string{
  12. "bangumi",
  13. "tags",
  14. "fav_video",
  15. "coins_video",
  16. "groups",
  17. "played_game",
  18. "channel",
  19. "user_info",
  20. "likes_video",
  21. }
  22. //ArcCheckType search arc check type.
  23. ArcCheckType = map[string]int{
  24. "channel": 1,
  25. }
  26. )
  27. // Page page return data struct.
  28. type Page struct {
  29. Pn int `json:"pn"`
  30. Ps int `json:"ps"`
  31. Total int `json:"total"`
  32. }
  33. // SearchArg arc search param.
  34. type SearchArg struct {
  35. Mid int64 `form:"mid" validate:"gt=0"`
  36. Tid int64 `form:"tid"`
  37. Order string `form:"order"`
  38. Keyword string `form:"keyword"`
  39. Pn int `form:"pn" validate:"gt=0"`
  40. Ps int `form:"ps" validate:"gt=0,lte=100"`
  41. CheckType string `form:"check_type"`
  42. CheckID int64 `form:"check_id"`
  43. }
  44. // WebIndex .
  45. type WebIndex struct {
  46. Account *AccInfo `json:"account"`
  47. Setting *Setting `json:"setting"`
  48. Archive *WebArc `json:"archive"`
  49. }
  50. // WebArc .
  51. type WebArc struct {
  52. Page WebPage `json:"page"`
  53. Archives []*ArcItem `json:"archives"`
  54. }
  55. // WebPage .
  56. type WebPage struct {
  57. Pn int32 `json:"pn"`
  58. Ps int32 `json:"ps"`
  59. Count int64 `json:"count"`
  60. }