蛋蛋星球-客户端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 

74 rindas
2.3 KiB

  1. package hdl
  2. import (
  3. "applet/app/db"
  4. "applet/app/e"
  5. "applet/app/md"
  6. "applet/app/svc"
  7. "applet/app/utils"
  8. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  9. "github.com/gin-gonic/gin"
  10. )
  11. // GetModuleSetting
  12. // @Summary 页面样式
  13. // @Tags 页面样式
  14. // @Description 页面样式
  15. // @Accept json
  16. // @Produce json
  17. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  18. // @Param mod_name_value query string true "页面名称类型值(1:首页 2:会员中心 3:底部导航 4:邀请下载落地页 5:邀请海报 7:下载渠道 8:贡献值 9:蛋蛋分 10:商务合作 11:资质证书 12:提现页 13:提现到账户 14实名认证)"
  19. // @Success 200 {object} md.GetModuleSettingResp "具体数据"
  20. // @Failure 400 {object} md.Response "具体错误"
  21. // @Router /api/v1/getModuleSetting [GET]
  22. func GetModuleSetting(c *gin.Context) {
  23. modName := c.Query("mod_name_value")
  24. modNameMap := map[string]string{
  25. "1": "home_page",
  26. "2": "member_center",
  27. "3": "bottom_bar",
  28. "4": "invitation_download_landing_page",
  29. "5": "invitation_poster",
  30. "6": "about_us",
  31. "7": "down_channel",
  32. "8": "contribution",
  33. "9": "egg_score",
  34. "10": "business_cooperation",
  35. "11": "qualification_certificate",
  36. "12": "withdraw",
  37. "13": "withdraw_account",
  38. "14": "user_real_name",
  39. }
  40. val, ok := modNameMap[modName]
  41. if !ok {
  42. e.OutErr(c, e.ERR_BAD_REQUEST, nil)
  43. return
  44. }
  45. moduleStyleDb := implement.NewModuleStyleDb(db.Db)
  46. moduleStyle, err := moduleStyleDb.ModuleStyleGetOneByParams(map[string]interface{}{
  47. "key": "mod_name",
  48. "value": val,
  49. })
  50. if err != nil {
  51. e.OutErr(c, e.ERR_DB_ORM, err.Error())
  52. return
  53. }
  54. if moduleStyle == nil {
  55. e.OutErr(c, e.ERR_NO_DATA, nil)
  56. return
  57. }
  58. var dataMap interface{}
  59. scheme, domain := svc.ImageBucket(db.Db)
  60. moduleStyle.Data = svc.ImageFormatWithBucketForDataInfo(scheme, domain, moduleStyle.Data)
  61. utils.Unserialize([]byte(moduleStyle.Data), &dataMap)
  62. resp := md.GetModuleSettingResp{
  63. ModName: moduleStyle.ModName,
  64. Position: moduleStyle.Position,
  65. SkipIdentifier: moduleStyle.SkipIdentifier,
  66. Title: moduleStyle.Title,
  67. Subtitle: moduleStyle.Subtitle,
  68. Data: dataMap,
  69. }
  70. e.OutSuc(c, resp, nil)
  71. }