优化平台参数相关的接口

This commit is contained in:
季圣华
2023-06-06 00:29:01 +08:00
parent b30640c940
commit 3e28e14b49

View File

@@ -34,7 +34,9 @@ public class PlatformConfigService {
public PlatformConfig getPlatformConfig(long id)throws Exception { public PlatformConfig getPlatformConfig(long id)throws Exception {
PlatformConfig result=null; PlatformConfig result=null;
try{ try{
result=platformConfigMapper.selectByPrimaryKey(id); if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
result = platformConfigMapper.selectByPrimaryKey(id);
}
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -46,7 +48,9 @@ public class PlatformConfigService {
example.createCriteria(); example.createCriteria();
List<PlatformConfig> list=null; List<PlatformConfig> list=null;
try{ try{
list=platformConfigMapper.selectByExample(example); if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
list = platformConfigMapper.selectByExample(example);
}
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
@@ -153,11 +157,15 @@ public class PlatformConfigService {
public PlatformConfig getPlatformConfigByKey(String platformKey)throws Exception { public PlatformConfig getPlatformConfigByKey(String platformKey)throws Exception {
PlatformConfig platformConfig = new PlatformConfig(); PlatformConfig platformConfig = new PlatformConfig();
try{ try{
PlatformConfigExample example = new PlatformConfigExample(); if(platformKey.contains("aliOss") || platformKey.contains("weixin")) {
example.createCriteria().andPlatformKeyEqualTo(platformKey); platformConfig = null;
List<PlatformConfig> list=platformConfigMapper.selectByExample(example); } else {
if(list!=null && list.size()>0){ PlatformConfigExample example = new PlatformConfigExample();
platformConfig = list.get(0); example.createCriteria().andPlatformKeyEqualTo(platformKey);
List<PlatformConfig> list=platformConfigMapper.selectByExample(example);
if(list!=null && list.size()>0){
platformConfig = list.get(0);
}
} }
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);