package com.ruoyi.dl.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ruoyi.task.DataAssembleUtil; 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.dl.domain.DlShebeixx; import com.ruoyi.dl.service.IDlShebeixxService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 设备信息Controller * * @author ruoyi * @date 2023-09-13 */ @RestController @RequestMapping("/dl/shebeixx") public class DlShebeixxController extends BaseController { @Autowired private IDlShebeixxService dlShebeixxService; /** * 查询设备信息列表 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:list')") @GetMapping("/list") public TableDataInfo list(DlShebeixx dlShebeixx) { startPage(); List list = dlShebeixxService.selectDlShebeixxList(dlShebeixx); return getDataTable(list); } /** * 发送设备信息详细信息 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:query')") @GetMapping(value = "/faSong") public AjaxResult faSong(){ DataAssembleUtil.AssembleBDZSBJBXX();//设备信息 return success(); } /** * 导出设备信息列表 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:export')") @Log(title = "设备信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DlShebeixx dlShebeixx) { List list = dlShebeixxService.selectDlShebeixxList(dlShebeixx); ExcelUtil util = new ExcelUtil(DlShebeixx.class); util.exportExcel(response, list, "设备信息数据"); } /** * 获取设备信息详细信息 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(dlShebeixxService.selectDlShebeixxById(id)); } /** * 新增设备信息 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:add')") @Log(title = "设备信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DlShebeixx dlShebeixx) { return toAjax(dlShebeixxService.insertDlShebeixx(dlShebeixx)); } /** * 修改设备信息 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:edit')") @Log(title = "设备信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DlShebeixx dlShebeixx) { return toAjax(dlShebeixxService.updateDlShebeixx(dlShebeixx)); } /** * 删除设备信息 */ @PreAuthorize("@ss.hasPermi('dl:shebeixx:remove')") @Log(title = "设备信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(dlShebeixxService.deleteDlShebeixxByIds(ids)); } }