|
@@ -0,0 +1,50 @@
|
|
|
+package com.sky.ioc.controller.data;
|
|
|
+
|
|
|
+import com.sky.ioc.entity.domain.data.Building;
|
|
|
+import com.sky.ioc.service.data.BuildingService;
|
|
|
+import com.sky.ioc.tool.ReturnMsg;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+@Api(tags = "数据管理--楼宇")
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequestMapping("/data")
|
|
|
+public class BuildingController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ BuildingService buildingService;
|
|
|
+
|
|
|
+ @ApiOperation("删除楼宇")
|
|
|
+ @DeleteMapping(value = "/building")
|
|
|
+ public ReturnMsg delBuilding(Integer id) {
|
|
|
+ return buildingService.delBuilding(id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("修改楼宇")
|
|
|
+ @PutMapping(value = "/building")
|
|
|
+ public ReturnMsg editBuilding(Building building) {
|
|
|
+ return buildingService.editBuilding(building);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("添加楼宇")
|
|
|
+ @PostMapping(value = "/building")
|
|
|
+ public ReturnMsg addBuilding(Building building) {
|
|
|
+ return buildingService.addBuilding(building);
|
|
|
+ }
|
|
|
+ @ApiOperation("获取楼宇详情")
|
|
|
+ @GetMapping(value = "/building")
|
|
|
+ public ReturnMsg getBuilding(Integer id) {
|
|
|
+ return buildingService.getById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取楼宇列表")
|
|
|
+ @GetMapping(value = "/building_list")
|
|
|
+ public ReturnMsg getBuildingList() {
|
|
|
+ return buildingService.getList();
|
|
|
+ }
|
|
|
+}
|