Commit 4af26c30 by zhangkb

修改响应状态

parent a59ca8a1
package com.keymobile.indicators.api.hytobacco; package com.keymobile.indicators.api.hytobacco;
import java.io.IOException;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -33,7 +34,7 @@ public class IndCatalogCtrl { ...@@ -33,7 +34,7 @@ public class IndCatalogCtrl {
@ApiOperation(value = "新建基础指标目录", notes = "新建基础指标目录") @ApiOperation(value = "新建基础指标目录", notes = "新建基础指标目录")
@PostMapping(value = "/createBaseIndCatalog") @PostMapping(value = "/createBaseIndCatalog")
public Integer createBaseIndCatalog(@RequestBody IndCatalog indCatalog,HttpServletResponse response) throws ApiException{ public Integer createBaseIndCatalog(@RequestBody IndCatalog indCatalog,HttpServletResponse response) throws Exception{
String message = null; String message = null;
if(indCatalog.getId()==null) { if(indCatalog.getId()==null) {
message = "新增基础项目录:{}"; message = "新增基础项目录:{}";
...@@ -43,7 +44,7 @@ public class IndCatalogCtrl { ...@@ -43,7 +44,7 @@ public class IndCatalogCtrl {
try { try {
indCatalog = indCatalogService.saveOrUpdate(indCatalog); indCatalog = indCatalogService.saveOrUpdate(indCatalog);
} catch (Exception e) { } catch (Exception e) {
response.setStatus(500); response.sendError(500, e.getMessage());
} }
LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,message,indCatalog.getCatalogName()); LogManager.logInfo(Constants.LOG_INDICATOR_BASE_INDI_API,message,indCatalog.getCatalogName());
return indCatalog.getId(); return indCatalog.getId();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment