| | |
| | | package com.zy.asrs.wcs.sys.entity; |
| | | |
| | | 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 com.zy.asrs.framework.common.Cools; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class User implements Serializable { |
| | | public class User implements Serializable, UserDetails { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Role> roles; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Menu> authorities; |
| | | |
| | | public User() {} |
| | | |
| | | public User(String username,String password,String nickname,String avatar,String code,Integer sex,String phone,String email,Integer emailVerified,Long deptId,String realName,String idCard,String birthday,String introduction,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { |
| | |
| | | DeptService service = SpringUtils.getBean(DeptService.class); |
| | | Dept dept = service.getById(this.deptId); |
| | | if (!Cools.isEmpty(dept)){ |
| | | return String.valueOf(dept.getId()); |
| | | return String.valueOf(dept.getName()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.getById(this.hostId); |
| | | if (!Cools.isEmpty(host)){ |
| | | return String.valueOf(host.getId()); |
| | | return String.valueOf(host.getName()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isAccountNonExpired() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isAccountNonLocked() { |
| | | return this.status != null && this.status == 1; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isCredentialsNonExpired() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isEnabled() { |
| | | return true; |
| | | } |
| | | |
| | | } |