package com.cpop.oam.business.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.cpop.common.utils.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

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

/**
 * @author DB
 * @createTime 2023/10/11 12:49
 * @description
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "OpenPlatformAuthorizerListVo拉取已授权的帐号信息")
public class WxOpenMiniVo implements Serializable {

    /**
     * 已授权帐号的 appid
     */
    @JSONField(name = "authorizer_appid")
    @ApiModelProperty("已授权帐号的 appid")
    private String authorizerAppid;
    /**
     * 刷新令牌authorizer_refresh_token
     */
    @JSONField(name = "refresh_token")
    @ApiModelProperty("刷新令牌authorizer_refresh_token")
    private String refreshToken;
    /**
     * 授权的时间
     */
    @JSONField(name = "auth_time")
    @ApiModelProperty("授权的时间")
    private String authTime;

    public void setAuthTime(Integer authTime) {
        Date date = new Date(authTime * 1000L);
        this.authTime = DateUtils.format(date, "yyyy-MM-dd HH:mm:ss");
    }

    /**
     * 小程序名称
     */
    @ApiModelProperty("小程序名称")
    private String nickName;
}
