Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
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
曲欣亮
shop
Commits
49d5ed5f
Commit
49d5ed5f
authored
Mar 09, 2020
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
f30aa02a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
59 deletions
+63
-59
ShopApplication.java
src/main/java/com/egolm/shop/ShopApplication.java
+2
-0
LogInterceptor.java
...ava/com/egolm/shop/common/interceptor/LogInterceptor.java
+61
-59
No files found.
src/main/java/com/egolm/shop/ShopApplication.java
View file @
49d5ed5f
...
@@ -4,11 +4,13 @@ import org.springframework.boot.SpringApplication;
...
@@ -4,11 +4,13 @@ import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@EnableAsync
@EnableScheduling
@EnableScheduling
@EnableCaching
@EnableCaching
@EnableSwagger2
@EnableSwagger2
...
...
src/main/java/com/egolm/shop/common/interceptor/LogInterceptor.java
View file @
49d5ed5f
...
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
...
@@ -36,6 +37,7 @@ public class LogInterceptor extends HandlerInterceptorAdapter {
...
@@ -36,6 +37,7 @@ public class LogInterceptor extends HandlerInterceptorAdapter {
@Qualifier
(
"log"
)
@Qualifier
(
"log"
)
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
@Async
private
void
exec
(
HttpServletRequest
req
)
{
private
void
exec
(
HttpServletRequest
req
)
{
if
(
isOpen
)
{
if
(
isOpen
)
{
try
{
try
{
...
...
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