| package com.zy.system.entity; | 
|   | 
| import com.baomidou.mybatisplus.annotations.TableField; | 
| import com.baomidou.mybatisplus.annotations.TableId; | 
| import com.baomidou.mybatisplus.annotations.TableName; | 
| import com.baomidou.mybatisplus.enums.IdType; | 
| import com.zy.system.service.UserService; | 
| import com.core.common.Cools; | 
| import com.core.common.SpringUtils; | 
|   | 
| import java.io.Serializable; | 
| import java.text.SimpleDateFormat; | 
| import java.util.Date; | 
|   | 
| @TableName("sys_user_login") | 
| public class UserLogin implements Serializable { | 
|   | 
|     private static final long serialVersionUID = 1L; | 
|   | 
|     /** | 
|      * 编号 | 
|      */ | 
|     @TableId(value = "id", type = IdType.AUTO) | 
|     private Long id; | 
|   | 
|     /** | 
|      * 员工 | 
|      */ | 
|     @TableField("user_id") | 
|     private Long userId; | 
|   | 
|     /** | 
|      * 凭证值 | 
|      */ | 
|     private String token; | 
|   | 
|     /** | 
|      * 添加时间 | 
|      */ | 
|     @TableField("create_time") | 
|     private Date createTime; | 
|   | 
|     public Long getId() { | 
|         return id; | 
|     } | 
|   | 
|     public void setId(Long id) { | 
|         this.id = id; | 
|     } | 
|   | 
|     public Long getUserId() { | 
|         return userId; | 
|     } | 
|   | 
|     public String getUserUsername(){ | 
|         UserService service = SpringUtils.getBean(UserService.class); | 
|         User user = service.selectById(this.userId); | 
|         if (!Cools.isEmpty(user)){ | 
|             return user.getUsername(); | 
|         } | 
|         return null; | 
|     } | 
|     public void setUserId(Long userId) { | 
|         this.userId = userId; | 
|     } | 
|   | 
|     public String getToken() { | 
|         return token; | 
|     } | 
|   | 
|     public void setToken(String token) { | 
|         this.token = token; | 
|     } | 
|   | 
|     public Date getCreateTime() { | 
|         return createTime; | 
|     } | 
|   | 
|     public String getCreateTime$(){ | 
|         if (Cools.isEmpty(this.createTime)){ | 
|             return ""; | 
|         } | 
|         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); | 
|     } | 
|   | 
|     public void setCreateTime(Date createTime) { | 
|         this.createTime = createTime; | 
|     } | 
|   | 
|   | 
| } |