MallController.java
3.98 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package vion.controller.monitor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import vion.dto.monitor.MallDTO;
import vion.model.monitor.MAccount;
import vion.model.monitor.RMallRemark;
import vion.service.monitor.IMallService;
import vion.service.monitor.IRMallRemarkService;
import vion.vo.monitor.MallVO;
import java.util.List;
/**
* mall 信息
*/
@RestController
@RequestMapping("/api/mall")
@RequiredArgsConstructor
public class MallController {
private final IMallService mallService;
private final IRMallRemarkService mallRemarkService;
@GetMapping("/account")
@SaCheckPermission(value = "mall:account:list", orRole = "admin")
public Page<MAccount> listAccount(MAccount dto) {
return mallService.listAccount(dto);
}
@GetMapping("/attention/account")
@SaCheckPermission(value = "mall:attention:account:list", orRole = "admin")
public Page<MAccount> listAttentionAccount(MAccount dto) {
return mallService.listAttentionAccount(dto);
}
@GetMapping
@SaCheckPermission(value = "mall:list", orRole = "admin")
public Page<MallVO> list(MallDTO dto) {
return mallService.list(dto);
}
@GetMapping("/{id}")
@SaCheckPermission(value = "mall:get", orRole = "admin")
public MallVO get(@PathVariable Long id) {
return mallService.get(id);
}
@GetMapping("/attention")
@SaCheckPermission(value = "mall:attention:list", orRole = "admin")
public Page<MallVO> listAttention(MallDTO dto) {
return mallService.listAttention(dto);
}
@GetMapping("/errorAttention")
@SaCheckPermission(value = "mall:attention:listError", orRole = "admin")
public Page<MallVO> listErrorAttention(MallDTO dto) {
return mallService.listErrorAttention(dto);
}
@PostMapping("/attention")
@SaCheckPermission(value = "mall:attention:edit", orRole = "admin")
public String attention(@RequestBody List<MallDTO> dtoList) {
return mallService.attention(dtoList);
}
@PostMapping("/attention/account/{accountUid}")
@SaCheckPermission(value = "mall:attention:account", orRole = "admin")
public String attentionByAccount(@PathVariable String accountUid) {
return mallService.attentionByAccount(accountUid);
}
@PostMapping("/attention/{id}")
@SaCheckPermission(value = "mall:attention:cancel", orRole = "admin")
public String cancelAttention(@PathVariable Long id) {
return mallService.cancelAttention(id);
}
// region 备注
@GetMapping("/remark")
@SaCheckPermission(value = "mall:remark:list", orRole = "admin")
public Page<RMallRemark> listRemark(RMallRemark dto) {
return mallRemarkService.lambdaQuery(dto)
.orderByDesc(RMallRemark::getRemarkDate, RMallRemark::getCreateTime)
.page(Page.of(dto.getPageNum(), dto.getPageSize()));
}
@GetMapping("/remark/{id}")
@SaCheckPermission(value = "mall:remark:get", orRole = "admin")
public RMallRemark getRemark(@PathVariable Long id) {
return mallRemarkService.getById(id);
}
@PostMapping("/remark")
@SaCheckPermission(value = "mall:remark:save", orRole = "admin")
public String remark(@RequestBody RMallRemark dto) {
return mallRemarkService.save(dto) ? "添加成功" : "添加失败";
}
@PostMapping("/remark/{id}")
@SaCheckPermission(value = "mall:remark:edit", orRole = "admin")
public String editRemark(@PathVariable Long id, @RequestBody RMallRemark dto) {
dto.setId(id);
return mallRemarkService.updateById(dto) ? "修改成功" : "修改失败";
}
@DeleteMapping("/remark/{id}")
@SaCheckPermission(value = "mall:remark:remove", orRole = "admin")
public String removeRemark(@PathVariable Long id) {
return mallRemarkService.removeById(id) ? "删除成功" : "删除失败";
}
// endregion
}