block.go 822 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package block
  2. import (
  3. model "go-common/app/admin/main/member/model/block"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. func blockSearch(c *bm.Context) {
  7. var (
  8. err error
  9. v = &model.ParamSearch{}
  10. )
  11. if err = bind(c, v); err != nil {
  12. return
  13. }
  14. c.JSON(svc.Search(c, v.MIDs))
  15. }
  16. func history(c *bm.Context) {
  17. var (
  18. err error
  19. v = &model.ParamHistory{}
  20. )
  21. if err = bind(c, v); err != nil {
  22. return
  23. }
  24. c.JSON(svc.History(c, v.MID, v.PS, v.PN, v.Desc))
  25. }
  26. func batchBlock(c *bm.Context) {
  27. var (
  28. err error
  29. v = &model.ParamBatchBlock{}
  30. )
  31. if err = bind(c, v); err != nil {
  32. return
  33. }
  34. c.JSON(nil, svc.BatchBlock(c, v))
  35. }
  36. func batchRemove(c *bm.Context) {
  37. var (
  38. err error
  39. v = &model.ParamBatchRemove{}
  40. )
  41. if err = bind(c, v); err != nil {
  42. return
  43. }
  44. c.JSON(nil, svc.BatchRemove(c, v))
  45. }