subject.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package http
  2. import (
  3. "go-common/app/admin/main/activity/model"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func listInfosAll(c *bm.Context) {
  7. arg := new(model.ListSub)
  8. if err := c.Bind(arg); err != nil {
  9. return
  10. }
  11. c.JSON(actSrv.SubjectList(c, arg))
  12. }
  13. func videoList(c *bm.Context) {
  14. c.JSON(actSrv.VideoList(c))
  15. }
  16. func addActSubject(c *bm.Context) {
  17. arg := new(model.AddList)
  18. if err := c.Bind(arg); err != nil {
  19. return
  20. }
  21. c.JSON(actSrv.AddActSubject(c, arg))
  22. }
  23. func updateInfoAll(c *bm.Context) {
  24. type upStr struct {
  25. model.AddList
  26. Sid int64 `form:"sid" validate:"min=1"`
  27. }
  28. arg := new(upStr)
  29. if err := c.Bind(arg); err != nil {
  30. return
  31. }
  32. c.JSON(actSrv.UpActSubject(c, &arg.AddList, arg.Sid))
  33. }
  34. func subPro(c *bm.Context) {
  35. type subStr struct {
  36. Sid int64 `form:"sid" validate:"min=1"`
  37. }
  38. arg := new(subStr)
  39. if err := c.Bind(arg); err != nil {
  40. return
  41. }
  42. c.JSON(actSrv.SubProtocol(c, arg.Sid))
  43. }
  44. func timeConf(c *bm.Context) {
  45. type subStr struct {
  46. Sid int64 `form:"sid" validate:"required"`
  47. }
  48. arg := new(subStr)
  49. if err := c.Bind(arg); err != nil {
  50. return
  51. }
  52. c.JSON(actSrv.TimeConf(c, arg.Sid))
  53. }
  54. func article(c *bm.Context) {
  55. type subStr struct {
  56. Aids []int64 `form:"aids,split" validate:"min=1,required"`
  57. }
  58. arg := new(subStr)
  59. if err := c.Bind(arg); err != nil {
  60. return
  61. }
  62. c.JSON(actSrv.GetArticleMetas(c, arg.Aids))
  63. }