InboxController.java
2.31 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
package com.yohoufo.inboxclient.controller;
import com.yohobuy.ufo.model.message.SmsMessageReq;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.inboxclient.model.InBoxResponse;
import com.yohoufo.inboxclient.model.InboxReqVO;
import com.yohoufo.inboxclient.sdk.InBoxSDK;
import com.yohoufo.inboxclient.sdk.InBoxSendSmsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by li.ma on 2019/3/19.
* 供后台调用发站内信
*/
@RequestMapping("/erp")
@RestController
public class InboxController {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private InBoxSDK inBoxSDK;
@Autowired
private InBoxSendSmsService smsService;
@RequestMapping(value = "/addInboxForPlatform")
@IgnoreSession
@IgnoreSignature
public String addInboxForPlatform(@RequestBody InboxReqVO reqVO){
logger.info("InboxController.addInbox with param is {}", reqVO);
InBoxResponse result = inBoxSDK.addInbox(reqVO);
logger.info("InboxController.addInbox call result is {}",result);
return "SUCCESS";
}
@RequestMapping(value = "/addBatchInboxForPlatform")
@IgnoreSession
@IgnoreSignature
public String addBatchInboxForPlatform(@RequestBody InboxReqVO reqVO){
logger.info("InboxController.addInbox with param is {}", reqVO);
InBoxResponse result = inBoxSDK.addBatchInbox(reqVO);
logger.info("InboxController.addBatchInbox call result is {}",result);
return "SUCCESS";
}
@RequestMapping(value = "/sendSmsForPlatform")
@IgnoreSession
@IgnoreSignature
public String sendSmsForPlatform(@RequestBody SmsMessageReq smsMessageReq){
logger.info("InboxController.sendSmsForPlatform with param is {}", smsMessageReq);
smsService.smsSendByMobile(smsMessageReq.getContent(), smsMessageReq.getMobileList());
logger.info("InboxController.sendSmsForPlatform call success");
return "SUCCESS";
}
}