| | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; |
| | | |
| | |
| | | private Long id; |
| | | |
| | | @NotBlank(message = "登录账号不能为空") |
| | | @Length(min = 2, message = "登录账号长度不正确") |
| | | @ApiModelProperty(value = "登录账号",required = true) |
| | | @TableField("username") |
| | | private String username; |
| | |
| | | private Long companyId; |
| | | |
| | | @NotBlank(message = "密码不能为空") |
| | | @Length(min = 2, message = "密码长度不正确") |
| | | @ApiModelProperty(value = "密码",required = true) |
| | | @TableField("password") |
| | | private String password; |
| | |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty("剩余课时(分)") |
| | | @TableField(exist = false) |
| | | private Long remainPeriod; |
| | | |
| | | @ApiModelProperty("父级账号名称") |
| | | @TableField(exist = false) |
| | | private String parentName; |
| | | |
| | | @TableField(exist = false) |
| | | private List<SysRole> roles; |
| | | |
| | | @ApiModelProperty("是否为管理员") |
| | | @TableField(exist = false) |
| | | private Boolean admin; |
| | | public boolean isAdmin() |
| | | { |
| | | return isAdmin(this.id); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long userId) |
| | | { |
| | | return userId != null && 1L == userId; |
| | | } |
| | | } |