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
b2d9fd3c
Commit
b2d9fd3c
authored
Aug 09, 2018
by
Menethil
Browse files
Merge remote-tracking branch 'origin/master'
parents
e3bedf44
bc7231a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
litemall-core/src/main/java/org/linlinjava/litemall/core/config/GlobalExceptionHandler.java
View file @
b2d9fd3c
...
...
@@ -18,31 +18,37 @@ import java.util.Set;
@ControllerAdvice
public
class
GlobalExceptionHandler
{
@ExceptionHandler
(
IllegalArgumentException
.
class
)
@ResponseBody
public
Object
badArgumentHandler
(
IllegalArgumentException
e
){
e
.
printStackTrace
();
return
ResponseUtil
.
badArgumentValue
();
}
@ExceptionHandler
(
MethodArgumentTypeMismatchException
.
class
)
@ResponseBody
public
Object
a
rgumentHandler
(
MethodArgumentTypeMismatchException
e
){
public
Object
badA
rgumentHandler
(
MethodArgumentTypeMismatchException
e
){
e
.
printStackTrace
();
return
ResponseUtil
.
badArgumentValue
();
}
@ExceptionHandler
(
MissingServletRequestParameterException
.
class
)
@ResponseBody
public
Object
a
rgumentHandler
(
MissingServletRequestParameterException
e
){
public
Object
badA
rgumentHandler
(
MissingServletRequestParameterException
e
){
e
.
printStackTrace
();
return
ResponseUtil
.
badArgumentValue
();
}
@ExceptionHandler
(
HttpMessageNotReadableException
.
class
)
@ResponseBody
public
Object
httpMessageNotReadable
Handler
(
HttpMessageNotReadableException
e
){
public
Object
badArgument
Handler
(
HttpMessageNotReadableException
e
){
e
.
printStackTrace
();
return
ResponseUtil
.
badArgumentValue
();
}
@ExceptionHandler
(
ValidationException
.
class
)
@ResponseBody
public
Object
h
andle
(
ValidationException
e
)
{
public
Object
badArgumentH
andle
r
(
ValidationException
e
)
{
e
.
printStackTrace
();
if
(
e
instanceof
ConstraintViolationException
){
ConstraintViolationException
exs
=
(
ConstraintViolationException
)
e
;
...
...
@@ -57,7 +63,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
Exception
.
class
)
@ResponseBody
public
Object
exception
Handler
(
Exception
e
){
public
Object
serious
Handler
(
Exception
e
){
e
.
printStackTrace
();
return
ResponseUtil
.
serious
();
}
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/QiniuStorage.java
View file @
b2d9fd3c
...
...
@@ -58,7 +58,7 @@ public class QiniuStorage implements Storage {
}
/**
*
阿里
云OSS对象存储简单上传实现
*
七牛
云OSS对象存储简单上传实现
*/
@Override
public
void
store
(
InputStream
inputStream
,
long
contentLength
,
String
contentType
,
String
keyName
)
{
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/config/StorageAutoConfiguration.java
View file @
b2d9fd3c
...
...
@@ -21,7 +21,6 @@ public class StorageAutoConfiguration {
@Bean
public
StorageService
storageService
()
{
StorageService
storageService
=
new
StorageService
();
Map
<
String
,
Storage
>
supportedStorage
=
new
HashMap
<
String
,
Storage
>(
3
);
String
active
=
this
.
properties
.
getActive
();
storageService
.
setActive
(
active
);
if
(
active
.
equals
(
"local"
)){
...
...
@@ -34,7 +33,7 @@ public class StorageAutoConfiguration {
storageService
.
setStorage
(
tencentStorage
());
}
else
if
(
active
.
equals
(
"qiniu"
)){
storageService
.
setStorage
(
tencent
Storage
());
storageService
.
setStorage
(
qiniu
Storage
());
}
else
{
throw
new
RuntimeException
(
"当前存储模式 "
+
active
+
" 不支持"
);
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java
View file @
b2d9fd3c
...
...
@@ -14,6 +14,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -140,6 +141,7 @@ public class WxCartController {
cart
.
setSpecifications
(
product
.
getSpecifications
());
cart
.
setUserId
(
userId
);
cart
.
setChecked
(
true
);
cart
.
setAddTime
(
LocalDateTime
.
now
());
cartService
.
add
(
cart
);
}
else
{
//取得规格的信息,判断规格库存
...
...
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