广州市综治平台后端
xusd
2025-06-07 36306491396230522fa20585c2621a7fc899849a
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
package cn.huge.module.syTemplate.controller;
 
import cn.huge.base.common.bo.R;
import cn.huge.module.syTemplate.entity.SyTemplate;
import cn.huge.module.syTemplate.service.ISyTemplateService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * 模板表 前端控制器
 *
 * @author trae
 * @since 2024-02-14
 */
@Slf4j
@RestController
@RequestMapping("/api/web/sy/template")
public class SyTemplateController {
 
    @Autowired
    private ISyTemplateService syTemplateService;
 
    @GetMapping("/page")
    public R<IPage<SyTemplate>> pageList(@RequestParam(defaultValue = "1") Integer pageNo,
                                         @RequestParam(defaultValue = "10") Integer pageSize,
                                         SyTemplate template) {
        return R.ok(syTemplateService.pageList(new Page<>(pageNo, pageSize), template));
    }
 
    @PostMapping("/add")
    public R<Boolean> add(@RequestBody SyTemplate template) {
        return R.ok(syTemplateService.add(template));
    }
 
    @PutMapping("/update")
    public R<Boolean> update(@RequestBody SyTemplate template) {
        return R.ok(syTemplateService.update(template));
    }
 
    @DeleteMapping("/delete/{id}")
    public R<Boolean> delete(@PathVariable String id) {
        return R.ok(syTemplateService.delete(id));
    }
 
    @GetMapping("/detail/{id}")
    public R<SyTemplate> detail(@PathVariable String id) {
        return R.ok(syTemplateService.detail(id));
    }
}