作者 王勇

再次对增加队列时,增添验证

@@ -116,7 +116,6 @@ public class BusQueueController { @@ -116,7 +116,6 @@ public class BusQueueController {
116 public ResultJson insertBusQueue(@RequestBody BusQueue busQueue) throws IOException, TimeoutException 116 public ResultJson insertBusQueue(@RequestBody BusQueue busQueue) throws IOException, TimeoutException
117 { 117 {
118 String message = validateBusQueue(busQueue); 118 String message = validateBusQueue(busQueue);
119 -  
120 //验证通过 119 //验证通过
121 return message == null 120 return message == null
122 ? busQueueService.insertSelective(busQueue) 121 ? busQueueService.insertSelective(busQueue)
1 -  
2 -0、首先要有rabbitmq服务器以及对应的虚拟主机  
3 -  
4 -1、要有交换机 exchange  
5 -2、要有队列 queue  
6 -3、要有队列、交换机、路由键的绑定关系 binding  
7 -  
8 -4、才能将消息发送到 exchange,从exchange分发到queue,从queue处接收到消息,进行消息的消费(具体业务)  
9 -  
10 -从exchange分发到queue,是通过 routingkey  
@@ -112,10 +112,10 @@ public class BusQueueServiceImpl implements BusQueueService { @@ -112,10 +112,10 @@ public class BusQueueServiceImpl implements BusQueueService {
112 public ResultJson insertSelective(BusQueue record) throws IOException, TimeoutException 112 public ResultJson insertSelective(BusQueue record) throws IOException, TimeoutException
113 { 113 {
114 if (userInfoMapper.selectUserExist(record.getUsername()).size() == 0) { 114 if (userInfoMapper.selectUserExist(record.getUsername()).size() == 0) {
115 - return new ResultJson<>("400", "该用户信息,不存在"); 115 + return new ResultJson<>("400", "该MQ用户信息,不存在");
116 } 116 }
117 if (userInfoMapper.selectByBusQueue(record).size() == 0) { 117 if (userInfoMapper.selectByBusQueue(record).size() == 0) {
118 - return new ResultJson<>("400", "该用户关系,不存在"); 118 + return new ResultJson<>("400", "该MQ用户关系,不存在");
119 } 119 }
120 // 设置id 120 // 设置id
121 record.setId(IdUtils.generateId()); 121 record.setId(IdUtils.generateId());