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.IdcUseBase; import com.odcc.cpzidc.bis.service.IIdcUseBaseService; import com.odcc.cpzidc.common.utils.poi.ExcelUtil; import com.odcc.cpzidc.common.core.page.TableDataInfo; /** * 在用数据中心Controller * * @author ruoyi * @date 2024-10-10 */ @RestController @RequestMapping("/bis/useBase") public class IdcUseBaseController extends BaseController { @Autowired private IIdcUseBaseService idcUseBaseService; /** * 查询在用数据中心列表 */ @PreAuthorize("@ss.hasPermi('bis:useBase:list')") @GetMapping("/list") public TableDataInfo list(IdcUseBase idcUseBase) { startPage(); List list = idcUseBaseService.selectIdcUseBaseList(idcUseBase); return getDataTable(list); } /** * 导出在用数据中心列表 */ @PreAuthorize("@ss.hasPermi('bis:useBase:export')") @Log(title = "在用数据中心", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IdcUseBase idcUseBase) { List list = idcUseBaseService.selectIdcUseBaseList(idcUseBase); ExcelUtil util = new ExcelUtil(IdcUseBase.class); util.exportExcel(response, list, "在用数据中心数据"); } /** * 获取在用数据中心详细信息 */ @PreAuthorize("@ss.hasPermi('bis:useBase:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(idcUseBaseService.selectIdcUseBaseById(id)); } /** * 新增在用数据中心 */ @PreAuthorize("@ss.hasPermi('bis:useBase:add')") @Log(title = "在用数据中心", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IdcUseBase idcUseBase) { return toAjax(idcUseBaseService.insertIdcUseBase(idcUseBase)); } /** * 修改在用数据中心 */ @PreAuthorize("@ss.hasPermi('bis:useBase:edit')") @Log(title = "在用数据中心", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IdcUseBase idcUseBase) { return toAjax(idcUseBaseService.updateIdcUseBase(idcUseBase)); } /** * 删除在用数据中心 */ @PreAuthorize("@ss.hasPermi('bis:useBase:remove')") @Log(title = "在用数据中心", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(idcUseBaseService.deleteIdcUseBaseByIds(ids)); } }