feat(情报板类型定义后端接口生成):
This commit is contained in:
parent
3d9e72c4fa
commit
9482f87dc5
|
@ -0,0 +1,91 @@
|
||||||
|
package com.ruoyi.web.controller.board;
|
||||||
|
|
||||||
|
import com.ruoyi.board.domain.BoardType;
|
||||||
|
import com.ruoyi.board.service.IBoardTypeService;
|
||||||
|
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-03
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/board/boardType")
|
||||||
|
public class BoardTypeController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IBoardTypeService boardTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询情报板类型列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('board:boardType:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(BoardType boardType) {
|
||||||
|
startPage();
|
||||||
|
List<BoardType> list = boardTypeService.list();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出情报板类型列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('board:boardType:export')")
|
||||||
|
@Log(title = "情报板类型", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, BoardType boardType) {
|
||||||
|
List<BoardType> list = boardTypeService.list();
|
||||||
|
ExcelUtil<BoardType> util = new ExcelUtil<BoardType>(BoardType.class);
|
||||||
|
util.exportExcel(response, list, "情报板类型数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取情报板类型详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('board:boardType:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return success(boardTypeService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增情报板类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('board:boardType:add')")
|
||||||
|
@Log(title = "情报板类型", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody BoardType boardType) {
|
||||||
|
return toAjax(boardTypeService.save(boardType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改情报板类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('board:boardType:edit')")
|
||||||
|
@Log(title = "情报板类型", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody BoardType boardType) {
|
||||||
|
return toAjax(boardTypeService.saveOrUpdate(boardType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除情报板类型
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('board:boardType:remove')")
|
||||||
|
@Log(title = "情报板类型", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable List<Long> ids) {
|
||||||
|
return toAjax(boardTypeService.removeByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.ruoyi.board.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 情报板类型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName(value = "pub_board_type")
|
||||||
|
public class BoardType {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "`type`")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 尺寸
|
||||||
|
*/
|
||||||
|
@TableField(value = "`size`")
|
||||||
|
private String size;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.ruoyi.board.mapper;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.ruoyi.board.domain.BoardType;
|
||||||
|
|
||||||
|
public interface BoardTypeMapper extends MPJBaseMapper<BoardType> {
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.ruoyi.board.service;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseService;
|
||||||
|
import com.ruoyi.board.domain.BoardType;
|
||||||
|
|
||||||
|
public interface IBoardTypeService extends MPJBaseService<BoardType> {
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.ruoyi.board.service.impl;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||||
|
import com.ruoyi.board.domain.BoardType;
|
||||||
|
import com.ruoyi.board.mapper.BoardTypeMapper;
|
||||||
|
import com.ruoyi.board.service.IBoardTypeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BoardTypeServiceImpl extends MPJBaseServiceImpl<BoardTypeMapper, BoardType> implements IBoardTypeService {
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.board.mapper.BoardTypeMapper">
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue