package com.cpop.oam.business.vo;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

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

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

    public void setAuthTime(Integer authTime) {
        this.authTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

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