1。Controller层用户请求发送验证码
调用service层的方法,并直接返回true,其他的交给消息队列处理
@RequestMapping("/send_verify")
@ResponseBody
public Map<String, Object> sendVerify(String phone) {
Map<String, Object> result = new HashMap<>();
System.out.println("进入send");
//将手机号存入消息队列
loginService.sendPhoneNum(phone);
result.put("success", true);
return result;
}
2.Service层sendPhoneNum方法
将手机号发送至某一主题
//生产者发送手机号
@Override
public void sendPhoneNum(String pho