Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
eb5108f7
Commit
eb5108f7
authored
Nov 29, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善api接口
parent
b26c0be0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
2 deletions
+32
-2
api-server/src/main/java/com/zq/api/feign/SysFeign.java
+3
-0
api-server/src/main/java/com/zq/api/service/IApiLogic.java
+9
-0
api-server/src/main/java/com/zq/api/service/impl/ApiV100Logic.java
+5
-0
api-server/src/main/java/com/zq/api/utils/ApiUtils.java
+1
-1
sys-server/src/main/java/com/zq/system/modules/system/rest/SingleController.java
+6
-0
sys-server/src/main/java/com/zq/system/modules/system/service/SingleService.java
+8
-1
No files found.
api-server/src/main/java/com/zq/api/feign/SysFeign.java
View file @
eb5108f7
...
...
@@ -38,4 +38,7 @@ public interface SysFeign {
@GetMapping
(
value
=
"/single/getUserInfo/{appId}"
)
ResultVo
getSingleUserInfo
(
@PathVariable
String
appId
);
@GetMapping
(
value
=
"/single/logout"
)
ResultVo
singleLogout
();
}
api-server/src/main/java/com/zq/api/service/IApiLogic.java
View file @
eb5108f7
...
...
@@ -221,8 +221,17 @@ public interface IApiLogic extends IApiCommon {
*/
ApiResp
getSingleUserInfo
(
ApiForm
form
);
/**
* 单点登出
*
* @param form
* @return
*/
ApiResp
singleLogout
(
ApiForm
form
);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓开放接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/**
* 婚姻搜索接口
*
...
...
api-server/src/main/java/com/zq/api/service/impl/ApiV100Logic.java
View file @
eb5108f7
...
...
@@ -156,6 +156,11 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
}
@Override
public
ApiResp
singleLogout
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
sysFeign
.
singleLogout
());
}
@Override
public
ApiResp
marriageSearch
(
ApiForm
form
)
{
Map
<
String
,
Object
>
paramsMap
=
form
.
getParamsMap
();
ApiTokenVo
apiTokenVo
=
form
.
getApiTokenVo
();
...
...
api-server/src/main/java/com/zq/api/utils/ApiUtils.java
View file @
eb5108f7
...
...
@@ -240,7 +240,7 @@ public class ApiUtils {
String
method
=
"getSingleUserInfo"
;
String
timestamp
=
System
.
currentTimeMillis
()
+
""
;
String
version
=
"1.0.0"
;
String
bizContent
=
"{}"
;
String
bizContent
=
"{}"
;
//JSON字符串
bizContent
=
StrUtil
.
isBlank
(
bizContent
)
?
""
:
URLUtil
.
encode
(
Base64
.
encode
(
bizContent
),
StandardCharsets
.
UTF_8
);
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"appId"
,
appId
);
...
...
sys-server/src/main/java/com/zq/system/modules/system/rest/SingleController.java
View file @
eb5108f7
...
...
@@ -38,6 +38,12 @@ public class SingleController {
singleService
.
login
(
vo
,
request
,
response
);
}
@ApiOperation
(
"单点登出"
)
@AnonymousGetMapping
(
value
=
"/logout"
)
public
void
logout
(
HttpServletRequest
request
)
{
singleService
.
logout
(
request
);
}
@ApiOperation
(
"获取用户信息"
)
@GetMapping
(
value
=
"/getUserInfo/{appId}"
)
public
ResultVo
getUserInfo
(
@PathVariable
String
appId
)
{
...
...
sys-server/src/main/java/com/zq/system/modules/system/service/SingleService.java
View file @
eb5108f7
...
...
@@ -63,6 +63,7 @@ public class SingleService {
private
final
OnlineUserService
onlineUserService
;
private
final
RedisUtils
redisUtils
;
private
final
AuthenticationManagerBuilder
authenticationManagerBuilder
;
private
final
TokenProvider
tokenProvider
;
public
void
register
(
User
resources
)
{
String
passwd
=
null
;
...
...
@@ -106,7 +107,7 @@ public class SingleService {
OnlineUserDto
adminContext
=
ContextUtils
.
getAdminContext
();
List
<
BindUserInfo
>
bindUserInfos
=
blindUserInfoDao
.
selectList
(
Wrappers
.
lambdaQuery
(
BindUserInfo
.
builder
().
userId
(
adminContext
.
getUserId
())
.
sysId
(
vo
.
getSystemId
()).
build
()));
AssertUtils
.
isTrue
(
bindUserInfos
.
size
()
==
0
,
"用户已绑定该系统"
);
AssertUtils
.
isTrue
(
bindUserInfos
.
size
()
==
0
,
"用户已绑定该系统"
);
SysInfo
sysInfo
=
sysInfoDao
.
selectById
(
vo
.
getSystemId
());
AssertUtils
.
notNull
(
sysInfo
,
"系统不存在"
);
...
...
@@ -183,4 +184,10 @@ public class SingleService {
data
.
put
(
"username"
,
bindUserInfo
.
getSystemUserName
());
return
data
;
}
public
void
logout
(
HttpServletRequest
request
)
{
String
token
=
tokenProvider
.
getToken
(
request
);
onlineUserService
.
logout
(
token
);
redisUtils
.
deleteStr
(
token
);
}
}
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