package com.odcc.cpzidc.web.controller.bis; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; 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.odcc.cpzidc.common.annotation.Log; import com.odcc.cpzidc.common.core.controller.BaseController; import com.odcc.cpzidc.common.core.domain.AjaxResult; import com.odcc.cpzidc.common.enums.BusinessType; import com.odcc.cpzidc.bis.domain.IdcNoIndex; import com.odcc.cpzidc.bis.service.IIdcNoIndexService; import com.odcc.cpzidc.common.utils.poi.ExcelUtil; import com.odcc.cpzidc.common.core.page.TableDataInfo; /** * IDC编号索引Controller * * @author ruoyi * @date 2024-10-09 */ @RestController @RequestMapping("/bis/idcNoIndex") public class IdcNoIndexController extends BaseController { @Autowired private IIdcNoIndexService idcNoIndexService; /** * 查询IDC编号索引列表 */ @PreAuthorize("@ss.hasPermi('bis:idcNoIndex:list')") @GetMapping("/list") public TableDataInfo list(IdcNoIndex idcNoIndex) { startPage(); List list = idcNoIndexService.selectIdcNoIndexList(idcNoIndex); return getDataTable(list); } /** * 导出IDC编号索引列表 */ @PreAuthorize("@ss.hasPermi('bis:idcNoIndex:export')") @Log(title = "IDC编号索引", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IdcNoIndex idcNoIndex) { List list = idcNoIndexService.selectIdcNoIndexList(idcNoIndex); ExcelUtil util = new ExcelUtil(IdcNoIndex.class); util.exportExcel(response, list, "IDC编号索引数据"); } /** * 获取IDC编号索引详细信息 */ @PreAuthorize("@ss.hasPermi('bis:idcNoIndex:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(idcNoIndexService.selectIdcNoIndexById(id)); } /** * 新增IDC编号索引 */ @PreAuthorize("@ss.hasPermi('bis:idcNoIndex:add')") @Log(title = "IDC编号索引", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IdcNoIndex idcNoIndex) { return toAjax(idcNoIndexService.insertIdcNoIndex(idcNoIndex)); } /** * 修改IDC编号索引 */ @PreAuthorize("@ss.hasPermi('bis:idcNoIndex:edit')") @Log(title = "IDC编号索引", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IdcNoIndex idcNoIndex) { return toAjax(idcNoIndexService.updateIdcNoIndex(idcNoIndex)); } /** * 删除IDC编号索引 */ @PreAuthorize("@ss.hasPermi('bis:idcNoIndex:remove')") @Log(title = "IDC编号索引", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(idcNoIndexService.deleteIdcNoIndexByIds(ids)); } }