新增短信编辑和重新发送短信接口
This commit is contained in:
+49
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.sendrecord.ShortMessageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/shortMessage")
|
||||
public class ShortMessageController {
|
||||
@Autowired
|
||||
private SmsRecordMapper smsRecordMapper;
|
||||
@Autowired
|
||||
private ShortMessageService shortMessageService;
|
||||
|
||||
@Anonymous
|
||||
@PostMapping("/updateSendContent")
|
||||
public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) {
|
||||
if (smsSendRecord != null && smsSendRecord.getId() != null) {
|
||||
SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
|
||||
smsSendRecord.setUpdateTime(new Date());
|
||||
smsRecordMapper.updateSendContent(smsSendRecord);
|
||||
shortMessageService.insertShortMessageHistoryRecord(oldSendRecord);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("更新失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新发送短信
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/reSendShortMessage")
|
||||
public AjaxResult reSendShortMessage(@RequestBody SmsSendRecord smsSendRecord) {
|
||||
if (smsSendRecord != null) {
|
||||
AjaxResult result = shortMessageService.reSendShortMessage(smsSendRecord);
|
||||
return result;
|
||||
}
|
||||
return AjaxResult.error("发送失败");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user