Commit 6df69878 by cc150520900118

资源文件配置

parent 62c1d365
......@@ -53,7 +53,14 @@ public class MapRestResult<T> {
r.setMsg("失败");
return r;
}
//--------6---------------
public static <T> MapRestResult error(String msg) {
MapRestResult r = new MapRestResult();
r.setStatus(ResultCode.ERROR);
r.setMsg("error");
r.setMsg(msg);
return r;
}
public MapRestResult() {
this.status = 200;
......
......@@ -16,7 +16,7 @@ public class GlobalExceptionHandler {
@ResponseBody //为了返回数据
public MapRestResult error(Exception e) {
e.printStackTrace();
return MapRestResult.error().message("执行了全局异常处理..");
return MapRestResult.error("执行了全局异常处理..");
}
//特定异常
......@@ -24,7 +24,7 @@ public class GlobalExceptionHandler {
@ResponseBody //为了返回数据
public MapRestResult error(ArithmeticException e) {
e.printStackTrace();
return MapRestResult.error().message("执行了ArithmeticException异常处理..");
return MapRestResult.error("执行了ArithmeticException异常处理..");
}
//自定义异常
......@@ -34,7 +34,7 @@ public class GlobalExceptionHandler {
log.error(e.getMessage());
e.printStackTrace();
return MapRestResult.error().code(e.getCode()).message(e.getMsg());
return MapRestResult.build(e.getCode(),e.getMsg(),"");
}
}
......@@ -7,7 +7,7 @@
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="C:/guli_1010/demo" />
<!-- <property name="log.path" value="C:/guli_1010/demo" />-->
<!-- 彩色日志 -->
<!-- 配置格式变量:CONSOLE_LOG_PATTERN 彩色日志格式 -->
......
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