package com.ruoyi.zongzhi.controller; import java.util.List; import io.swagger.annotations.Api; 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.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.zongzhi.domain.TcDengbaoSystem; import com.ruoyi.zongzhi.service.ITcDengbaoSystemService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 等保系统Controller * * @author ruoyi * @date 2023-08-10 */ @RestController @RequestMapping("/zongzhi/system") @Api(tags = " 等保系统") public class TcDengbaoSystemController extends BaseController { @Autowired private ITcDengbaoSystemService tcDengbaoSystemService; /** * 查询等保系统列表 */ @PreAuthorize("@ss.hasPermi('zongzhi:system:list')") @GetMapping("/list") public TableDataInfo list(TcDengbaoSystem tcDengbaoSystem) { startPage(); List list = tcDengbaoSystemService.selectTcDengbaoSystemList(tcDengbaoSystem); return getDataTable(list); } /** * 导出等保系统列表 */ @PreAuthorize("@ss.hasPermi('zongzhi:system:export')") @Log(title = "等保系统", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TcDengbaoSystem tcDengbaoSystem) { List list = tcDengbaoSystemService.selectTcDengbaoSystemList(tcDengbaoSystem); ExcelUtil util = new ExcelUtil(TcDengbaoSystem.class); util.exportExcel(response, list, "等保系统数据"); } /** * 获取等保系统详细信息 */ @PreAuthorize("@ss.hasPermi('zongzhi:system:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tcDengbaoSystemService.selectTcDengbaoSystemById(id)); } /** * 新增等保系统 */ @PreAuthorize("@ss.hasPermi('zongzhi:system:add')") @Log(title = "等保系统", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TcDengbaoSystem tcDengbaoSystem) { return toAjax(tcDengbaoSystemService.insertTcDengbaoSystem(tcDengbaoSystem)); } /** * 修改等保系统 */ @PreAuthorize("@ss.hasPermi('zongzhi:system:edit')") @Log(title = "等保系统", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TcDengbaoSystem tcDengbaoSystem) { return toAjax(tcDengbaoSystemService.updateTcDengbaoSystem(tcDengbaoSystem)); } /** * 删除等保系统 */ @PreAuthorize("@ss.hasPermi('zongzhi:system:remove')") @Log(title = "等保系统", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tcDengbaoSystemService.deleteTcDengbaoSystemByIds(ids)); } }