package com.sunxung.factoring.entity.sys;

import com.sunxung.factoring.component.annotation.ObjectValidator;
import com.sunxung.factoring.entity.BaseEntity;

/**
 * @className:LoginLog
 * @description:系统登录日志实体类
 * @author:杜小姣
 * @e-mail:1261237207@qq.com
 * @date:2018年1月23日 上午10:35:18
 */
public class LoginLog extends BaseEntity {

    private static final long serialVersionUID = 1L;
    /** 登录名 **/
    private String loginName;
    /** 用户名 **/
    private String name;
    /** 用户ID **/
    private Long userId;
    /** 访问ip **/
    private String accessIp;
    /** 日志类型 **/
    @ObjectValidator(message = "日志类型不能为空！")
    private Dictionary logType;
    /** 备注 **/
    private String remark;

    public LoginLog(){
    }

    public LoginLog(User user, String accessIp){
        this.loginName = user.getLoginName();
        this.name = user.getName();
        this.userId = user.getId();
        this.accessIp = accessIp;
    }

    public LoginLog(User user){
        this.loginName = user.getLoginName();
        this.name = user.getName();
        this.userId = user.getId();
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAccessIp() {
        return accessIp;
    }

    public void setAccessIp(String accessIp) {
        this.accessIp = accessIp;
    }

    public Dictionary getLogType() {
        return logType;
    }

    public void setLogType(Dictionary logType) {
        this.logType = logType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
