Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Administrator
browser-backend
Commits
ba2f33d5
Commit
ba2f33d5
authored
Apr 09, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
认证资格设置
parent
90d548b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
AdministratorController.java
...erbackend/account/controller/AdministratorController.java
+19
-0
AccountService.java
.../edgec/browserbackend/account/service/AccountService.java
+2
-0
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+18
-0
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AdministratorController.java
View file @
ba2f33d5
...
...
@@ -332,6 +332,25 @@ public class AdministratorController {
return
resultDto
;
}
//获取用户企业认证的信息
@PreAuthorize
(
Securitys
.
ADMIN_EL
)
@RequestMapping
(
path
=
"/0xadministrator/authorize/set"
,
method
=
RequestMethod
.
PUT
)
public
ResultDto
setAuthorize
(
Principal
principal
,
@RequestParam
(
"username"
)
String
username
,
@RequestParam
(
"isAgree"
)
boolean
isAgree
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
resultDto
.
setData
(
accountService
.
setAuthorize
(
username
,
isAgree
));
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"message"
,
e
.
getMessage
());
resultDto
.
setStatusInfo
(
statusInfo
);
}
return
resultDto
;
}
//添加推广码
@PreAuthorize
(
Securitys
.
ADMIN_EL
)
@RequestMapping
(
path
=
"/0xadministrator/promotioncode/add"
,
method
=
RequestMethod
.
PUT
)
...
...
src/main/java/com/edgec/browserbackend/account/service/AccountService.java
View file @
ba2f33d5
...
...
@@ -110,4 +110,6 @@ public interface AccountService {
File
getAuthorizeFiles
(
String
username
);
boolean
setAuthorize
(
String
username
,
boolean
isAgree
);
}
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
ba2f33d5
...
...
@@ -1182,4 +1182,22 @@ public class AccountServiceImpl implements AccountService {
throw
new
ClientRequestException
(
BrowserErrorCode
.
UNKNOWN
);
}
}
@Override
public
boolean
setAuthorize
(
String
username
,
boolean
isAgree
)
{
try
{
Account
account
=
repository
.
findByName
(
username
);
if
(
account
==
null
)
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
);
if
(
isAgree
)
account
.
setAuthorized
(
2
);
else
account
.
setAuthorized
(
3
);
repository
.
save
(
account
);
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
false
;
}
}
}
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