|
@@ -1,5 +1,6 @@
|
|
|
package com.usoftchina.saas.sms.controller;
|
|
package com.usoftchina.saas.sms.controller;
|
|
|
|
|
|
|
|
|
|
+import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
|
|
import com.aliyuncs.exceptions.ClientException;
|
|
import com.aliyuncs.exceptions.ClientException;
|
|
|
import com.usoftchina.saas.base.Result;
|
|
import com.usoftchina.saas.base.Result;
|
|
|
import com.usoftchina.saas.exception.BizException;
|
|
import com.usoftchina.saas.exception.BizException;
|
|
@@ -21,12 +22,13 @@ public class SmsController {
|
|
|
|
|
|
|
|
@PostMapping("/msg/send")
|
|
@PostMapping("/msg/send")
|
|
|
public Result sendRegisterMsg(@RequestBody SmsDTO smsDTO){
|
|
public Result sendRegisterMsg(@RequestBody SmsDTO smsDTO){
|
|
|
|
|
+ SendSmsResponse sendSmsResponse = null;
|
|
|
try {
|
|
try {
|
|
|
- smsService.sendMessage(smsConfig, smsDTO);
|
|
|
|
|
|
|
+ sendSmsResponse = smsService.sendMessage(smsConfig, smsDTO);
|
|
|
} catch (ClientException e) {
|
|
} catch (ClientException e) {
|
|
|
return Result.error(new BizException(Integer.parseInt(e.getErrCode()), e.getMessage()));
|
|
return Result.error(new BizException(Integer.parseInt(e.getErrCode()), e.getMessage()));
|
|
|
}
|
|
}
|
|
|
- return Result.success();
|
|
|
|
|
|
|
+ return Result.success(sendSmsResponse.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|