Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
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
base_platform_enterprise
gic-platform-auth
Commits
42a1569b
Commit
42a1569b
authored
Nov 08, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证码接口
parent
c7db237a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
29 deletions
+10
-29
UnionEnterpriseController.java
...om/gic/auth/web/controller/UnionEnterpriseController.java
+10
-29
No files found.
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UnionEnterpriseController.java
View file @
42a1569b
...
...
@@ -48,11 +48,6 @@ public class UnionEnterpriseController {
@RequestMapping
(
"save-union-enterprise"
)
public
RestResponse
saveUnionEnterprise
(
@RequestBody
UnionEnterpriseQO
unionEnterpriseQO
){
RestResponse
validateResult
=
this
.
validateAuthCode
(
unionEnterpriseQO
);
if
(
validateResult
!=
null
){
return
validateResult
;
}
this
.
authCodeApiService
.
expireAuthCode
(
unionEnterpriseQO
.
getAuthCodeId
());
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
UnionEnterpriseDTO
enterpriseDTO
=
EntityUtil
.
changeEntityByJSON
(
UnionEnterpriseDTO
.
class
,
unionEnterpriseQO
);
enterpriseDTO
.
setEnterpriseId
(
enterpriseId
);
...
...
@@ -77,6 +72,16 @@ public class UnionEnterpriseController {
return
EnterpriseRestResponse
.
failure
(
response
);
}
@RequestMapping
(
"check-auth-code"
)
public
RestResponse
checkAuthCode
(
Integer
authCodeId
,
String
authCode
){
ServiceResponse
response
=
this
.
authCodeApiService
.
validateAuthCode
(
authCodeId
,
authCode
);
this
.
authCodeApiService
.
expireAuthCode
(
authCodeId
);
if
(
response
.
isSuccess
()){
return
RestResponse
.
success
();
}
return
EnterpriseRestResponse
.
failure
(
response
);
}
@RequestMapping
(
"union-enterprise-detail"
)
public
RestResponse
getUnionEnterpriseDetail
(
Integer
unionId
){
if
(
unionId
==
null
){
...
...
@@ -138,34 +143,10 @@ public class UnionEnterpriseController {
dto
.
setUnionManagerName
(
userResponse
.
getResult
().
getUserName
());
dto
.
setUnionManagerPhone
(
userResponse
.
getResult
().
getPhoneNumber
());
}
}
}
return
RestResponse
.
success
(
result
);
}
return
RestResponse
.
success
();
}
private
RestResponse
validateAuthCode
(
UnionEnterpriseQO
unionEnterpriseQO
){
ServiceResponse
<
AuthCodeDTO
>
authCode
=
this
.
authCodeApiService
.
getAuthCode
(
unionEnterpriseQO
.
getAuthCodeId
());
if
(
authCode
.
isSuccess
()){
AuthCodeDTO
authCodeDTO
=
authCode
.
getResult
();
if
(
authCodeDTO
!=
null
){
if
(
authCodeDTO
.
getStatus
()
==
0
){
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
AUTHCODE_USED
);
}
if
(
authCodeDTO
.
getExpirationTime
().
before
(
new
Date
())){
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
AUTHCODE_EXPIRE
);
}
if
(!
authCodeDTO
.
getAuthCode
().
equals
(
unionEnterpriseQO
.
getAuthCode
())){
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
AUTHCODE_MISTAKE
);
}
}
else
{
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
AUTHCODE_ERR
);
}
}
else
{
EnterpriseRestResponse
.
failure
(
ErrorCode
.
AUTHCODE_ERR
);
}
return
null
;
}
}
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