|
@@ -593,3 +593,71 @@ func GetLogo(c *gin.Context) { |
|
|
}, nil) |
|
|
}, nil) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// SetSeo |
|
|
|
|
|
// @Summary Seo设置 |
|
|
|
|
|
// @Tags 设置中心-基础设置 |
|
|
|
|
|
// @Description 基础设置-logo设置 |
|
|
|
|
|
// @param Authorization header string true "验证参数Bearer和token空格拼接" |
|
|
|
|
|
// @Accept json |
|
|
|
|
|
// @Produce json |
|
|
|
|
|
// @Param args body md.SetSeoReq true "请求参数" |
|
|
|
|
|
// @Success 200 {string} "success" |
|
|
|
|
|
// @Failure 400 {object} md.Response "具体错误" |
|
|
|
|
|
// @Router /api/setCenter/basic/setSeo [POST] |
|
|
|
|
|
func SetSeo(c *gin.Context) { |
|
|
|
|
|
var req md.SetSeoReq |
|
|
|
|
|
err := c.ShouldBindJSON(&req) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
err = validate.HandleValidateErr(err) |
|
|
|
|
|
err1 := err.(e.E) |
|
|
|
|
|
e.OutErr(c, err1.Code, err1.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
masterId := svc.GetMasterId(c) |
|
|
|
|
|
engine := db.DBs[masterId] |
|
|
|
|
|
sysCfgDb := implement2.NewSysCfgDb(engine, masterId) |
|
|
|
|
|
sysCfgDb.SysCfgUpdate("seo_medium_title", req.SeoMediumTitle) |
|
|
|
|
|
sysCfgDb.SysCfgUpdate("seo_agent_title", req.SeoAgentTitle) |
|
|
|
|
|
sysCfgDb.SysCfgUpdate("seo_platform_title", req.SeoPlatformTitle) |
|
|
|
|
|
svc.ClearRedis(c, masterId, "seo_medium_title") |
|
|
|
|
|
svc.ClearRedis(c, masterId, "seo_agent_title") |
|
|
|
|
|
svc.ClearRedis(c, masterId, "seo_platform_title") |
|
|
|
|
|
sysCfgDb.SysCfgUpdate("seo_medium_logo", req.SeoMediumLogo) |
|
|
|
|
|
sysCfgDb.SysCfgUpdate("seo_agent_logo", req.SeoAgentLogo) |
|
|
|
|
|
sysCfgDb.SysCfgUpdate("seo_platform_logo", req.SeoPlatformLogo) |
|
|
|
|
|
svc.ClearRedis(c, masterId, "seo_medium_logo") |
|
|
|
|
|
svc.ClearRedis(c, masterId, "seo_agent_logo") |
|
|
|
|
|
svc.ClearRedis(c, masterId, "seo_platform_logo") |
|
|
|
|
|
svc.ClearAllRedis(c, masterId) |
|
|
|
|
|
e.OutSuc(c, "success", nil) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetSeo |
|
|
|
|
|
// @Summary Seo获取 |
|
|
|
|
|
// @Tags 设置中心-基础设置 |
|
|
|
|
|
// @Description 基础设置-logo获取 |
|
|
|
|
|
// @param Authorization header string true "验证参数Bearer和token空格拼接" |
|
|
|
|
|
// @Accept json |
|
|
|
|
|
// @Produce json |
|
|
|
|
|
// @Success 200 {object} md.SetSeoResp |
|
|
|
|
|
// @Failure 400 {object} md.Response "具体错误" |
|
|
|
|
|
// @Router /api/setCenter/basic/getSeo [GET] |
|
|
|
|
|
func GetSeo(c *gin.Context) { |
|
|
|
|
|
masterId := svc.GetMasterId(c) |
|
|
|
|
|
engine := db.DBs[masterId] |
|
|
|
|
|
sysCfgDb := implement2.NewSysCfgDb(engine, masterId) |
|
|
|
|
|
res := sysCfgDb.SysCfgFindWithDb("seo_medium_logo", "seo_agent_logo", "seo_platform_logo", "seo_medium_title", "seo_agent_title", "seo_platform_title") |
|
|
|
|
|
e.OutSuc(c, md.SetSeoResp{ |
|
|
|
|
|
Data: md.SetSeoReq{ |
|
|
|
|
|
SeoMediumTitle: res["seo_medium_title"], |
|
|
|
|
|
SeoAgentTitle: res["seo_agent_title"], |
|
|
|
|
|
SeoPlatformTitle: res["seo_platform_title"], |
|
|
|
|
|
SeoMediumLogo: res["seo_medium_logo"], |
|
|
|
|
|
SeoAgentLogo: res["seo_agent_logo"], |
|
|
|
|
|
SeoPlatformLogo: res["seo_platform_logo"], |
|
|
|
|
|
}, |
|
|
|
|
|
}, nil) |
|
|
|
|
|
return |
|
|
|
|
|
} |