Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform
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
QA
qa-platform
Commits
c406bf5f
Commit
c406bf5f
authored
Dec 29, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
77f7792f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
13 deletions
+19
-13
JsonResult.java
src/main/java/cn/qg/qaplatform/common/JsonResult.java
+1
-1
ErrorType.java
src/main/java/cn/qg/qaplatform/common/enums/ErrorType.java
+4
-4
GenVccController.java
...in/java/cn/qg/qaplatform/controller/GenVccController.java
+8
-5
QueryLoanUserDataController.java
...qg/qaplatform/controller/QueryLoanUserDataController.java
+2
-2
QueryVccController.java
.../java/cn/qg/qaplatform/controller/QueryVccController.java
+4
-1
No files found.
src/main/java/cn/qg/qaplatform/common/JsonResult.java
View file @
c406bf5f
...
@@ -47,7 +47,7 @@ public class JsonResult<T> {
...
@@ -47,7 +47,7 @@ public class JsonResult<T> {
}
}
/**
/**
* 服务器
失败
* 服务器
异常
*/
*/
public
static
<
T
>
JsonResult
<
T
>
serverFailed
()
{
public
static
<
T
>
JsonResult
<
T
>
serverFailed
()
{
return
buildResult
(
ErrorType
.
SERVER_FAILED
);
return
buildResult
(
ErrorType
.
SERVER_FAILED
);
...
...
src/main/java/cn/qg/qaplatform/common/enums/ErrorType.java
View file @
c406bf5f
...
@@ -5,11 +5,11 @@ package cn.qg.qaplatform.common.enums;
...
@@ -5,11 +5,11 @@ package cn.qg.qaplatform.common.enums;
*/
*/
public
enum
ErrorType
{
public
enum
ErrorType
{
SUCCESS
(
200L
,
"请求成功"
),
SUCCESS
(
200L
,
"请求成功"
),
CLIENT_FAILED
(
400L
,
"
客户端请求失败
"
),
CLIENT_FAILED
(
400L
,
"
传参有误
"
),
SERVER_FAILED
(
500L
,
"
服务器
异常"
);
SERVER_FAILED
(
500L
,
"
系统
异常"
);
private
Long
code
;
private
final
Long
code
;
private
String
message
;
private
final
String
message
;
ErrorType
(
Long
code
,
String
message
)
{
ErrorType
(
Long
code
,
String
message
)
{
this
.
code
=
code
;
this
.
code
=
code
;
...
...
src/main/java/cn/qg/qaplatform/controller/GenVccController.java
View file @
c406bf5f
...
@@ -6,10 +6,7 @@ import cn.qg.qaplatform.service.VccDataService;
...
@@ -6,10 +6,7 @@ import cn.qg.qaplatform.service.VccDataService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@CrossOrigin
@CrossOrigin
@RestController
@RestController
...
@@ -22,7 +19,10 @@ public class GenVccController {
...
@@ -22,7 +19,10 @@ public class GenVccController {
@PostMapping
(
"/gen"
)
@PostMapping
(
"/gen"
)
@ApiOperation
(
value
=
"vcc造数据"
)
@ApiOperation
(
value
=
"vcc造数据"
)
public
JsonResult
genVccUser
(
String
namespace
,
String
phoneNo
,
String
channel
,
Integer
status
)
throws
Exception
{
public
JsonResult
genVccUser
(
@RequestParam
(
value
=
"namespace"
)
String
namespace
,
@RequestParam
(
value
=
"phoneNo"
)
String
phoneNo
,
@RequestParam
(
value
=
"channel"
)
String
channel
,
@RequestParam
(
value
=
"status"
)
Integer
status
)
throws
Exception
{
if
(
status
!=
1
&&
status
!=
2
&&
status
!=
3
&&
status
!=
4
)
{
if
(
status
!=
1
&&
status
!=
2
&&
status
!=
3
&&
status
!=
4
)
{
return
JsonResult
.
clientFailed
(
"状态值必须是1、2、3、4中的一个!"
);
return
JsonResult
.
clientFailed
(
"状态值必须是1、2、3、4中的一个!"
);
}
}
...
@@ -30,6 +30,9 @@ public class GenVccController {
...
@@ -30,6 +30,9 @@ public class GenVccController {
return
JsonResult
.
clientFailed
(
"渠道必须为214或217"
);
return
JsonResult
.
clientFailed
(
"渠道必须为214或217"
);
}
}
GenVccUser
result
=
vccDataService
.
makeVccUser
(
namespace
,
phoneNo
,
channel
,
status
);
GenVccUser
result
=
vccDataService
.
makeVccUser
(
namespace
,
phoneNo
,
channel
,
status
);
if
(
result
==
null
)
{
return
JsonResult
.
serverFailed
();
}
return
JsonResult
.
success
(
result
);
return
JsonResult
.
success
(
result
);
}
}
}
}
src/main/java/cn/qg/qaplatform/controller/QueryLoanUserDataController.java
View file @
c406bf5f
...
@@ -48,8 +48,8 @@ public class QueryLoanUserDataController {
...
@@ -48,8 +48,8 @@ public class QueryLoanUserDataController {
/**
/**
* @param status 用户状态
* @param status 用户状态
* @param pageNum
* @param pageNum
页码
* @param pageSize
* @param pageSize
每页数量
* @return 所有借款用户数据
* @return 所有借款用户数据
*/
*/
@ApiOperation
(
value
=
"捞数据接口"
)
@ApiOperation
(
value
=
"捞数据接口"
)
...
...
src/main/java/cn/qg/qaplatform/controller/QueryVccController.java
View file @
c406bf5f
...
@@ -31,6 +31,9 @@ public class QueryVccController {
...
@@ -31,6 +31,9 @@ public class QueryVccController {
@GetMapping
(
"/getStatus"
)
@GetMapping
(
"/getStatus"
)
public
JsonResult
getUserStatus
(
String
namespace
,
String
phoneNo
)
{
public
JsonResult
getUserStatus
(
String
namespace
,
String
phoneNo
)
{
QueryVccUser
queryVccUser
=
vccDataService
.
queryUserVccStatus
(
namespace
,
phoneNo
);
QueryVccUser
queryVccUser
=
vccDataService
.
queryUserVccStatus
(
namespace
,
phoneNo
);
if
(
queryVccUser
==
null
)
{
return
JsonResult
.
serverFailed
(
"该用户不存在!"
);
}
return
JsonResult
.
success
(
queryVccUser
);
return
JsonResult
.
success
(
queryVccUser
);
}
}
...
@@ -38,7 +41,7 @@ public class QueryVccController {
...
@@ -38,7 +41,7 @@ public class QueryVccController {
public
JsonResult
checkUserData
(
String
namespace
,
String
phoneNo
,
String
idCardNo
)
{
public
JsonResult
checkUserData
(
String
namespace
,
String
phoneNo
,
String
idCardNo
)
{
QueryVccUser
queryVccUser
=
vccDataService
.
queryUserVccStatus
(
namespace
,
phoneNo
);
QueryVccUser
queryVccUser
=
vccDataService
.
queryUserVccStatus
(
namespace
,
phoneNo
);
if
(
queryVccUser
==
null
)
{
if
(
queryVccUser
==
null
)
{
return
JsonResult
.
serverFailed
(
"
数据
不存在!"
);
return
JsonResult
.
serverFailed
(
"
该用户
不存在!"
);
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"phoneNo"
,
queryVccUser
.
getPhoneNo
());
map
.
put
(
"phoneNo"
,
queryVccUser
.
getPhoneNo
());
...
...
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