Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
6df69878
Commit
6df69878
authored
Mar 10, 2021
by
cc150520900118
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源文件配置
parent
62c1d365
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
common/common_utils/src/main/java/com/founder/commonutils/publicEntity/MapRestResult.java
+8
-1
common/service_base/src/main/java/com/founder/servicebase/exceptionhandler/GlobalExceptionHandler.java
+3
-3
service/asj/src/main/resources/logback-spring.xml
+1
-1
No files found.
common/common_utils/src/main/java/com/founder/commonutils/publicEntity/MapRestResult.java
View file @
6df69878
...
...
@@ -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
;
...
...
common/service_base/src/main/java/com/founder/servicebase/exceptionhandler/GlobalExceptionHandler.java
View file @
6df69878
...
...
@@ -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
(),
""
);
}
}
service/asj/src/main/resources/logback-spring.xml
View file @
6df69878
...
...
@@ -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 彩色日志格式 -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment