package com.cclotus.register.domain

import com.baomidou.mybatisplus.annotation.*
import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.annotation.JsonIgnore
import com.ruoyi.common.annotation.Excel
import java.time.LocalDate
import java.time.LocalDateTime
import java.util.*
import javax.validation.constraints.NotBlank

/**
 * 微信用户信息
 */
@TableName("wx_user")
open class WXUser {

    /**
     * 用户Id
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    var userId: String? = null

    /**
     * 姓名
     */
    @NotBlank(message = "用户姓名不可为空")
    @TableField("name")
    @Excel(name = "姓名")
    var name: String? = null

    /**
     * 本人图片
     */
    @TableField(value = "photo", updateStrategy = FieldStrategy.IGNORED)
    var photo: String? = null

    /**
     * 手机号
     */
    @TableField("phone")
    @NotBlank(message = "用户手机号不可为空")
    @Excel(name = "手机号码")
    var phone: String? = null

    /**
     * 出生日期
     */
    @TableField("birthday")
    var birthday: LocalDate? = null

    /**
     * 微信OpenId
     */
    @TableField("openid")
    @Excel(name = "微信openid")
    var openid: String? = null

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    var updateTime: LocalDateTime? = null

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Excel(name = "创建时间")
    var createTime: LocalDateTime? = null

    /**
     * 逻辑删除字段 0正常 1已注销
     */
    @TableField("deleted")
    var deleted: Int? = null

    /**
     * 推荐人ID
     */
    @TableField("referrer")
    var referrer: String? = null

    /**
     * 请求参数
     */
    @TableField(exist = false)
    var params: MutableMap<String, Any> = mutableMapOf()
    
}
