| package com.zy.asrs.common.sys.entity; | 
|   | 
| import com.baomidou.mybatisplus.annotation.IdType; | 
| import com.baomidou.mybatisplus.annotation.TableId; | 
| import com.baomidou.mybatisplus.annotation.TableName; | 
| import com.zy.asrs.common.sys.service.UserService; | 
| import com.zy.asrs.framework.common.Cools; | 
| import com.zy.asrs.framework.common.SpringUtils; | 
| import lombok.Data; | 
|   | 
| import java.io.Serializable; | 
| import java.text.SimpleDateFormat; | 
| import java.util.Date; | 
|   | 
| @Data | 
| @TableName("sys_operate_log") | 
| public class OperateLog implements Serializable { | 
|   | 
|     private static final long serialVersionUID = 1L; | 
|   | 
|     /** | 
|      * 编号 | 
|      */ | 
|     @TableId(value = "id", type = IdType.AUTO) | 
|     private Long id; | 
|   | 
|     /** | 
|      * 访问地址 | 
|      */ | 
|     private String action; | 
|   | 
|     /** | 
|      * 用户 | 
|      */ | 
|     private Long userId; | 
|   | 
|     /** | 
|      * 客户端IP | 
|      */ | 
|     private String ip; | 
|   | 
|     /** | 
|      * 请求数据 | 
|      */ | 
|     private String request; | 
|   | 
|     /** | 
|      * 响应数据 | 
|      */ | 
|     private String response; | 
|   | 
|     /** | 
|      * 添加时间 | 
|      */ | 
|     private Date createTime; | 
|   | 
|     /** | 
|      * 登录系统 | 
|      */ | 
|     private String system; | 
|   | 
|     public String getUserId$(){ | 
|         UserService service = SpringUtils.getBean(UserService.class); | 
|         User user = service.getById(this.userId); | 
|         if (!Cools.isEmpty(user)){ | 
|             return user.getUsername(); | 
|         } | 
|         return null; | 
|     } | 
|   | 
|     public String getCreateTime$(){ | 
|         if (Cools.isEmpty(this.createTime)){ | 
|             return ""; | 
|         } | 
|         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); | 
|     } | 
|   | 
| } |