show.go 902 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package http
  2. import (
  3. "strconv"
  4. "go-common/app/interface/main/app-resource/model"
  5. "go-common/library/ecode"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. func tabs(c *bm.Context) {
  9. var (
  10. params = c.Request.Form
  11. header = c.Request.Header
  12. res = map[string]interface{}{}
  13. )
  14. mobiApp := params.Get("mobi_app")
  15. buildStr := params.Get("build")
  16. buvid := header.Get(_headerBuvid)
  17. device := params.Get("device")
  18. verStr := params.Get("ver")
  19. language := params.Get("lang")
  20. plat := model.Plat(mobiApp, device)
  21. build, err := strconv.Atoi(buildStr)
  22. if err != nil {
  23. c.JSON(nil, ecode.RequestErr)
  24. return
  25. }
  26. var mid int64
  27. if midInter, ok := c.Get("mid"); ok {
  28. mid = midInter.(int64)
  29. }
  30. data, version, ab, err := showSvc.Tabs(c, plat, build, buvid, verStr, mobiApp, language, mid)
  31. if ab != nil {
  32. res["abtest"] = ab
  33. }
  34. res["data"] = data
  35. res["ver"] = version
  36. c.JSONMap(res, err)
  37. }