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));
|
}
|
}
|