style: 响应信息改英文

This commit is contained in:
TsMask
2023-10-12 11:55:00 +08:00
parent 936aa5906f
commit 8b3999d076
11 changed files with 127 additions and 127 deletions

View File

@@ -105,7 +105,7 @@ func (s *SysConfigApi) List(w http.ResponseWriter, r *http.Request) {
func (s *SysConfigApi) Info(w http.ResponseWriter, r *http.Request) {
configId := ctx.Param(r, "configId")
if configId == "" {
ctx.JSON(w, 400, result.CodeMsg(400, "参数错误"))
ctx.JSON(w, 400, result.CodeMsg(400, "parameter error"))
return
}
data := s.sysConfigService.SelectConfigById(configId)
@@ -123,14 +123,14 @@ func (s *SysConfigApi) Add(w http.ResponseWriter, r *http.Request) {
var body model.SysConfig
err := ctx.ShouldBindJSON(r, &body)
if err != nil || body.ConfigID != "" {
ctx.JSON(w, 400, result.CodeMsg(400, "参数错误"))
ctx.JSON(w, 400, result.CodeMsg(400, "parameter error"))
return
}
// 检查属性值唯一
uniqueConfigKey := s.sysConfigService.CheckUniqueConfigKey(body.ConfigKey, "")
if !uniqueConfigKey {
msg := fmt.Sprintf("参数配置新增【%s】失败参数键名已存在", body.ConfigKey)
msg := fmt.Sprintf("[%s] Parameter key name already exists", body.ConfigKey)
ctx.JSON(w, 200, result.ErrMsg(msg))
return
}
@@ -151,14 +151,14 @@ func (s *SysConfigApi) Edit(w http.ResponseWriter, r *http.Request) {
var body model.SysConfig
err := ctx.ShouldBindJSON(r, &body)
if err != nil || body.ConfigID == "" {
ctx.JSON(w, 400, result.CodeMsg(400, "参数错误"))
ctx.JSON(w, 400, result.CodeMsg(400, "parameter error"))
return
}
// 检查属性值唯一
uniqueConfigKey := s.sysConfigService.CheckUniqueConfigKey(body.ConfigKey, body.ConfigID)
if !uniqueConfigKey {
msg := fmt.Sprintf("参数配置修改【%s】失败参数键名已存在", body.ConfigKey)
msg := fmt.Sprintf("[%s] Parameter key name already exists", body.ConfigKey)
ctx.JSON(w, 200, result.ErrMsg(msg))
return
}
@@ -166,7 +166,7 @@ func (s *SysConfigApi) Edit(w http.ResponseWriter, r *http.Request) {
// 检查是否存在
config := s.sysConfigService.SelectConfigById(body.ConfigID)
if config.ConfigID != body.ConfigID {
ctx.JSON(w, 200, result.ErrMsg("没有权限访问参数配置数据!"))
ctx.JSON(w, 200, result.ErrMsg("No permission to access parameter configuration data!"))
return
}
@@ -185,7 +185,7 @@ func (s *SysConfigApi) Edit(w http.ResponseWriter, r *http.Request) {
func (s *SysConfigApi) Remove(w http.ResponseWriter, r *http.Request) {
configIds := ctx.Param(r, "configIds")
if configIds == "" {
ctx.JSON(w, 400, result.CodeMsg(400, "参数错误"))
ctx.JSON(w, 400, result.CodeMsg(400, "parameter error"))
return
}
// 处理字符转id数组后去重
@@ -218,7 +218,7 @@ func (s *SysConfigApi) RefreshCache(w http.ResponseWriter, r *http.Request) {
func (s *SysConfigApi) ConfigKey(w http.ResponseWriter, r *http.Request) {
configKey := ctx.Param(r, "configKey")
if configKey == "" {
ctx.JSON(w, 400, result.CodeMsg(400, "参数错误"))
ctx.JSON(w, 400, result.CodeMsg(400, "parameter error"))
return
}
key := s.sysConfigService.SelectConfigValueByKey(configKey)