fix(修改board信息字段controller):
This commit is contained in:
parent
daaea954f0
commit
f9589d5a90
|
@ -2,63 +2,97 @@ package com.ruoyi.web.controller.board;
|
|||
|
||||
import com.ruoyi.board.domain.BoardInfo;
|
||||
import com.ruoyi.board.service.BoardInfoService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 情报板信息(pub_board_info)表控制层
|
||||
* 情报板信息Controller
|
||||
*
|
||||
* @author fuhao
|
||||
* @author HueFu
|
||||
* @date 2024-08-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/board")
|
||||
public class BoardInfoController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
public class BoardInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private BoardInfoService boardInfoService;
|
||||
private BoardInfoService BoardInfoService;
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
* 查询情报板信息列表
|
||||
*/
|
||||
@GetMapping
|
||||
public BoardInfo selectOne(Integer id) {
|
||||
return boardInfoService.getById(id);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('board:info:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo methodsName() {
|
||||
public TableDataInfo list(BoardInfo BoardInfo)
|
||||
{
|
||||
startPage();
|
||||
List<BoardInfo> list = boardInfoService.list();
|
||||
List<BoardInfo> list = BoardInfoService.list();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出情报板信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:info:export')")
|
||||
@Log(title = "情报板信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BoardInfo BoardInfo)
|
||||
{
|
||||
List<BoardInfo> list = BoardInfoService.list();
|
||||
ExcelUtil<BoardInfo> util = new ExcelUtil<BoardInfo>(BoardInfo.class);
|
||||
util.exportExcel(response, list, "情报板信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取情报板信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(BoardInfoService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增情报板信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:info:add')")
|
||||
@Log(title = "情报板信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult addBoard(BoardInfo boardInfo){
|
||||
boardInfoService.save(boardInfo);
|
||||
return null;
|
||||
public AjaxResult add(@RequestBody BoardInfo BoardInfo)
|
||||
{
|
||||
return toAjax(BoardInfoService.save(BoardInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改情报板信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:info:edit')")
|
||||
@Log(title = "情报板信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult updateBoard(BoardInfo boardInfo){
|
||||
boardInfoService.updateById(boardInfo);
|
||||
return null;
|
||||
public AjaxResult edit(@RequestBody BoardInfo BoardInfo)
|
||||
{
|
||||
return toAjax(BoardInfoService.saveOrUpdate(BoardInfo));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public AjaxResult delBoard(BoardInfo boardInfo){
|
||||
boardInfoService.removeById(boardInfo);
|
||||
return null;
|
||||
/**
|
||||
* 删除情报板信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('board:info:remove')")
|
||||
@Log(title = "情报板信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable List<Long> ids)
|
||||
{
|
||||
return toAjax(BoardInfoService.removeByIds(ids));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue