package com.xunhong.erp.turbo.api.user.dto.vo;

import com.alibaba.cola.dto.DTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xunhong.erp.turbo.api.user.dto.enums.UserStateEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * @author shenyifei
 */
@Data
@Schema(title = "用户信息")
@EqualsAndHashCode(callSuper = true)
public class UserVO extends DTO {

	/**
	 * 用户id
	 */
	@Schema(title = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	private Long userId;

	/**
	 * 昵称
	 */
	@Schema(title = "昵称", requiredMode = Schema.RequiredMode.REQUIRED)
	private String nickname;

	/**
	 * 头像
	 */
	@Schema(title = "头像", requiredMode = Schema.RequiredMode.REQUIRED)
	private String avatar;

	/**
	 * 姓名
	 */
	@Schema(title = "姓名", requiredMode = Schema.RequiredMode.REQUIRED)
	private String name;

	/**
	 * 性别
	 */
	@Schema(title = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
	private Integer gender;

	/**
	 * 生日
	 */
	@Schema(title = "生日", requiredMode = Schema.RequiredMode.REQUIRED)
	private String birthday;

	/**
	 * 手机号
	 */
//	@SensitiveStrategyPhone
	@Schema(title = "手机号", requiredMode = Schema.RequiredMode.REQUIRED)
	private String phone;

	/**
	 * 备注
	 */
	@Schema(title = "备注")
	private String remark;

	/**
	 * 状态 1.启用 2.禁用
	 */
	@Schema(title = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
	private UserStateEnum state;

	/**
	 * 是否是管理员 1.是 0.否
	 */
	@Schema(title = "是否是管理员", requiredMode = Schema.RequiredMode.REQUIRED)
	private Boolean isAdmin;

	/**
	 * 是否是小区合伙人 1.是 0.否
	 */
	@Schema(title = "是否是小区合伙人", requiredMode = Schema.RequiredMode.REQUIRED)
	private Boolean isPartner;

	@Schema(title = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	private LocalDateTime createdAt;

	/**
	 * 绑定手机号码时间
	 */
	@Schema(title = "绑定手机号码时间", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	private LocalDateTime bindPhoneAt;

	/**
	 * 最后一次登录时间
	 */
	@Schema(title = "最后一次登录时间", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	private LocalDateTime lastLoginAt;

	/**
	 * 微信公众号openid
	 */
	@Schema(title = "微信公众号openid", requiredMode = Schema.RequiredMode.REQUIRED)
	private String mpOpenid;

	/**
	 * 微信小程序openid
	 */
	@Schema(title = "微信小程序openid", requiredMode = Schema.RequiredMode.REQUIRED)
	private String maOpenid;

	/**
	 * 开放平台unionid
	 */
	@Schema(title = "开放平台unionid", requiredMode = Schema.RequiredMode.REQUIRED)
	private String unionid;
}
