package com.app.service.platform.dto;

import com.app.entity.platform.system.Dept;
import com.app.entity.platform.system.Job;
import com.app.entity.platform.system.Role;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Set;

/**
 * 功能描述：
 *
 * @Author 梁展鹏
 * @Date 2021/1/21 15:38
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class AccountDto {

    @ApiModelProperty(notes = "账号标识")
    private String id;

    @ApiModelProperty("是否删除")
    private Boolean isDel;

    @ApiModelProperty(notes = "昵称")
    private String nickname;

    @ApiModelProperty(notes = "头像")
    private String avatarUrl;

    @ApiModelProperty(notes = "用户性别（0未知、1男性、2女性）")
    private Integer gender;

    @ApiModelProperty(notes = "类型：1：平台、2：租户管理员、3：普通账号")
    private Integer type;

    @ApiModelProperty(notes = "密码修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime passwordFailureDateTime;

    @ApiModelProperty("开启时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startDateTime;

    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endDateTime;

    @ApiModelProperty("是否锁定")
    private Boolean isLocked;

    @ApiModelProperty("角色集合")
    private Set<Role> roleList;

    @ApiModelProperty("岗位集合")
    private Set<Job> jobList;

    @ApiModelProperty("部门")
    private Dept dept;

    /* 以下为登录后的字段信息 */

    @ApiModelProperty("操作ip")
    private String ip;

    @ApiModelProperty("操作ip地址")
    private String ipAddress;

    @ApiModelProperty("操作系统")
    private String os;

    @ApiModelProperty("浏览器")
    private String browser;

    @ApiModelProperty("浏览器版本号")
    private String browserVersion;

    @ApiModelProperty("登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime loginDateTime;

    @ApiModelProperty("token")
    private String token;

    @ApiModelProperty("refreshToken")
    private String refreshToken;

}
