package com.ard.work.point.tower.controller; import java.util.List; import java.io.IOException; import jakarta.servlet.http.HttpServletResponse; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ard.common.log.annotation.Log; import com.ard.common.log.enums.BusinessType; import com.ard.common.security.annotation.RequiresPermissions; import com.ard.work.point.tower.domain.ArdTower; import com.ard.work.point.tower.service.IArdTowerService; import com.ard.common.core.web.controller.BaseController; import com.ard.common.core.web.domain.AjaxResult; import com.ard.common.core.utils.poi.ExcelUtil; import com.ard.common.core.web.page.TableDataInfo; /** * 塔管理Controller * * @author ruoyi * @date 2024-09-07 */ @Tag(name = "塔管理") @RestController @RequestMapping("/tower") public class ArdTowerController extends BaseController { @Autowired private IArdTowerService ardTowerService; /** * 查询塔管理列表 */ @Operation(summary = "查询塔管理列表") @RequiresPermissions("point:tower:list") @GetMapping("/list") public TableDataInfo list(ArdTower ardTower) { startPage(); List list = ardTowerService.selectArdTowerList(ardTower); return getDataTable(list); } /** * 导出塔管理列表 */ @Operation(summary = "导出塔管理列表") @RequiresPermissions("point:tower:export") @Log(title = "塔管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdTower ardTower) { List list = ardTowerService.selectArdTowerList(ardTower); ExcelUtil util = new ExcelUtil(ArdTower.class); util.exportExcel(response, list, "塔管理数据"); } /** * 获取塔管理详细信息 */ @Operation(summary = "获取塔管理详细信息") @RequiresPermissions("point:tower:query") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(ardTowerService.selectArdTowerById(id)); } /** * 新增塔管理 */ @Operation(summary = "新增塔管理") @RequiresPermissions("point:tower:add") @Log(title = "塔管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ArdTower ardTower) { return toAjax(ardTowerService.insertArdTower(ardTower)); } /** * 修改塔管理 */ @Operation(summary = "修改塔管理") @RequiresPermissions("point:tower:edit") @Log(title = "塔管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ArdTower ardTower) { return toAjax(ardTowerService.updateArdTower(ardTower)); } /** * 删除塔管理 */ @Operation(summary = "删除塔管理") @RequiresPermissions("point:tower:remove") @Log(title = "塔管理", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(ardTowerService.deleteArdTowerByIds(ids)); } }