feat(情报板协议库控制器):
This commit is contained in:
parent
34e4bc3010
commit
1c2a8b9ca4
|
@ -0,0 +1,91 @@
|
|||
package com.ruoyi.web.controller.board;
|
||||
|
||||
import com.ruoyi.board.domain.BoardProtocol;
|
||||
import com.ruoyi.board.service.IBoardProtocolService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 情报板协议库Controller
|
||||
*
|
||||
* @author fuhao
|
||||
* @date 2024-09-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/board/protocol")
|
||||
public class BoardProtocolController extends BaseController {
|
||||
@Autowired
|
||||
private IBoardProtocolService boardProtocolService;
|
||||
|
||||
/**
|
||||
* 查询情报板协议库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BoardProtocol boardProtocol) {
|
||||
startPage();
|
||||
List<BoardProtocol> list = boardProtocolService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出情报板协议库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:export')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BoardProtocol boardProtocol) {
|
||||
List<BoardProtocol> list = boardProtocolService.list();
|
||||
ExcelUtil<BoardProtocol> util = new ExcelUtil<BoardProtocol>(BoardProtocol.class);
|
||||
util.exportExcel(response, list, "情报板协议库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取情报板协议库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(boardProtocolService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增情报板协议库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:add')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BoardProtocol boardProtocol) {
|
||||
return toAjax(boardProtocolService.save(boardProtocol));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改情报板协议库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:edit')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BoardProtocol boardProtocol) {
|
||||
return toAjax(boardProtocolService.saveOrUpdate(boardProtocol));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除情报板协议库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:protocol:remove')")
|
||||
@Log(title = "情报板协议库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(boardProtocolService.removeByIds(ids));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue