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

50 lines
1.6 KiB

  1. package thirdParty
  2. import (
  3. "applet/app/e"
  4. "applet/app/md/setCenter"
  5. "applet/app/svc"
  6. "github.com/gin-gonic/gin"
  7. )
  8. // GetBasic
  9. // @Summary 基础设置-网站信息-基本设置(获取)
  10. // @Tags 基础设置
  11. // @Description 网站信息-基本设置(获取)
  12. // @Accept json
  13. // @Produce json
  14. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  15. // @Success 200 {object} setCenter.KuaizhanBasicResp "设置列表"
  16. // @Failure 400 {object} md.Response "具体错误"
  17. // @Router /api/settCenter/kuaizhan/getBasic [get]
  18. func GetBasic(c *gin.Context) {
  19. resp := setCenter.KuaizhanBasicResp{
  20. KuaizhanUrl: svc.GetSysCfgStr("kuaizhan_url"),
  21. }
  22. e.OutSuc(c, resp, nil)
  23. }
  24. // SetBasic
  25. // @Summary 基础设置-网站信息-基本设置(更新)
  26. // @Tags 基础设置
  27. // @Description 基本设置(更新)
  28. // @Accept json
  29. // @Produce json
  30. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  31. // @param req body setCenter.KuaizhanBasicReq true "上传需要修改的信息"
  32. // @Success 200 {string} "success"
  33. // @Failure 400 {object} md.Response "具体错误"
  34. // @Router /api/settCenter/kuaizhan/setBasic [post]
  35. func SetBasic(c *gin.Context) {
  36. var req *setCenter.KuaizhanBasicReq
  37. if err1 := c.ShouldBindJSON(&req); err1 != nil {
  38. e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
  39. return
  40. }
  41. if req.KuaizhanUrl != "" {
  42. svc.SetSysCfgStr("kuaizhan_url", req.KuaizhanUrl)
  43. }
  44. e.OutSuc(c, "success", nil)
  45. return
  46. }