package com.se.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; 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.se.common.log.annotation.Log; import com.se.common.log.enums.BusinessType; import com.se.common.security.annotation.RequiresPermissions; import com.se.system.domain.SysSoft; import com.se.system.service.inte.ISysSoftService; import com.se.common.core.web.controller.BaseController; import com.se.common.core.web.domain.AjaxResult; import com.se.common.core.utils.poi.ExcelUtil; import com.se.common.core.web.page.TableDataInfo; /** * 软件Controller * * @author se * @date 2024-11-22 */ @RestController @RequestMapping("/soft") public class SysSoftController extends BaseController { @Autowired private ISysSoftService sysSoftService; /** * 查询软件列表 */ @RequiresPermissions("system:soft:list") @GetMapping("/list") public TableDataInfo list(SysSoft sysSoft) { startPage(); List list = sysSoftService.selectSysSoftList(sysSoft); return getDataTable(list); } /** * 导出软件列表 */ @RequiresPermissions("system:soft:export") @Log(title = "软件", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SysSoft sysSoft) { List list = sysSoftService.selectSysSoftList(sysSoft); ExcelUtil util = new ExcelUtil(SysSoft.class); util.exportExcel(response, list, "软件数据"); } /** * 获取软件详细信息 */ @RequiresPermissions("system:soft:query") @GetMapping(value = "/{softId}") public AjaxResult getInfo(@PathVariable("softId") Long softId) { return success(sysSoftService.selectSysSoftBySoftId(softId)); } /** * 新增软件 */ @RequiresPermissions("system:soft:add") @Log(title = "软件", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysSoft sysSoft) { return toAjax(sysSoftService.insertSysSoft(sysSoft)); } /** * 修改软件 */ @RequiresPermissions("system:soft:edit") @Log(title = "软件", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysSoft sysSoft) { return toAjax(sysSoftService.updateSysSoft(sysSoft)); } /** * 删除软件 */ @RequiresPermissions("system:soft:remove") @Log(title = "软件", businessType = BusinessType.DELETE) @DeleteMapping("/{softIds}") public AjaxResult remove(@PathVariable Long[] softIds) { return toAjax(sysSoftService.deleteSysSoftBySoftIds(softIds)); } }