初始化岗位模块

This commit is contained in:
YunaiV 2021-01-10 13:08:41 +08:00
parent f5b7142ab6
commit 855327de1a
9 changed files with 203 additions and 123 deletions

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}