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
b82e73e0
Commit
b82e73e0
authored
Jul 14, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中台注销激活
parent
9a75b417
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
UserController.java
...oup/xyqb/controller/middleoffice/user/UserController.java
+10
-0
DisableActiveEventListner.java
...a/cn/quantgroup/xyqb/event/DisableActiveEventListner.java
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/user/UserController.java
View file @
b82e73e0
package
cn
.
quantgroup
.
xyqb
.
controller
.
middleoffice
.
user
;
package
cn
.
quantgroup
.
xyqb
.
controller
.
middleoffice
.
user
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.event.DisableActiveEvent
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.messaging.handler.annotation.Header
;
import
org.springframework.messaging.handler.annotation.Header
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -20,6 +22,9 @@ public class UserController {
...
@@ -20,6 +22,9 @@ public class UserController {
@Resource
@Resource
private
IUserService
userService
;
private
IUserService
userService
;
@Resource
private
ApplicationEventPublisher
applicationEventPublisher
;
@PutMapping
(
"/enable/{userId}"
)
@PutMapping
(
"/enable/{userId}"
)
public
JsonResult
enable
(
@PathVariable
Long
userId
)
{
public
JsonResult
enable
(
@PathVariable
Long
userId
)
{
User
user
=
userService
.
findById
(
userId
);
User
user
=
userService
.
findById
(
userId
);
...
@@ -29,6 +34,8 @@ public class UserController {
...
@@ -29,6 +34,8 @@ public class UserController {
}
}
user
.
setEnable
(
true
);
user
.
setEnable
(
true
);
userService
.
saveUser
(
user
);
userService
.
saveUser
(
user
);
//通知消息中心
applicationEventPublisher
.
publishEvent
(
new
DisableActiveEvent
(
this
,
user
));
return
JsonResult
.
buildSuccessResult
();
return
JsonResult
.
buildSuccessResult
();
}
}
...
@@ -42,6 +49,9 @@ public class UserController {
...
@@ -42,6 +49,9 @@ public class UserController {
user
.
setEnable
(
false
);
user
.
setEnable
(
false
);
//清理缓存
//清理缓存
userService
.
saveUser
(
user
);
userService
.
saveUser
(
user
);
//通知消息中心
applicationEventPublisher
.
publishEvent
(
new
DisableActiveEvent
(
this
,
user
));
return
JsonResult
.
buildSuccessResult
();
return
JsonResult
.
buildSuccessResult
();
}
}
...
...
src/main/java/cn/quantgroup/xyqb/event/DisableActiveEventListner.java
View file @
b82e73e0
...
@@ -46,7 +46,7 @@ public class DisableActiveEventListner implements ApplicationListener<DisableAct
...
@@ -46,7 +46,7 @@ public class DisableActiveEventListner implements ApplicationListener<DisableAct
String
post
=
httpService
.
postJson
(
msgCenter
.
concat
(
SMS_MARKET_BLACK_LIST
),
String
post
=
httpService
.
postJson
(
msgCenter
.
concat
(
SMS_MARKET_BLACK_LIST
),
ImmutableMap
.
of
(
"userId"
,
userId
,
ImmutableMap
.
of
(
"userId"
,
userId
,
"phoneNo"
,
phoneNo
,
"phoneNo"
,
phoneNo
,
"enable"
,
String
.
valueOf
(
enable
)));
"enable"
,
String
.
valueOf
(
!
enable
)));
//true代表消息中心的注销false代表激活跟用户中心是反的
log
.
info
(
"通知消息中心激活/注销用户结束user:{} ,post:{} "
,
user
,
post
);
log
.
info
(
"通知消息中心激活/注销用户结束user:{} ,post:{} "
,
user
,
post
);
}
}
...
...
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