SendMessageAction.java
1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.cjs.cms.action.pub;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.cjs.cms.biz.pub.SendMessageBiz;
import com.cjs.cms.dao.pub.SendMessageLogDao;
import com.cjs.cms.util.lang.JsonUtil;
import com.cjs.cms.util.lang.PageUtils;
import com.cjs.cms.util.web.SendMessageUtil;
/**
* 信息发送
*
* @author kongmingke
*
*/
@RestController
@RequestMapping("/sendMessage")
public class SendMessageAction {
@Autowired
private SendMessageLogDao sendMessageDao;
@Autowired
private SendMessageUtil sendMes;
@Autowired
private SendMessageBiz sendBiz;
@RequestMapping("/searchList")
public String getMessageList(@RequestParam Map<String, Object> params) {
PageUtils.processPage(params);
return JsonUtil.toPageJson(sendMessageDao.getSendMessageList(params),
sendMessageDao.getSendMessageCount(params));
}
/**
* 发送短信
* @param phoneNumber
* @param content
*
*/
@RequestMapping("/send")
public String send(String phoneNumber, String content) {
String msg = "发送成功";
if (StringUtils.isNotBlank(content) && StringUtils.isNotBlank(phoneNumber)) {
String randomStr = content + "【赵涌牛】";
sendMes.send(phoneNumber, randomStr);
} else {
msg = "手机号或内容不能为空";
}
return msg;
}
@RequestMapping("/callBack")
public String callBack(String args) {
return sendBiz.callBack(args);
}
}