banner.go 817 B

1234567891011121314151617181920212223242526272829303132
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/app/interface/main/app-show/model"
  5. "go-common/library/ecode"
  6. "go-common/library/log"
  7. bm "go-common/library/net/http/blademaster"
  8. )
  9. // banners get banners.
  10. func banners(c *bm.Context) {
  11. params := c.Request.Form
  12. mobiApp := params.Get("mobi_app")
  13. mobiApp = model.MobiAPPBuleChange(mobiApp)
  14. buildStr := params.Get("build")
  15. channel := params.Get("channel")
  16. module := params.Get("module")
  17. position := params.Get("position")
  18. // check param
  19. device := params.Get("device")
  20. plat := model.Plat(mobiApp, device)
  21. build, err := strconv.Atoi(buildStr)
  22. if err != nil {
  23. log.Error("build(%s) error(%v)", buildStr, err)
  24. c.JSON(nil, ecode.RequestErr)
  25. return
  26. }
  27. data := bannerSvc.Display(c, plat, build, channel, module, position, mobiApp)
  28. returnJSON(c, data, nil)
  29. }