|
@@ -4,6 +4,7 @@ package com.sunyo.wlpt.message.bus.service.controller; |
|
@@ -4,6 +4,7 @@ package com.sunyo.wlpt.message.bus.service.controller; |
4
|
import com.github.pagehelper.PageInfo;
|
4
|
import com.github.pagehelper.PageInfo;
|
5
|
import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding;
|
5
|
import com.sunyo.wlpt.message.bus.service.domain.UserMessageBinding;
|
6
|
import com.sunyo.wlpt.message.bus.service.response.ResultJson;
|
6
|
import com.sunyo.wlpt.message.bus.service.response.ResultJson;
|
|
|
7
|
+import com.sunyo.wlpt.message.bus.service.service.UserInfoService;
|
7
|
import com.sunyo.wlpt.message.bus.service.service.UserMessageBindingService;
|
8
|
import com.sunyo.wlpt.message.bus.service.service.UserMessageBindingService;
|
8
|
import org.springframework.web.bind.annotation.*;
|
9
|
import org.springframework.web.bind.annotation.*;
|
9
|
|
10
|
|
|
@@ -23,6 +24,9 @@ import java.util.concurrent.TimeoutException; |
|
@@ -23,6 +24,9 @@ import java.util.concurrent.TimeoutException; |
23
|
public class UserMessageBindingController {
|
24
|
public class UserMessageBindingController {
|
24
|
|
25
|
|
25
|
@Resource
|
26
|
@Resource
|
|
|
27
|
+ private UserInfoService userInfoService;
|
|
|
28
|
+
|
|
|
29
|
+ @Resource
|
26
|
private UserMessageBindingService userMessageBindingService;
|
30
|
private UserMessageBindingService userMessageBindingService;
|
27
|
|
31
|
|
28
|
/**
|
32
|
/**
|
|
@@ -49,7 +53,6 @@ public class UserMessageBindingController { |
|
@@ -49,7 +53,6 @@ public class UserMessageBindingController { |
49
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
53
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
50
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize)
|
54
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize)
|
51
|
{
|
55
|
{
|
52
|
- // 获取查询参数
|
|
|
53
|
UserMessageBinding userMessageBinding = UserMessageBinding.builder()
|
56
|
UserMessageBinding userMessageBinding = UserMessageBinding.builder()
|
54
|
.username(username)
|
57
|
.username(username)
|
55
|
.serverName(serverName)
|
58
|
.serverName(serverName)
|
|
@@ -58,7 +61,6 @@ public class UserMessageBindingController { |
|
@@ -58,7 +61,6 @@ public class UserMessageBindingController { |
58
|
.queueName(queueName)
|
61
|
.queueName(queueName)
|
59
|
.routingKeyName(routingKeyName)
|
62
|
.routingKeyName(routingKeyName)
|
60
|
.build();
|
63
|
.build();
|
61
|
- // 分页查询
|
|
|
62
|
PageInfo pageInfo = userMessageBindingService.selectUserMessageBindingList(userMessageBinding, pageNum, pageSize);
|
64
|
PageInfo pageInfo = userMessageBindingService.selectUserMessageBindingList(userMessageBinding, pageNum, pageSize);
|
63
|
return pageInfo.getTotal() > 0
|
65
|
return pageInfo.getTotal() > 0
|
64
|
? new ResultJson<>("200", "查询-账户消息绑定配置列表,成功!", pageInfo)
|
66
|
? new ResultJson<>("200", "查询-账户消息绑定配置列表,成功!", pageInfo)
|
|
@@ -75,7 +77,6 @@ public class UserMessageBindingController { |
|
@@ -75,7 +77,6 @@ public class UserMessageBindingController { |
75
|
public ResultJson deleteUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding)
|
77
|
public ResultJson deleteUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding)
|
76
|
throws IOException, TimeoutException
|
78
|
throws IOException, TimeoutException
|
77
|
{
|
79
|
{
|
78
|
- // 执行删除方法
|
|
|
79
|
return userMessageBindingService.deleteByPrimaryKey(userMessageBinding.getId()) > 0
|
80
|
return userMessageBindingService.deleteByPrimaryKey(userMessageBinding.getId()) > 0
|
80
|
? new ResultJson<>("200", "删除-账户消息配置信息,成功")
|
81
|
? new ResultJson<>("200", "删除-账户消息配置信息,成功")
|
81
|
: new ResultJson<>("500", "删除-账户消息配置信息,失败");
|
82
|
: new ResultJson<>("500", "删除-账户消息配置信息,失败");
|
|
@@ -91,7 +92,6 @@ public class UserMessageBindingController { |
|
@@ -91,7 +92,6 @@ public class UserMessageBindingController { |
91
|
public ResultJson batchRemoveUserMessageBinding(String ids)
|
92
|
public ResultJson batchRemoveUserMessageBinding(String ids)
|
92
|
throws IOException, TimeoutException
|
93
|
throws IOException, TimeoutException
|
93
|
{
|
94
|
{
|
94
|
- // 执行批量删除
|
|
|
95
|
return userMessageBindingService.deleteByPrimaryKey(ids) > 0
|
95
|
return userMessageBindingService.deleteByPrimaryKey(ids) > 0
|
96
|
? new ResultJson<>("200", "批量删除-账户消息配置信息,成功")
|
96
|
? new ResultJson<>("200", "批量删除-账户消息配置信息,成功")
|
97
|
: new ResultJson<>("500", "批量删除-账户消息配置信息,失败");
|
97
|
: new ResultJson<>("500", "批量删除-账户消息配置信息,失败");
|
|
@@ -106,7 +106,6 @@ public class UserMessageBindingController { |
|
@@ -106,7 +106,6 @@ public class UserMessageBindingController { |
106
|
@PutMapping("/update")
|
106
|
@PutMapping("/update")
|
107
|
public ResultJson updateUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding)
|
107
|
public ResultJson updateUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding)
|
108
|
{
|
108
|
{
|
109
|
- // 执行编辑
|
|
|
110
|
return userMessageBindingService.updateByPrimaryKeySelective(userMessageBinding) > 0
|
109
|
return userMessageBindingService.updateByPrimaryKeySelective(userMessageBinding) > 0
|
111
|
? new ResultJson<>("200", "编辑-账户消息配置-信息,成功")
|
110
|
? new ResultJson<>("200", "编辑-账户消息配置-信息,成功")
|
112
|
: new ResultJson<>("500", "编辑-账户消息配置-信息,失败");
|
111
|
: new ResultJson<>("500", "编辑-账户消息配置-信息,失败");
|
|
@@ -122,7 +121,6 @@ public class UserMessageBindingController { |
|
@@ -122,7 +121,6 @@ public class UserMessageBindingController { |
122
|
public ResultJson insertUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding)
|
121
|
public ResultJson insertUserMessageBinding(@RequestBody UserMessageBinding userMessageBinding)
|
123
|
throws IOException, TimeoutException
|
122
|
throws IOException, TimeoutException
|
124
|
{
|
123
|
{
|
125
|
- // 执行新增
|
|
|
126
|
return userMessageBindingService.insertSelective(userMessageBinding) > 0
|
124
|
return userMessageBindingService.insertSelective(userMessageBinding) > 0
|
127
|
? new ResultJson<>("200", "添加-账户消息配置-信息,成功")
|
125
|
? new ResultJson<>("200", "添加-账户消息配置-信息,成功")
|
128
|
: new ResultJson<>("500", "添加-账户消息配置-信息,失败");
|
126
|
: new ResultJson<>("500", "添加-账户消息配置-信息,失败");
|