package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 推送设备 cid 绑定；{@link #userId} 含义由 {@link #ownerType} 决定。
 */
@Data
@JsonInclude
@TableName("life_user_push_device")
@ApiModel(value = "LifeUserPushDevice", description = "用户推送设备绑定")
public class LifeUserPushDevice implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "业务用户主键：owner_type=user 时为 life_user.id；store 为 store_user.id；lawyer 为 lawyer_user.id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty(value = "归属类型：user / store / lawyer（与 JWT userType 一致）")
    @TableField("owner_type")
    private String ownerType;

    @ApiModelProperty(value = "uni-push client id")
    @TableField("push_client_id")
    private String pushClientId;

    @ApiModelProperty(value = "平台：ios、android 等")
    @TableField("platform")
    private String platform;

    @ApiModelProperty(value = "DCloud appid，如 __UNI__xxxx")
    @TableField("dcloud_app_id")
    private String dcloudAppId;

    @ApiModelProperty(value = "创建时间")
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;
}
