|
@@ -1,15 +1,12 @@
|
|
|
package com.ruoyi.sendSMS.controller;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
-import com.ruoyi.common.core.domain.R;
|
|
|
+import com.ruoyi.sendSMS.domain.MessageContent;
|
|
|
import com.ruoyi.sendSMS.service.SendMessageService;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/sendMessageController")
|
|
@@ -18,15 +15,15 @@ public class SendMessageController {
|
|
|
@Resource
|
|
|
SendMessageService sendMessageService;
|
|
|
|
|
|
- @GetMapping("/sendMessage")
|
|
|
- public String sendMessage(@RequestParam(value = "phone") String phone, @RequestParam(value = "str") String str, @RequestParam(value = "SMSsignature") String SMSsignature) {
|
|
|
- return sendMessageService.sendMessage(phone, str, SMSsignature);
|
|
|
+ @PostMapping("/sendMessage")
|
|
|
+ public String sendMessage(@RequestBody MessageContent messageContent) {
|
|
|
+ return sendMessageService.sendMessage(messageContent.getPhone(), messageContent.getStr(), messageContent.getSMSsignature());
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/sendEmail")
|
|
|
- public AjaxResult sendEmail(@RequestParam(value = "mail") String mail, @RequestParam(value = "title") String title, @RequestParam(value = "count") String count) {
|
|
|
+ @PostMapping("/sendEmail")
|
|
|
+ public AjaxResult sendEmail(@RequestBody MessageContent messageContent) {
|
|
|
try {
|
|
|
- MailTools.sendMain(mail, title, count);
|
|
|
+ MailTools.sendMain(messageContent.getMail(), messageContent.getTitle(), messageContent.getCount());
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|