@@ -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 | |||||
} |
@@ -18,3 +18,9 @@ type WebBasicReq struct { | |||||
AndroidDownUrl string `json:"android_down_url"` | AndroidDownUrl string `json:"android_down_url"` | ||||
IosDownUrl string `json:"ios_down_url"` | IosDownUrl string `json:"ios_down_url"` | ||||
} | } | ||||
type KuaizhanBasicResp struct { | |||||
KuaizhanUrl string `json:"kuaizhan_url"` | |||||
} | |||||
type KuaizhanBasicReq struct { | |||||
KuaizhanUrl string `json:"kuaizhan_url"` | |||||
} |
@@ -19,6 +19,7 @@ import ( | |||||
"applet/app/hdl/member_center" | "applet/app/hdl/member_center" | ||||
"applet/app/hdl/notice" | "applet/app/hdl/notice" | ||||
"applet/app/hdl/setCenter/oss/aliyun" | "applet/app/hdl/setCenter/oss/aliyun" | ||||
"applet/app/hdl/setCenter/thirdParty" | |||||
"applet/app/hdl/setCenter/web" | "applet/app/hdl/setCenter/web" | ||||
"applet/app/hdl/user_feedback" | "applet/app/hdl/user_feedback" | ||||
"applet/app/hdl/user_real_name" | "applet/app/hdl/user_real_name" | ||||
@@ -121,6 +122,11 @@ func rSettCenter(r *gin.RouterGroup) { //设置中心 | |||||
rWeb.GET("/getBasic", web.GetBasic) | rWeb.GET("/getBasic", web.GetBasic) | ||||
rWeb.POST("/setBasic", web.SetBasic) | rWeb.POST("/setBasic", web.SetBasic) | ||||
} | } | ||||
rKuaizhan := r.Group("/kuaizhan") //快站信息 | |||||
{ | |||||
rKuaizhan.GET("/getBasic", thirdParty.GetBasic) | |||||
rKuaizhan.POST("/setBasic", thirdParty.SetBasic) | |||||
} | |||||
} | } | ||||
func rHomePage(r *gin.RouterGroup) { | func rHomePage(r *gin.RouterGroup) { | ||||
r.GET("/totalData", hdl.GetTotalData) | r.GET("/totalData", hdl.GetTotalData) | ||||