|
@@ -1,100 +0,0 @@
|
|
|
-package cn.com.ty.lift.enterprise.custom.controller;
|
|
|
-
|
|
|
-
|
|
|
-import cn.com.ty.lift.enterprise.custom.dao.entity.PropertyCertificate;
|
|
|
-import cn.com.ty.lift.enterprise.custom.service.impl.PropertyCertificateServiceImpl;
|
|
|
-import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-//未使用
|
|
|
-//未使用
|
|
|
-//未使用
|
|
|
-//未使用
|
|
|
-
|
|
|
-//@RestController
|
|
|
-//@RequestMapping("/property-certificate")
|
|
|
-@AllArgsConstructor
|
|
|
-/**
|
|
|
- * @author wang-hai-cheng
|
|
|
- * @date 2019/11/27
|
|
|
- * @description
|
|
|
- * 物管安全证表 前端控制器
|
|
|
- */
|
|
|
-public class PropertyCertificateController {
|
|
|
- private final PropertyCertificateServiceImpl propertyCertificateService;
|
|
|
-
|
|
|
- @GetMapping("/page")
|
|
|
- /**
|
|
|
- * @description id顺序+分页物管安全证列表
|
|
|
- * @date 2019/11/27 11:33
|
|
|
- * @param [current, size]
|
|
|
- * @return cn.com.xwy.boot.web.dto.RestResponse
|
|
|
- */
|
|
|
- public RestResponse page(@RequestParam Integer current,@RequestParam Integer size) {
|
|
|
- Page<PropertyCertificate> page = new Page<>(current, size);
|
|
|
- return RestResponse.ok(propertyCertificateService.page(page), "1","查询成功");
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/{id}")
|
|
|
- /**
|
|
|
- * @description id查询物管安全证
|
|
|
- * @date 2019/11/27 12:18
|
|
|
- * @param [id]
|
|
|
- * @return cn.com.ty.lift.enterprise.custom.entity.PropertyCertificate
|
|
|
- */
|
|
|
- public RestResponse propertyCertificate(@PathVariable int id) {
|
|
|
- PropertyCertificate byId = propertyCertificateService.getById(id);
|
|
|
- if (null != byId) {
|
|
|
- return RestResponse.ok(byId, "1","查询成功");
|
|
|
- } else {
|
|
|
- return RestResponse.ok(null,"9","无数据");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("/save")
|
|
|
- /**
|
|
|
- * @description 新增物管安全证
|
|
|
- * @date 2019/11/27 12:21
|
|
|
- * @param [propertyCertificate]
|
|
|
- * @return cn.com.xwy.boot.web.dto.RestResponse
|
|
|
- */
|
|
|
- public RestResponse save(@RequestBody PropertyCertificate propertyCertificate) {
|
|
|
- if (propertyCertificateService.save(propertyCertificate)) {
|
|
|
- return RestResponse.ok(null,"1", "保存成功");
|
|
|
- } else {
|
|
|
- return RestResponse.ok(null,"0","保存失败");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("/update")
|
|
|
- /**
|
|
|
- * @description 根据id更新物管安全证信息
|
|
|
- * @date 2019/11/27 12:21
|
|
|
- * @param [propertyCertificate]
|
|
|
- * @return cn.com.xwy.boot.web.dto.RestResponse
|
|
|
- */
|
|
|
- public RestResponse update(@RequestBody PropertyCertificate propertyCertificate) {
|
|
|
- if (propertyCertificateService.updateById(propertyCertificate)) {
|
|
|
- return RestResponse.ok(null,"1", "更新成功");
|
|
|
- } else {
|
|
|
- return RestResponse.ok(null,"0","更新失败");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/delete")
|
|
|
- /**
|
|
|
- * @description 根据id删除物管安全证
|
|
|
- * @date 2019/11/27 12:22
|
|
|
- * @param [id]
|
|
|
- * @return cn.com.xwy.boot.web.dto.RestResponse
|
|
|
- */
|
|
|
- public RestResponse delete(@RequestParam int id) {
|
|
|
- if (propertyCertificateService.removeById(id)) {
|
|
|
- return RestResponse.ok(null, "1","删除成功");
|
|
|
- } else {
|
|
|
- return RestResponse.ok(null,"0","删除失败");
|
|
|
- }
|
|
|
- }
|
|
|
-}
|