diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java deleted file mode 100644 index 1e7556b8d..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.ruoyi.system.domain; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.annotation.Excel.ColumnType; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 岗位表 sys_post - * - * @author ruoyi - */ -public class SysPost extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 岗位序号 */ - @Excel(name = "岗位序号", cellType = ColumnType.NUMERIC) - private Long postId; - - /** 岗位编码 */ - @Excel(name = "岗位编码") - private String postCode; - - /** 岗位名称 */ - @Excel(name = "岗位名称") - private String postName; - - /** 岗位排序 */ - @Excel(name = "岗位排序") - private String postSort; - - /** 状态(0正常 1停用) */ - @Excel(name = "状态", readConverterExp = "0=正常,1=停用") - private String status; - - /** 用户是否存在此岗位标识 默认不存在 */ - private boolean flag = false; - - public Long getPostId() - { - return postId; - } - - public void setPostId(Long postId) - { - this.postId = postId; - } - - @NotBlank(message = "岗位编码不能为空") - @Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符") - public String getPostCode() - { - return postCode; - } - - public void setPostCode(String postCode) - { - this.postCode = postCode; - } - - @NotBlank(message = "岗位名称不能为空") - @Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符") - public String getPostName() - { - return postName; - } - - public void setPostName(String postName) - { - this.postName = postName; - } - - @NotBlank(message = "显示顺序不能为空") - public String getPostSort() - { - return postSort; - } - - public void setPostSort(String postSort) - { - this.postSort = postSort; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - public boolean isFlag() - { - return flag; - } - - public void setFlag(boolean flag) - { - this.flag = flag; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("postId", getPostId()) - .append("postCode", getPostCode()) - .append("postName", getPostName()) - .append("postSort", getPostSort()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java new file mode 100644 index 000000000..7bd632e4b --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostBaseVO.java @@ -0,0 +1,33 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * 岗位 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class SysPostBaseVO { + + @ApiModelProperty(value = "岗位名称", required = true, example = "小博主") + @NotBlank(message = "岗位名称不能为空") + @Size(max = 50, message = "岗位名称长度不能超过50个字符") + private String name; + + @ApiModelProperty(value = "岗位编码", required = true, example = "yudao") + @NotBlank(message = "岗位编码不能为空") + @Size(max = 64, message = "岗位编码长度不能超过64个字符") + private String code; + + @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") + @NotBlank(message = "显示顺序不能为空") + private String sort; + + @ApiModelProperty(value = "备注", example = "快乐的备注") + private String remark; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostCreateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostCreateReqVO.java new file mode 100644 index 000000000..a4bd9006b --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostCreateReqVO.java @@ -0,0 +1,11 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@ApiModel("岗位创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +public class SysPostCreateReqVO extends SysPostBaseVO { +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelRespVO.java new file mode 100644 index 000000000..ec3ffe133 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostExcelRespVO.java @@ -0,0 +1,27 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +import cn.iocoder.dashboard.framework.excel.Excel; +import lombok.Data; + +/** + * 岗位 Excel 导出响应 VO + */ +@Data +public class SysPostExcelRespVO { + + @Excel(name = "岗位序号", cellType = Excel.ColumnType.NUMERIC) + private Long id; + + @Excel(name = "岗位编码") + private String code; + + @Excel(name = "岗位名称") + private String name; + + @Excel(name = "岗位排序") + private String sort; + + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private String status; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostListReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostListReqVO.java new file mode 100644 index 000000000..223fa2021 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostListReqVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +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 SysPostListReqVO extends SysPostBaseVO { + + @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") + private String name; + + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + private Integer status; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostRespVO.java new file mode 100644 index 000000000..1269b7e55 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostRespVO.java @@ -0,0 +1,24 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +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 SysPostRespVO extends SysPostBaseVO { + + @ApiModelProperty(value = "岗位序号", required = true, example = "1024") + private Integer id; + + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + private Integer status; + + @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + private Date createTime; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostSimpleRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostSimpleRespVO.java new file mode 100644 index 000000000..a24299569 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostSimpleRespVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@ApiModel("岗位精简信息 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SysPostSimpleRespVO { + + @ApiModelProperty(value = "岗位编号", required = true, example = "1024") + private Integer id; + + @ApiModelProperty(value = "岗位名称", required = true, example = "芋道") + private String name; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostUpdateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostUpdateReqVO.java new file mode 100644 index 000000000..8e9e021bc --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dept/vo/post/SysPostUpdateReqVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; + +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 SysPostUpdateReqVO extends SysPostBaseVO { + + @ApiModelProperty(value = "岗位编号", required = true, example = "1024") + @NotNull(message = "岗位编号不能为空") + private Integer id; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dept/SysPostDO.java b/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dept/SysPostDO.java new file mode 100644 index 000000000..088fa7791 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dept/SysPostDO.java @@ -0,0 +1,49 @@ +package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dept; + +import cn.iocoder.dashboard.common.enums.CommonStatusEnum; +import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 岗位表 + * + * @author ruoyi + */ +@TableName("sys_post") +@Data +@EqualsAndHashCode(callSuper = true) +public class SysPostDO extends BaseDO { + + /** + * 岗位序号 + */ + @TableId + private Long id; + + /** + * 岗位名称 + */ + private String name; + /** + * 岗位编码 + */ + private String code; + /** + * 岗位排序 + */ + private String sort; + /** + * 状态 + * + * 枚举 {@link CommonStatusEnum} + */ + private String status; + /** + * 备注 + */ + private String remark; + +}