1. 基本完成通知模块的迁移
This commit is contained in:
@@ -13,7 +13,7 @@ import java.util.Date;
|
||||
public class SysDeptRespVO extends SysDeptBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
public class SysDeptSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.Date;
|
||||
public class SysPostRespVO extends SysPostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位序号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
private Date createTime;
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
public class SysPostSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Date;
|
||||
public class SysDictDataRespVO extends SysDictDataBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典数据编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
private Date createTime;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Date;
|
||||
public class SysDictTypeRespVO extends SysDictTypeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "字典类型编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex")
|
||||
private String type;
|
||||
|
||||
@@ -1,64 +1,72 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.notice;
|
||||
|
||||
import cn.iocoder.dashboard.common.pojo.CommonResult;
|
||||
import cn.iocoder.dashboard.common.pojo.PageResult;
|
||||
import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeCreateReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticePageReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeRespVO;
|
||||
import cn.iocoder.dashboard.modules.system.controller.notice.vo.SysNoticeUpdateReqVO;
|
||||
import cn.iocoder.dashboard.modules.system.convert.notice.SysNoticeConvert;
|
||||
import cn.iocoder.dashboard.modules.system.service.notice.SysNoticeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.dashboard.common.pojo.CommonResult.success;
|
||||
|
||||
@Api(tags = "通知公告 API")
|
||||
@RestController
|
||||
@RequestMapping("/system/notice")
|
||||
public class SysNoticeController {
|
||||
|
||||
// /**
|
||||
// * 获取通知公告列表
|
||||
// */
|
||||
@Resource
|
||||
private SysNoticeService noticeService;
|
||||
|
||||
@ApiOperation("获取通知公告列表")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@ss.hasPermi('system:notice:list')")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list(SysNotice notice) {
|
||||
// startPage();
|
||||
// List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据通知公告编号获取详细信息
|
||||
// */
|
||||
public CommonResult<PageResult<SysNoticeRespVO>> pageNotices(@Validated SysNoticePageReqVO reqVO) {
|
||||
return success(SysNoticeConvert.INSTANCE.convertPage(noticeService.pageNotices(reqVO)));
|
||||
}
|
||||
|
||||
@ApiOperation("获得通知公告")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
// @PreAuthorize("@ss.hasPermi('system:notice:query')")
|
||||
// @GetMapping(value = "/{noticeId}")
|
||||
// public AjaxResult getInfo(@PathVariable Long noticeId) {
|
||||
// return AjaxResult.success(noticeService.selectNoticeById(noticeId));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增通知公告
|
||||
// */
|
||||
@GetMapping(value = "/get")
|
||||
public CommonResult<SysNoticeRespVO> getNotice(@RequestParam("id") Long id) {
|
||||
return success(SysNoticeConvert.INSTANCE.convert(noticeService.getNotice(id)));
|
||||
}
|
||||
|
||||
@ApiOperation("新增通知公告")
|
||||
// @PreAuthorize("@ss.hasPermi('system:notice:add')")
|
||||
// @Log(title = "通知公告", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
||||
// notice.setCreateBy(SecurityUtils.getUsername());
|
||||
// return toAjax(noticeService.insertNotice(notice));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改通知公告
|
||||
// */
|
||||
@PostMapping("/create")
|
||||
public CommonResult<Long> createNotice(@Validated @RequestBody SysNoticeCreateReqVO reqVO) {
|
||||
Long noticeId = noticeService.createNotice(reqVO);
|
||||
return success(noticeId);
|
||||
}
|
||||
|
||||
@ApiOperation("修改通知公告")
|
||||
// @PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||
// @Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
|
||||
// notice.setUpdateBy(SecurityUtils.getUsername());
|
||||
// return toAjax(noticeService.updateNotice(notice));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除通知公告
|
||||
// */
|
||||
@PostMapping("/update")
|
||||
public CommonResult<Boolean> updateNotice(@Validated @RequestBody SysNoticeUpdateReqVO reqVO) {
|
||||
noticeService.updateNotice(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("删除通知公告")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024", dataTypeClass = Long.class)
|
||||
// @PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
||||
// @Log(title = "通知公告", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{noticeIds}")
|
||||
// public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
||||
// return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||
// }
|
||||
@PostMapping("/delete")
|
||||
public CommonResult<Boolean> deleteNotice(@RequestParam("id") Long id) {
|
||||
noticeService.deleteNotice(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.notice.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 通知公告 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class SysNoticeBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "公告标题", required = true, example = "小博主")
|
||||
@NotBlank(message = "公告标题不能为空")
|
||||
@Size(max = 50, message = "公告标题不能超过50个字符")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "公告标题", required = true, example = "小博主")
|
||||
@NotNull(message = "公告类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "公告内容", required = true, example = "半生编码")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.notice.vo;
|
||||
|
||||
import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("通知公告创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysNoticeCreateReqVO extends SysPostBaseVO {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.notice.vo;
|
||||
|
||||
import cn.iocoder.dashboard.common.pojo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ApiModel("通知公告分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysNoticePageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "通知公告名称", example = "芋道", notes = "模糊匹配")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.notice.vo;
|
||||
|
||||
import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("通知公告信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysNoticeRespVO extends SysPostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "通知公告序号", required = true, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.notice.vo;
|
||||
|
||||
import cn.iocoder.dashboard.modules.system.controller.dept.vo.post.SysPostBaseVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("岗位公告更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysNoticeUpdateReqVO extends SysPostBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "岗位公告编号", required = true, example = "1024")
|
||||
@NotNull(message = "岗位公告编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import java.util.Date;
|
||||
public class SysMenuRespVO extends SysMenuBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "菜单编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
public class SysMenuSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "菜单编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Set;
|
||||
public class SysRoleRespVO extends SysRoleBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "角色编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 DataScopeEnum 枚举类")
|
||||
private Integer dataScope;
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
public class SysRoleSimpleRespVO {
|
||||
|
||||
@ApiModelProperty(value = "角色编号", required = true, example = "1024")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "角色名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SysUserPageItemRespVO extends SysUserRespVO {
|
||||
public static class Dept {
|
||||
|
||||
@ApiModelProperty(value = "部门编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "部门名称", required = true, example = "研发部")
|
||||
private String name;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Date;
|
||||
public class SysUserRespVO extends SysUserBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类")
|
||||
private Integer status;
|
||||
|
||||
Reference in New Issue
Block a user