Commit b1936c9f by levphon

通知服务-新增发短信接口

1 parent 058263c8
......@@ -37,7 +37,7 @@ public class NotifyApiController implements NotifyCenterFeignClient {
@PostMapping(value = "/sendSms")
@ResponseBody
public R sendSms(@RequestBody SmsMessageRequest messageRequest) {
smsService.sendSms(messageRequest.getPhone(), messageRequest.getTemplate(), messageRequest.getArgs().values());
smsService.sendSms(messageRequest.getPhone(), messageRequest.getTemplate(), messageRequest.getArgs().values().toArray());
return R.ok();
}
......@@ -49,7 +49,7 @@ public class NotifyApiController implements NotifyCenterFeignClient {
args.put("arg1", "刘宇峰");
args.put("arg2", "B73493098765");
args.put("arg3", 1234);
mailService.sendSimpleMail("liuyf@didihu.com.cn", "notifycenter test", "MAIL_TEMPLATE_ORDER_PAID_NOTIFY_OPERATOR", args.values());
mailService.sendSimpleMail("liuyf@didihu.com.cn", "notifycenter test", "MAIL_TEMPLATE_ORDER_PAID_NOTIFY_OPERATOR", args.values().toArray());
return R.ok();
}
......
......@@ -34,7 +34,7 @@ public class RopHttpUtil {
paramsMap.add("method", method);
}
public static <T> T get(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
public static <T> T get(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) {
addBaseParam(paramsMap, method);
MultiValueMap<String, String> params = getSysParams();
params.putAll(paramsMap);
......@@ -53,7 +53,7 @@ public class RopHttpUtil {
return forObject;
}
public static <T> T post(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
public static <T> T post(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) {
addBaseParam(paramsMap, method);
MultiValueMap<String, String> params = getSysParams();
params.putAll(paramsMap);
......@@ -67,7 +67,7 @@ public class RopHttpUtil {
return new RestTemplate().postForObject(baseurl, params, responseType);
}
public static <T> T postE(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) throws Exception {
public static <T> T postE(MultiValueMap<String, String> paramsMap, Class<T> responseType, String baseurl, String method) {
addBaseParamE(paramsMap, method);
MultiValueMap<String, String> params = getSysParamsE();
params.putAll(paramsMap);
......
......@@ -27,7 +27,7 @@ public class RopUtils {
* @return
*/
public static String signByMd5(Map<String, String> paramValues, String secret) {
return sign(paramValues, null, secret);
return signByMd5(paramValues, null, secret);
}
/**
......
......@@ -3,6 +3,7 @@ package cn.com.glsx.test;
import cn.com.glsx.Application;
import cn.com.glsx.notify.dto.request.WechatMessageRequest;
import cn.com.glsx.notify.modules.service.MailService;
import cn.com.glsx.notify.modules.service.SmsService;
import com.glsx.plat.common.utils.DateUtils;
import com.google.common.collect.Maps;
import org.assertj.core.util.Lists;
......@@ -21,8 +22,8 @@ import java.util.Map;
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class NotifyApplicationTests {
/*@Autowired
private SmsService smsService;*/
@Autowired
private SmsService smsService;
@Autowired
private MailService mailService;
......@@ -33,12 +34,12 @@ public class NotifyApplicationTests {
// @Autowired
// private WeixinService weixinService;
/*@Test
@Test
public void testSms() {
Map<String, Object> args = new HashMap<>();
args.put("code", 1234);
smsService.sendSms("18682185876", "SMS_TEMPLATE_VERIFY_CODE", args.values());
}*/
}
@Test
public void testMail() throws Exception {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!