蛋蛋星球 后台端
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.
 
 
 
 

42 lines
1.0 KiB

  1. package user_real_name
  2. import (
  3. "applet/app/db"
  4. "applet/app/e"
  5. "applet/app/md"
  6. "applet/app/svc"
  7. "applet/app/utils/cache"
  8. "applet/app/utils/logx"
  9. "code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
  10. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  11. "github.com/gin-gonic/gin"
  12. )
  13. func Base(c *gin.Context) {
  14. res := md.UserRealNameBaseResp{
  15. UserRealNameMoney: svc.GetSysCfgStr("user_real_name_money"),
  16. }
  17. e.OutSuc(c, res, nil)
  18. return
  19. }
  20. func BaseSave(c *gin.Context) {
  21. var req md.UserRealNameBaseResp
  22. if err := c.ShouldBindJSON(&req); err != nil {
  23. e.OutErr(c, e.ERR_INVALID_ARGS, err)
  24. return
  25. }
  26. conn := cache.GetPool().Get()
  27. cfgDb := implement.NewSysCfgDb(db.Db, conn)
  28. defer func(cfgDb dao.SysCfgDao) {
  29. err := cfgDb.Close()
  30. if err != nil {
  31. logx.Error("redis close err:" + err.Error()) // 记录错误信息
  32. }
  33. }(cfgDb)
  34. cfgDb.SysCfgUpdate("user_real_name_money", req.UserRealNameMoney)
  35. cfgDb.SysCfgUpdate("user_real_name_rule", req.UserRealNameRule)
  36. e.OutSuc(c, "success", nil)
  37. return
  38. }