goupan
2024-04-03 5506e9a45e717ffcb67ec313b5a4e8206d9b3a39
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
package cn.stylefeng.roses.kernel.system.modular.home.controller;
 
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.rule.enums.ResBizTypeEnum;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import cn.stylefeng.roses.kernel.system.modular.home.entity.SysStatisticsCount;
import cn.stylefeng.roses.kernel.system.modular.home.pojo.request.SysStatisticsCountRequest;
import cn.stylefeng.roses.kernel.system.modular.home.service.SysStatisticsCountService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * 常用功能的统计次数控制器
 *
 * @author fengshuonan
 * @date 2022/02/10 21:17
 */
@RestController
@ApiResource(name = "常用功能的统计次数", resBizType = ResBizTypeEnum.SYSTEM)
public class SysStatisticsController {
 
    @Resource
    private SysStatisticsCountService sysStatisticsCountService;
 
    /**
     * 添加
     *
     * @author fengshuonan
     * @date 2022/02/10 21:17
     */
    @PostResource(name = "添加", path = "/sysStatisticsCount/add")
    public ResponseData<?> add(@RequestBody @Validated(SysStatisticsCountRequest.add.class) SysStatisticsCountRequest sysStatisticsCountRequest) {
        sysStatisticsCountService.add(sysStatisticsCountRequest);
        return new SuccessResponseData<>();
    }
 
    /**
     * 删除
     *
     * @author fengshuonan
     * @date 2022/02/10 21:17
     */
    @PostResource(name = "删除", path = "/sysStatisticsCount/delete")
    public ResponseData<?> delete(@RequestBody @Validated(SysStatisticsCountRequest.delete.class) SysStatisticsCountRequest sysStatisticsCountRequest) {
        sysStatisticsCountService.del(sysStatisticsCountRequest);
        return new SuccessResponseData<>();
    }
 
    /**
     * 编辑
     *
     * @author fengshuonan
     * @date 2022/02/10 21:17
     */
    @PostResource(name = "编辑", path = "/sysStatisticsCount/edit")
    public ResponseData<?> edit(@RequestBody @Validated(SysStatisticsCountRequest.edit.class) SysStatisticsCountRequest sysStatisticsCountRequest) {
        sysStatisticsCountService.edit(sysStatisticsCountRequest);
        return new SuccessResponseData<>();
    }
 
    /**
     * 查看详情
     *
     * @author fengshuonan
     * @date 2022/02/10 21:17
     */
    @GetResource(name = "查看详情", path = "/sysStatisticsCount/detail")
    public ResponseData<SysStatisticsCount> detail(@Validated(SysStatisticsCountRequest.detail.class) SysStatisticsCountRequest sysStatisticsCountRequest) {
        return new SuccessResponseData<>(sysStatisticsCountService.detail(sysStatisticsCountRequest));
    }
 
    /**
     * 获取列表
     *
     * @author fengshuonan
     * @date 2022/02/10 21:17
     */
    @GetResource(name = "获取列表", path = "/sysStatisticsCount/list")
    public ResponseData<List<SysStatisticsCount>> list(SysStatisticsCountRequest sysStatisticsCountRequest) {
        return new SuccessResponseData<>(sysStatisticsCountService.findList(sysStatisticsCountRequest));
    }
 
    /**
     * 获取列表(带分页)
     *
     * @author fengshuonan
     * @date 2022/02/10 21:17
     */
    @GetResource(name = "分页查询", path = "/sysStatisticsCount/page")
    public ResponseData<PageResult<SysStatisticsCount>> page(SysStatisticsCountRequest sysStatisticsCountRequest) {
        return new SuccessResponseData<>(sysStatisticsCountService.findPage(sysStatisticsCountRequest));
    }
 
}