WeGroupMessageTemplateController.java
3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.WeGroupMessageTemplate;
import com.linkwechat.wecom.domain.query.WeAddGroupMessageQuery;
import com.linkwechat.wecom.domain.vo.WeGroupMessageDetailVo;
import com.linkwechat.wecom.service.IWeGroupMessageTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 群发消息模板Controller
*
* @author ruoyi
* @date 2021-10-27
*/
@Api(tags = "群发消息管理")
@RestController
@RequestMapping("/wecom/groupmsg/template")
public class WeGroupMessageTemplateController extends BaseController {
@Autowired
private IWeGroupMessageTemplateService iWeGroupMessageTemplateService;
/**
* 查询群发消息模板列表
*/
//@PreAuthorize("@ss.hasPermi('linkwechat:template:list')")
@ApiOperation(value = "查询群发消息模板列表", httpMethod = "GET")
@GetMapping("/list")
public TableDataInfo<WeGroupMessageTemplate> list(WeGroupMessageTemplate weGroupMessageTemplate) {
startPage();
List<WeGroupMessageTemplate> list = iWeGroupMessageTemplateService.queryList(weGroupMessageTemplate);
return getDataTable(list);
}
/**
* 获取群发消息模板详细信息
*/
//@PreAuthorize("@ss.hasPermi('linkwechat:template:query')")
@ApiOperation(value = "获取群发消息模板详细信息", httpMethod = "GET")
@GetMapping(value = "/{id}")
public AjaxResult<WeGroupMessageDetailVo> getGroupMsgTemplateDetail(@PathVariable("id") Long id) {
return AjaxResult.success(iWeGroupMessageTemplateService.getGroupMsgTemplateDetail(id));
}
/**
* 新增群发消息模板
*/
//@PreAuthorize("@ss.hasPermi('linkwechat:template:add')")
@ApiOperation(value = "新增群发消息模板", httpMethod = "POST")
@Log(title = "群发消息模板", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult addGroupMsgTemplate(@RequestBody WeAddGroupMessageQuery query) {
iWeGroupMessageTemplateService.addGroupMsgTemplate(query);
return AjaxResult.success();
}
/**
* 同步消息发送结果
*/
//@PreAuthorize("@ss.hasPermi('linkwechat:template:remove')")
@ApiOperation(value = "同步消息发送结果", httpMethod = "GET")
@Log(title = "群发消息模板", businessType = BusinessType.OTHER)
@GetMapping("/sync/{ids}")
public AjaxResult sync(@PathVariable Long[] ids) {
iWeGroupMessageTemplateService.syncGroupMsgSendResultByIds(Arrays.asList(ids));
return AjaxResult.success();
}
/**
* 取消定时发送
*/
//@PreAuthorize("@ss.hasPermi('linkwechat:template:remove')")
@ApiOperation(value = "取消定时发送", httpMethod = "GET")
@Log(title = "群发消息模板", businessType = BusinessType.UPDATE)
@GetMapping("/cancel/{ids}")
public AjaxResult cancel(@PathVariable Long[] ids) {
iWeGroupMessageTemplateService.cancelByIds(Arrays.asList(ids));
return AjaxResult.success();
}
}