蛋蛋星球-客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

76 lines
2.4 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实名认证 15:官网联系我们 16:星球论剑 17:升级攻略)"
  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. "16": "star_sword_debate",
  40. "17": "upgrade_strategy",
  41. }
  42. val, ok := modNameMap[modName]
  43. if !ok {
  44. e.OutErr(c, e.ERR_BAD_REQUEST, nil)
  45. return
  46. }
  47. moduleStyleDb := implement.NewModuleStyleDb(db.Db)
  48. moduleStyle, err := moduleStyleDb.ModuleStyleGetOneByParams(map[string]interface{}{
  49. "key": "mod_name",
  50. "value": val,
  51. })
  52. if err != nil {
  53. e.OutErr(c, e.ERR_DB_ORM, err.Error())
  54. return
  55. }
  56. if moduleStyle == nil {
  57. e.OutErr(c, e.ERR_NO_DATA, nil)
  58. return
  59. }
  60. var dataMap interface{}
  61. scheme, domain := svc.ImageBucket(db.Db)
  62. moduleStyle.Data = svc.ImageFormatWithBucketForDataInfo(scheme, domain, moduleStyle.Data)
  63. utils.Unserialize([]byte(moduleStyle.Data), &dataMap)
  64. resp := md.GetModuleSettingResp{
  65. ModName: moduleStyle.ModName,
  66. Position: moduleStyle.Position,
  67. SkipIdentifier: moduleStyle.SkipIdentifier,
  68. Title: moduleStyle.Title,
  69. Subtitle: moduleStyle.Subtitle,
  70. Data: dataMap,
  71. }
  72. e.OutSuc(c, resp, nil)
  73. }