From 5dc04f3291c00d66f8733a49896612ea1e3b31c5 Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期四, 16 九月 2021 13:19:14 +0800 Subject: [PATCH] Merge branch 'test' into 'zzj' --- springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java | 90 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 90 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java new file mode 100644 index 0000000..9aad64f --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/api/ComPropertyRepairApi.java @@ -0,0 +1,90 @@ +package com.panzhihua.service_property.api; + + +import com.panzhihua.common.model.dtos.property.CommonPage; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.property.ComPropertyRepairVO; +import com.panzhihua.service_property.entity.ComPropertyRepair; +import com.panzhihua.service_property.service.ComPropertyRepairService; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * (ComPropertyRepair)表控制层 + * + * @author makejava + * @since 2021-09-02 10:12:12 + */ +@RestController +@RequestMapping("comPropertyRepair") +public class ComPropertyRepairApi { + /** + * 服务对象 + */ + @Resource + private ComPropertyRepairService comPropertyRepairService; + + /** + * 分页查询所有数据 + * @return 所有数据 + */ + @PostMapping("queryAll") + public R selectAll(@RequestBody CommonPage commonPage) { + return this.comPropertyRepairService.pageList(commonPage); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public R selectOne(@PathVariable("id") Integer id) { + return this.comPropertyRepairService.selectDetail(id); + } + + /** + * 新增数据 + * + * @param comPropertyRepairVO 实体对象 + * @return 新增结果 + */ + @PostMapping + public R insert(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { + ComPropertyRepair comPropertyRepair=new ComPropertyRepair(); + if(comPropertyRepairVO!=null){ + BeanUtils.copyProperties(comPropertyRepairVO,comPropertyRepair); + } + return R.ok(this.comPropertyRepairService.save(comPropertyRepair)); + } + + /** + * 修改数据 + * + * @param comPropertyRepairVO 实体对象 + * @return 修改结果 + */ + @PostMapping("/update") + public R update(@RequestBody ComPropertyRepairVO comPropertyRepairVO) { + ComPropertyRepair comPropertyRepair=new ComPropertyRepair(); + if(comPropertyRepairVO!=null){ + BeanUtils.copyProperties(comPropertyRepairVO,comPropertyRepair); + } + return R.ok(this.comPropertyRepairService.updateById(comPropertyRepair)); + } + + /** + * 删除数据 + * + * @param id 主键结合 + * @return 删除结果 + */ + @GetMapping("del") + public R delete(@RequestParam("id") Long id) { + return R.ok(this.comPropertyRepairService.removeById(id)); + } + +} -- Gitblit v1.7.1