Browse Source

快站

master
huangjiajun 2 days ago
parent
commit
d51004c7b3
3 changed files with 61 additions and 0 deletions
  1. +49
    -0
      app/hdl/setCenter/thirdParty/hdl_basic.go
  2. +6
    -0
      app/md/setCenter/md_web.go
  3. +6
    -0
      app/router/router.go

+ 49
- 0
app/hdl/setCenter/thirdParty/hdl_basic.go View File

@@ -0,0 +1,49 @@
package thirdParty

import (
"applet/app/e"
"applet/app/md/setCenter"
"applet/app/svc"
"github.com/gin-gonic/gin"
)

// GetBasic
// @Summary 基础设置-网站信息-基本设置(获取)
// @Tags 基础设置
// @Description 网站信息-基本设置(获取)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @Success 200 {object} setCenter.KuaizhanBasicResp "设置列表"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/settCenter/kuaizhan/getBasic [get]
func GetBasic(c *gin.Context) {
resp := setCenter.KuaizhanBasicResp{
KuaizhanUrl: svc.GetSysCfgStr("kuaizhan_url"),
}
e.OutSuc(c, resp, nil)
}

// SetBasic
// @Summary 基础设置-网站信息-基本设置(更新)
// @Tags 基础设置
// @Description 基本设置(更新)
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body setCenter.KuaizhanBasicReq true "上传需要修改的信息"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/settCenter/kuaizhan/setBasic [post]
func SetBasic(c *gin.Context) {
var req *setCenter.KuaizhanBasicReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}
if req.KuaizhanUrl != "" {
svc.SetSysCfgStr("kuaizhan_url", req.KuaizhanUrl)
}
e.OutSuc(c, "success", nil)
return
}

+ 6
- 0
app/md/setCenter/md_web.go View File

@@ -18,3 +18,9 @@ type WebBasicReq struct {
AndroidDownUrl string `json:"android_down_url"`
IosDownUrl string `json:"ios_down_url"`
}
type KuaizhanBasicResp struct {
KuaizhanUrl string `json:"kuaizhan_url"`
}
type KuaizhanBasicReq struct {
KuaizhanUrl string `json:"kuaizhan_url"`
}

+ 6
- 0
app/router/router.go View File

@@ -19,6 +19,7 @@ import (
"applet/app/hdl/member_center"
"applet/app/hdl/notice"
"applet/app/hdl/setCenter/oss/aliyun"
"applet/app/hdl/setCenter/thirdParty"
"applet/app/hdl/setCenter/web"
"applet/app/hdl/user_feedback"
"applet/app/hdl/user_real_name"
@@ -121,6 +122,11 @@ func rSettCenter(r *gin.RouterGroup) { //设置中心
rWeb.GET("/getBasic", web.GetBasic)
rWeb.POST("/setBasic", web.SetBasic)
}
rKuaizhan := r.Group("/kuaizhan") //快站信息
{
rKuaizhan.GET("/getBasic", thirdParty.GetBasic)
rKuaizhan.POST("/setBasic", thirdParty.SetBasic)
}
}
func rHomePage(r *gin.RouterGroup) {
r.GET("/totalData", hdl.GetTotalData)


Loading…
Cancel
Save