WeMessagePushController.java
2.83 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
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.common.utils.poi.ExcelUtil;
import com.linkwechat.wecom.domain.WeMessagePush;
import com.linkwechat.wecom.service.IWeMessagePushService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 消息发送的Controller
*
* @author ruoyi
* @date 2020-10-28
*/
@RestController
@RequestMapping("/wecom/push")
public class WeMessagePushController extends BaseController {
@Autowired
private IWeMessagePushService weMessagePushService;
/**
* 查询消息发送的列表
*/
// @PreAuthorize("@ss.hasPermi('system:push:list')")
@GetMapping("/list")
public TableDataInfo list(WeMessagePush weMessagePush) {
startPage();
List<WeMessagePush> list = weMessagePushService.selectWeMessagePushList(weMessagePush);
return getDataTable(list);
}
/**
* 导出消息发送的列表
*/
// @PreAuthorize("@ss.hasPermi('system:push:export')")
@Log(title = "消息发送的", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeMessagePush weMessagePush) {
List<WeMessagePush> list = weMessagePushService.selectWeMessagePushList(weMessagePush);
ExcelUtil<WeMessagePush> util = new ExcelUtil<WeMessagePush>(WeMessagePush.class);
return util.exportExcel(list, "push");
}
/**
* 获取消息发送的详细信息
*/
// @PreAuthorize("@ss.hasPermi('system:push:query')")
@GetMapping(value = "/{messagePushId}")
public AjaxResult getInfo(@PathVariable("messagePushId") Long messagePushId) {
return AjaxResult.success(weMessagePushService.selectWeMessagePushById(messagePushId));
}
/**
* 新增消息发送的
*/
// @PreAuthorize("@ss.hasPermi('system:push:add')")
@Log(title = "消息发送的", businessType = BusinessType.INSERT)
@PostMapping(value = "add")
public AjaxResult add(@RequestBody WeMessagePush weMessagePush) {
weMessagePushService.insertWeMessagePush(weMessagePush);
return AjaxResult.success();
}
/**
* 删除消息发送的
*/
// @PreAuthorize("@ss.hasPermi('system:push:remove')")
@Log(title = "消息发送的", businessType = BusinessType.DELETE)
@DeleteMapping("/{messagePushIds}")
public AjaxResult remove(@PathVariable Long[] messagePushIds) {
return toAjax(weMessagePushService.deleteWeMessagePushByIds(messagePushIds));
}
}