package com.zanxiang.manage.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.zanxiang.common.domain.ResultVo; import com.zanxiang.manage.domain.params.CpAddUpdateParam; import com.zanxiang.manage.domain.params.CpListParam; import com.zanxiang.manage.domain.vo.CpVO; import com.zanxiang.manage.service.CpService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** * @author : lingfeng * @time : 2022-06-22 * @description : cp管理接口 */ @Api(tags = {"CP管理接口"}) @RestController @RequestMapping("/cp") @Slf4j public class CpController { @Autowired private CpService cpService; @ApiOperation(value = "cp新增或者更新") @PostMapping(value = "/add/or/update") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)}) public ResultVo addOrUpdate(@Validated @RequestBody CpAddUpdateParam param) { return new ResultVo<>(cpService.addOrUpdate(param)); } @ApiOperation(value = "cp列表查询") @PostMapping(value = "/list") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = CpVO.class)}) public ResultVo> list(@Validated @RequestBody CpListParam param) { return new ResultVo<>(cpService.list(param)); } @ApiOperation(value = "cp删除") @DeleteMapping(value = "/delete") @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)}) public ResultVo deleteById(@RequestParam Long id) { return new ResultVo<>(cpService.deleteById(id)); } }