subtitle.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package http
  2. import (
  3. "go-common/app/admin/main/dm/model"
  4. bm "go-common/library/net/http/blademaster"
  5. "go-common/library/net/http/blademaster/binding"
  6. )
  7. // subtitleList 字幕后台管理搜索
  8. func subtitleList(c *bm.Context) {
  9. var (
  10. v = new(model.SubtitleArg)
  11. )
  12. if err := c.Bind(v); err != nil {
  13. return
  14. }
  15. c.JSON(dmSvc.SubtitleList(c, v))
  16. }
  17. // subtitleEdit 字幕操作
  18. func subtitleEdit(c *bm.Context) {
  19. var (
  20. v = new(model.EditSubtitleArg)
  21. )
  22. if err := c.Bind(v); err != nil {
  23. return
  24. }
  25. c.JSON(nil, dmSvc.EditSubtitle(c, v))
  26. }
  27. // workflow 回调函数
  28. func subtitleEditCallback(c *bm.Context) {
  29. var (
  30. v = new(model.WorkFlowSubtitleArg)
  31. )
  32. if err := c.BindWith(v, binding.JSON); err != nil {
  33. return
  34. }
  35. c.JSON(nil, dmSvc.WorkFlowEditSubtitle(c, v))
  36. }
  37. // subtitleStatusList 字幕状态列表 给举报使用
  38. func subtitleStatusList(c *bm.Context) {
  39. c.JSON(dmSvc.SubtitleStatusList(c))
  40. }
  41. func subtitleLanList(c *bm.Context) {
  42. c.JSON(dmSvc.SubtitleLanList(c))
  43. }
  44. // subtitleSwitch 字幕开关
  45. func subtitleSwitch(c *bm.Context) {
  46. var (
  47. v = new(struct {
  48. Aid int64 `form:"aid" validate:"required"`
  49. Allow bool `form:"allow"`
  50. Closed bool `form:"closed"`
  51. })
  52. )
  53. if err := c.Bind(v); err != nil {
  54. return
  55. }
  56. c.JSON(nil, dmSvc.SubtitleSwitch(c, v.Aid, v.Allow, v.Closed))
  57. }