|
|
@ -1,78 +1,48 @@
|
|
|
|
package com.java3y.austin.controller;
|
|
|
|
package com.java3y.austin.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
|
|
import com.java3y.austin.dao.MessageTemplateDao;
|
|
|
|
import com.java3y.austin.dao.MessageTemplateDao;
|
|
|
|
import com.java3y.austin.domain.MessageTemplate;
|
|
|
|
import com.java3y.austin.domain.MessageTemplate;
|
|
|
|
|
|
|
|
import com.java3y.austin.vo.BasicResultVO;
|
|
|
|
|
|
|
|
import com.java3y.austin.vo.MessageTemplateVo;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* MessageTemplateController
|
|
|
|
* 消息模板管理Controller
|
|
|
|
* 插入模板测试类
|
|
|
|
|
|
|
|
* @author 3y
|
|
|
|
* @author 3y
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/Message")
|
|
|
|
@RequestMapping("/messageTemplate")
|
|
|
|
@Api("发送消息")
|
|
|
|
@Api("发送消息")
|
|
|
|
|
|
|
|
@CrossOrigin(origins = "http://localhost:3000", allowCredentials = "true")
|
|
|
|
public class MessageTemplateController {
|
|
|
|
public class MessageTemplateController {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private MessageTemplateDao messageTemplateDao;
|
|
|
|
private MessageTemplateDao messageTemplateDao;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* test insert
|
|
|
|
* 如果Id存在,则修改
|
|
|
|
|
|
|
|
* 如果Id不存在,则保存
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/insert")
|
|
|
|
@PostMapping("/save")
|
|
|
|
@ApiOperation("/插入数据")
|
|
|
|
@ApiOperation("/插入数据")
|
|
|
|
public String insert() {
|
|
|
|
public BasicResultVO saveOrUpdate(@RequestBody MessageTemplate messageTemplate) {
|
|
|
|
|
|
|
|
|
|
|
|
MessageTemplate messageTemplate = MessageTemplate.builder()
|
|
|
|
|
|
|
|
.name("test邮件")
|
|
|
|
|
|
|
|
.auditStatus(10)
|
|
|
|
|
|
|
|
.flowId("yyyy")
|
|
|
|
|
|
|
|
.msgStatus(10)
|
|
|
|
|
|
|
|
.idType(50)
|
|
|
|
|
|
|
|
.sendChannel(40)
|
|
|
|
|
|
|
|
.templateType(20)
|
|
|
|
|
|
|
|
.msgType(10)
|
|
|
|
|
|
|
|
.expectPushTime("0")
|
|
|
|
|
|
|
|
.msgContent("{\"content\":\"{$contentValue}\",\"title\":\"{$title}\"}")
|
|
|
|
|
|
|
|
.sendAccount(66)
|
|
|
|
|
|
|
|
.creator("yyyyc")
|
|
|
|
|
|
|
|
.updator("yyyyu")
|
|
|
|
|
|
|
|
.team("yyyt")
|
|
|
|
|
|
|
|
.proposer("yyyy22")
|
|
|
|
|
|
|
|
.auditor("yyyyyyz")
|
|
|
|
|
|
|
|
.isDeleted(0)
|
|
|
|
|
|
|
|
.created(Math.toIntExact(DateUtil.currentSeconds()))
|
|
|
|
|
|
|
|
.updated(Math.toIntExact(DateUtil.currentSeconds()))
|
|
|
|
|
|
|
|
.deduplicationTime(1)
|
|
|
|
|
|
|
|
.isNightShield(0)
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MessageTemplate info = messageTemplateDao.save(messageTemplate);
|
|
|
|
MessageTemplate info = messageTemplateDao.save(messageTemplate);
|
|
|
|
|
|
|
|
return BasicResultVO.success(info);
|
|
|
|
return JSON.toJSONString(info);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* test query
|
|
|
|
* 列表数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/query")
|
|
|
|
@GetMapping("/query")
|
|
|
|
@ApiOperation("/查找数据")
|
|
|
|
@ApiOperation("/查找数据")
|
|
|
|
public String query() {
|
|
|
|
public BasicResultVO queryList() {
|
|
|
|
Iterable<MessageTemplate> all = messageTemplateDao.findAll();
|
|
|
|
Iterable<MessageTemplate> all = messageTemplateDao.findAll();
|
|
|
|
for (MessageTemplate messageTemplate : all) {
|
|
|
|
long count = messageTemplateDao.count();
|
|
|
|
return JSON.toJSONString(messageTemplate);
|
|
|
|
MessageTemplateVo messageTemplateVo = MessageTemplateVo.builder().count(count).rows(all).build();
|
|
|
|
}
|
|
|
|
return BasicResultVO.success(messageTemplateVo);
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|