懒羊羊
2023-11-25 9bd5461a1387becd4da03158061a1ed17ddf6a6c
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
package ${providerPackage};
 
import ${apiPackage}.${entity}Api;
import ${package.EntitySpecParams}.${entity}Param;
import ${package.EntitySpecResult}.${entity}Result;
import ${package.Service}.${table.serviceName};
import cn.stylefeng.roses.kernel.model.page.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * ${tool.cleanWhite(table.comment)}服务提供者
 *
 * @author ${author}
 * @Date ${tool.currentTime()}
 */
@RestController
public class ${entity}Provider implements ${entity}Api {
 
    <% var lowerEntity = tool.lowerFirst(entity); %>
    <% var lowerEntityService = lowerEntity + 'Service'; %>
 
    @Autowired
    private ${entity}Service ${lowerEntityService};
 
    /**
     * 新增
     *
     * @author ${author}
     * @Date ${date}
     */
    @Override
    public void add(@RequestBody ${entity}Param param) {
        ${lowerEntityService}.add(param);
    }
 
    /**
     * 修改
     *
     * @author ${author}
     * @Date ${date}
     */
    @Override
    public void delete(@RequestBody ${entity}Param param) {
        ${lowerEntityService}.delete(param);
    }
 
    /**
     * 删除
     *
     * @author ${author}
     * @Date ${date}
     */
    @Override
    public void update(@RequestBody ${entity}Param param) {
        ${lowerEntityService}.update(param);
    }
 
    /**
     * 查询单条详情
     *
     * @author ${author}
     * @Date ${date}
     */
    @Override
    public ${entity}Result findBySpec(@RequestBody ${entity}Param param) {
        return ${lowerEntityService}.findBySpec(param);
    }
 
    /**
     * 查询列表
     *
     * @author ${author}
     * @Date ${date}
     */
    @Override
    public List<${entity}Result> findListBySpec(@RequestBody ${entity}Param param) {
        return ${lowerEntityService}.findListBySpec(param);
    }
 
    /**
     * 分页查询列表
     *
     * @author ${author}
     * @Date ${date}
     */
    @Override
    public PageResult<${entity}Result> findPageBySpec(@RequestBody ${entity}Param param) {
        return ${lowerEntityService}.findPageBySpec(param);
    }
 
}