dm_date.go 633 B

123456789101112131415161718192021222324252627282930313233
  1. package http
  2. import (
  3. "go-common/app/service/main/search/model"
  4. "go-common/library/ecode"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. func dmDate(c *bm.Context) {
  9. var (
  10. err error
  11. sp = &model.DmDateParams{
  12. Bsp: &model.BasicSearchParams{},
  13. }
  14. res *model.SearchResult
  15. )
  16. if err = c.Bind(sp); err != nil {
  17. c.JSON(nil, ecode.RequestErr)
  18. return
  19. }
  20. if err = c.Bind(sp.Bsp); err != nil {
  21. c.JSON(nil, ecode.RequestErr)
  22. return
  23. }
  24. res, err = svr.DmDate(c, sp)
  25. if err != nil {
  26. log.Error("srv.DmDate(%v) error(%v)", sp, err)
  27. c.JSON(nil, ecode.ServerErr)
  28. return
  29. }
  30. c.JSON(res, err)
  31. }