添加"模版"的基础业务接口和实现
This commit is contained in:
parent
fd21dbab1d
commit
816501a374
@ -1,8 +1,17 @@
|
||||
package com.ycwl.basic.controller.pc;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ycwl.basic.model.pc.template.entity.TemplateEntity;
|
||||
import com.ycwl.basic.model.pc.template.req.TemplateReqQuery;
|
||||
import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
||||
import com.ycwl.basic.service.pc.TemplateService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
@ -13,4 +22,42 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Api(tags = "模板管理")
|
||||
public class TemplateController {
|
||||
|
||||
@Autowired
|
||||
private TemplateService templateService;
|
||||
|
||||
@ApiOperation("分页查询模板")
|
||||
@PostMapping("/page")
|
||||
public ApiResponse<PageInfo<TemplateRespVO>> pageQuery(@RequestBody TemplateReqQuery templateReqQuery) {
|
||||
return templateService.pageQuery(templateReqQuery);
|
||||
}
|
||||
@ApiOperation("查询模板列表")
|
||||
@PostMapping("/list")
|
||||
public ApiResponse<List<TemplateRespVO>> list(@RequestBody TemplateReqQuery templateReqQuery) {
|
||||
return templateService.list(templateReqQuery);
|
||||
}
|
||||
@ApiOperation("查询模板详情")
|
||||
@GetMapping("getDetail/{id}")
|
||||
public ApiResponse<TemplateRespVO> getById(@PathVariable Long id) {
|
||||
return templateService.getById(id);
|
||||
}
|
||||
@ApiOperation("添加模板")
|
||||
@PostMapping("/add")
|
||||
public ApiResponse<Boolean> add(@RequestBody TemplateEntity template) {
|
||||
return templateService.add(template);
|
||||
}
|
||||
@ApiOperation("删除模板")
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public ApiResponse<Integer> deleteById(@PathVariable Long id) {
|
||||
return templateService.deleteById(id);
|
||||
}
|
||||
@ApiOperation("修改模板")
|
||||
@PostMapping("/update")
|
||||
public ApiResponse<Boolean> update(@RequestBody TemplateEntity template) {
|
||||
return templateService.update(template);
|
||||
}
|
||||
@ApiOperation("修改模板状态")
|
||||
@PostMapping("/updateStatus")
|
||||
public ApiResponse<Boolean> updateStatus(@RequestBody Long id) {
|
||||
return templateService.updateStatus(id);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user