1、修改服务接口异常信息处理,异常信息直接抛出至controller,列表界面显示异常信息.

This commit is contained in:
zhangwei
2018-05-28 11:40:58 +08:00
parent 4930cd4c61
commit a038523e6f
6 changed files with 49 additions and 58 deletions

View File

@@ -141,7 +141,7 @@ public class AvCfgService extends BaseService{
}
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit){
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit) throws MaatConvertException{
//修改数据库审核状态信息
avCfgDao.auditAvFileSample(entity);
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
@@ -152,27 +152,16 @@ public class AvCfgService extends BaseService{
String json=gsonToJson(list);
logger.info("音视频文件样例下发配置参数:"+json);
//调用服务接口下发配置
try {
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
logger.info("音视频文件样例配置下发响应信息:"+result.getMsg());
} catch (Exception e) {
e.printStackTrace();
logger.info("音视频文件样例配置下发失败");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
logger.info("音视频文件样例配置下发响应信息:"+result.getMsg());
}else if(isAudit==3){
//调用服务接口取消配置
String json=gsonToJson(list);
logger.info("音视频文件样例下发配置参数:"+json);
//调用服务接口下发配置
try {
ToMaatResult result = ConfigServiceUtil.put(json,2);
logger.info("音视频文件样例取消配置响应信息:"+result.getMsg());
} catch (Exception e) {
e.printStackTrace();
logger.info("音视频文件样取消配置失败");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
ToMaatResult result = ConfigServiceUtil.put(json,2);
logger.info("音视频文件样例取消配置响应信息:"+result.getMsg());
}
}
public void updateAvSignSampleValid(Integer isAudit,Integer isValid,String ids){
@@ -187,7 +176,7 @@ public class AvCfgService extends BaseService{
avCfgDao.updateAvSignSampleValid(entity);
}
}
public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit){
public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
avCfgDao.auditAvSignSample(entity);
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
list.add(entity);
@@ -209,14 +198,8 @@ public class AvCfgService extends BaseService{
String json=gsonToJson(list);
logger.info("标志样例下发配置参数:"+json);
//调用服务接口取消配置
try {
ToMaatResult result = ConfigServiceUtil.put(json, 2);
logger.info("音视频标志样例配置取消配置响应信息:"+result.getMsg());
} catch (Exception e) {
e.printStackTrace();
logger.info("音视频标志样例取消配置失败");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
ToMaatResult result = ConfigServiceUtil.put(json, 2);
logger.info("音视频标志样例配置取消配置响应信息:"+result.getMsg());
}
}