package com.yutou.biliapi.bean.login;

import com.alibaba.fastjson2.annotation.JSONField;
import com.yutou.common.databases.AbsDatabasesBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class LoginCookieDatabaseBean extends AbsDatabasesBean {

    @JSONField(name = "SESSDATA")
    String sessdta;
    @JSONField(name = "Path")
    String path;
    @JSONField(name = "DedeUserID")
    String dedeUserID;
    @JSONField(name = "DedeUserID__ckMd5")
    String dedeUserIDCkMd5;
    @JSONField(name = "bili_jct")
    String biliJct;
    @JSONField(name = "Expires")
    String expires;
    @JSONField(name = "Domain")
    String domain;
    @JSONField(name = "sid")
    String sid;
    @JSONField(name = "gourl")
    String gourl;
    @JSONField(name ="refresh_token")
    String refreshToken;

    public LoginCookieDatabaseBean() {
        super("login_cookie", System.currentTimeMillis());
    }

    public String toCookieString() {
        return "SESSDATA=" + sessdta + "; Path=" + path + "; DedeUserID=" + dedeUserID + "; DedeUserID__ckMd5=" + dedeUserIDCkMd5 + "; bili_jct=" + biliJct + "; Expires=" + expires + "; Domain=" + domain + "; sid=" + sid;
    }
}
