Commit ead53099 authored by 麻笑宇's avatar 麻笑宇

refactor(amos-boot-module-statistics): 修改技术参数查询异常抛出方式

- 将 BadRequest 异常替换为 BaseException -保持错误信息不变,添加状态码参数
parent db16110d
...@@ -55,6 +55,7 @@ import org.springframework.util.ObjectUtils; ...@@ -55,6 +55,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -1831,7 +1832,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl { ...@@ -1831,7 +1832,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public JSONArray queryTechParam(String type) { public JSONArray queryTechParam(String type) {
if (ValidationUtil.isEmpty(type)) { if (ValidationUtil.isEmpty(type)) {
throw new BadRequest("需要先选择设备品种,才能选择技术参数"); throw new BaseException("需要先选择设备品种,才能选择技术参数","200","需要先选择设备品种,才能选择技术参数");
} }
List<TechParamItem> paramMetaList = TechParamUtil.getParamMetaList(type); List<TechParamItem> paramMetaList = TechParamUtil.getParamMetaList(type);
JSONArray list = new JSONArray(); JSONArray list = new JSONArray();
......
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