style: 错误信息英文返回-system 模块路由
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"ems.agt/src/framework/constants/cachekey"
|
||||
"ems.agt/src/framework/redis"
|
||||
@@ -93,12 +93,13 @@ func (r *SysConfigImpl) DeleteConfigByIds(configIds []string) (int64, error) {
|
||||
// 检查是否存在
|
||||
configs := r.sysConfigRepository.SelectConfigByIds(configIds)
|
||||
if len(configs) <= 0 {
|
||||
return 0, errors.New("没有权限访问参数配置数据!")
|
||||
return 0, fmt.Errorf("there is no accessible parameter configuration data")
|
||||
}
|
||||
for _, config := range configs {
|
||||
// 检查是否为内置参数
|
||||
if config.ConfigType == "Y" {
|
||||
return 0, errors.New(config.ConfigID + " 配置参数属于内置参数,禁止删除!")
|
||||
// 【%s】 配置参数属于内置参数,禁止删除!
|
||||
return 0, fmt.Errorf("[%s] Configuration parameters are built-in parameters and their deletion is prohibited", config.ConfigID)
|
||||
}
|
||||
// 清除缓存
|
||||
r.clearConfigCache(config.ConfigKey)
|
||||
@@ -107,7 +108,8 @@ func (r *SysConfigImpl) DeleteConfigByIds(configIds []string) (int64, error) {
|
||||
rows := r.sysConfigRepository.DeleteConfigByIds(configIds)
|
||||
return rows, nil
|
||||
}
|
||||
return 0, errors.New("删除参数配置信息失败!")
|
||||
// 删除参数配置信息失败!
|
||||
return 0, fmt.Errorf("failed to delete parameter configuration information")
|
||||
}
|
||||
|
||||
// ResetConfigCache 重置参数缓存数据
|
||||
|
||||
Reference in New Issue
Block a user