Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
0dbb4e47
Commit
0dbb4e47
authored
Sep 23, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加异常抓取
parent
71f8b722
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
ExceptionHandlingController.java
...antgroup/xyqb/controller/ExceptionHandlingController.java
+9
-1
AppletController.java
...xyqb/controller/middleoffice/applet/AppletController.java
+3
-5
No files found.
src/main/java/cn/quantgroup/xyqb/controller/ExceptionHandlingController.java
View file @
0dbb4e47
...
...
@@ -11,6 +11,7 @@ import org.springframework.validation.BindException;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.ObjectError
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -152,7 +153,7 @@ public class ExceptionHandlingController implements IBaseController {
return
null
;
}
@ExceptionHandler
({
DataException
.
class
,
IllegalArgumentException
.
class
})
@ExceptionHandler
({
DataException
.
class
})
@ResponseBody
@ResponseStatus
(
HttpStatus
.
OK
)
public
JsonResult
handleDataException
(
DataException
e
)
{
...
...
@@ -179,4 +180,11 @@ public class ExceptionHandlingController implements IBaseController {
public
JsonResult
resubmissionException
(
ResubmissionException
re
)
{
return
JsonResult
.
buildErrorStateResult
(
re
.
getMessage
(),
null
);
}
@ExceptionHandler
(
MissingServletRequestParameterException
.
class
)
@ResponseStatus
(
HttpStatus
.
OK
)
@ResponseBody
public
JsonResult
handelMissingServletRequestParameterException
(
MissingServletRequestParameterException
re
)
{
return
JsonResult
.
buildErrorStateResult
(
re
.
getMessage
(),
null
);
}
}
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/applet/AppletController.java
View file @
0dbb4e47
...
...
@@ -13,10 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.Assert
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotNull
;
...
...
@@ -67,8 +64,9 @@ public class AppletController {
/**
* @return
*/
@Validated
@PostMapping
(
"/login"
)
public
JsonResult
login
(
String
appName
,
String
openId
,
String
utmSource
)
{
public
JsonResult
login
(
@RequestParam
String
appName
,
@RequestParam
String
openId
,
String
utmSource
)
{
if
(!
appNames
.
contains
(
appName
))
{
throw
new
DataException
(
"appName不合法"
);
}
...
...
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