webset 单元测试完成, 缺少font_config的测试例子

This commit is contained in:
eson
2023-06-25 13:15:55 +08:00
parent aceb4c926f
commit 6bfa46e990
8 changed files with 106 additions and 69 deletions

View File

@@ -5,7 +5,6 @@ import (
"fusenapi/constants"
"fusenapi/utils/auth"
"fusenapi/utils/basic"
"strings"
"context"
@@ -51,36 +50,6 @@ func (l *WetSetSettingLogic) WetSetSetting(req *types.RequestWebSet, userinfo *a
if err != nil {
return resp.SetStatus(basic.CodeJsonErr)
}
//组装配置项的内容数据
for k, v := range result["list"].(map[string]interface{}) {
//按空格分隔内容
result["list"].(map[string]interface{})[k].(map[string]interface{})["content"] = strings.Split(v.(string), "\n")
}
// TODO: 缓存
if typeConf == constants.CLAUSE_CONFIG || typeConf == constants.FAQ_CONFIG || typeConf == constants.POLICY_CONFIG {
// cache := redis.NewClient(&redis.Options{
// Addr: "localhost:6379",
// Password: "", // no password set
// DB: 0, // use default DB
// })
// if cache.Exists(ctx.Query("type")).Val() > 0 {
// result = cache.HGetAll(ctx.Query("type")).Val()
// } else {
// //读取配置项
// model := WebSet{Key: typeStr}
// db.First(&model)
// result = json.Unmarshal([]byte(model.Value), &result)
// //组装配置项的内容数据
// for k, v := range result["list"].(map[string]interface{}) {
// //按空格分隔内容
// result["list"].(map[string]interface{})[k].(map[string]interface{})["content"] = strings.Split(v.(string), "\n")
// }
// cache.HMSet(ctx.Query("type"), result)
// }
} else {
}
return resp.SetStatus(basic.CodeOK)
return resp.SetStatus(basic.CodeOK, result)
}