Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
b2295166
Commit
b2295166
authored
Jan 29, 2019
by
Hong
Browse files
Merge remote-tracking branch 'origin/dev' into dev
parents
8ac0c58c
5a93cc6b
Changes
9
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/Application.java
View file @
b2295166
...
...
@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall"
})
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall
.db"
,
"org.linlinjava.litemall.core"
,
"org.linlinjava.litemall.admin
"
})
@MapperScan
(
"org.linlinjava.litemall.db.dao"
)
@EnableTransactionManagement
@EnableScheduling
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/config/ShiroConfig.java
View file @
b2295166
...
...
@@ -76,6 +76,7 @@ public class ShiroConfig {
@DependsOn
(
"lifecycleBeanPostProcessor"
)
public
static
DefaultAdvisorAutoProxyCreator
defaultAdvisorAutoProxyCreator
()
{
DefaultAdvisorAutoProxyCreator
creator
=
new
DefaultAdvisorAutoProxyCreator
();
creator
.
setProxyTargetClass
(
true
);
return
creator
;
}
}
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/config/ShiroExceptionHandler.java
0 → 100644
View file @
b2295166
package
org.linlinjava.litemall.admin.config
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authz.AuthorizationException
;
import
org.linlinjava.litemall.core.util.ResponseUtil
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@ControllerAdvice
@Order
(
value
=
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
ShiroExceptionHandler
{
@ExceptionHandler
(
AuthenticationException
.
class
)
@ResponseBody
public
Object
unauthenticatedHandler
(
AuthenticationException
e
)
{
e
.
printStackTrace
();
return
ResponseUtil
.
unlogin
();
}
@ExceptionHandler
(
AuthorizationException
.
class
)
@ResponseBody
public
Object
unauthorizedHandler
(
AuthorizationException
e
)
{
e
.
printStackTrace
();
return
ResponseUtil
.
unauthz
();
}
}
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminOrderController.java
View file @
b2295166
...
...
@@ -189,14 +189,13 @@ public class AdminOrderController {
logger
.
error
(
"系统内部错误"
,
ex
);
return
ResponseUtil
.
fail
(
ORDER_REFUND_FAILED
,
"订单退款失败"
);
}
txManager
.
commit
(
status
);
//TODO 发送邮件和短信通知,这里采用异步发送
// 退款成功通知用户, 例如“您申请的订单退款 [ 单号:{1} ] 已成功,请耐心等待到账。”
// 注意订单号只发后6位
notifyService
.
notifySmsTemplate
(
order
.
getMobile
(),
NotifyType
.
REFUND
,
new
String
[]{
order
.
getOrderSn
().
substring
(
8
,
14
)});
txManager
.
commit
(
status
);
return
ResponseUtil
.
ok
();
}
...
...
litemall-core/pom.xml
View file @
b2295166
...
...
@@ -43,11 +43,6 @@
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<artifactId>
shiro-spring-boot-web-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/Application.java
View file @
b2295166
...
...
@@ -4,7 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall"
})
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall
.db"
,
"org.linlinjava.litemall.core
"
})
@MapperScan
(
"org.linlinjava.litemall.db.dao"
)
public
class
Application
{
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/config/GlobalExceptionHandler.java
View file @
b2295166
package
org.linlinjava.litemall.core.config
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.authz.AuthorizationException
;
import
org.apache.shiro.authz.UnauthorizedException
;
import
org.hibernate.validator.internal.engine.path.PathImpl
;
import
org.linlinjava.litemall.core.util.ResponseUtil
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
...
...
@@ -18,6 +17,7 @@ import javax.validation.ValidationException;
import
java.util.Set
;
@ControllerAdvice
@Order
(
value
=
Ordered
.
LOWEST_PRECEDENCE
)
public
class
GlobalExceptionHandler
{
@ExceptionHandler
(
IllegalArgumentException
.
class
)
...
...
@@ -48,20 +48,6 @@ public class GlobalExceptionHandler {
return
ResponseUtil
.
badArgumentValue
();
}
@ExceptionHandler
(
AuthenticationException
.
class
)
@ResponseBody
public
Object
unauthenticatedHandler
(
AuthenticationException
e
)
{
e
.
printStackTrace
();
return
ResponseUtil
.
unlogin
();
}
@ExceptionHandler
(
AuthorizationException
.
class
)
@ResponseBody
public
Object
unauthorizedHandler
(
AuthorizationException
e
)
{
e
.
printStackTrace
();
return
ResponseUtil
.
unauthz
();
}
@ExceptionHandler
(
ValidationException
.
class
)
@ResponseBody
public
Object
badArgumentHandler
(
ValidationException
e
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/Application.java
View file @
b2295166
...
...
@@ -4,7 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall"
})
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall
.db
"
})
@MapperScan
(
"org.linlinjava.litemall.db.dao"
)
public
class
Application
{
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/Application.java
View file @
b2295166
...
...
@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall"
})
@SpringBootApplication
(
scanBasePackages
=
{
"org.linlinjava.litemall
.db"
,
"org.linlinjava.litemall.core"
,
"org.linlinjava.litemall.wx
"
})
@MapperScan
(
"org.linlinjava.litemall.db.dao"
)
@EnableTransactionManagement
@EnableScheduling
...
...
Write
Preview
Supports
Markdown
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