package net.yyc.common.taxhelper.entity.model;

import net.yyc.common.taxhelper.common.CommonConstants;
import net.yyc.common.taxhelper.config.TaxHelperConfig;
import lombok.Getter;

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

/**
 * {@code TaxHelperLoginModel} 登录model
 *
 * @author Hengchen.Sun
 * @version 1.0.0
 * @date 2021-02-22
 * @since ver.1.0.0
 */
@Getter
public class TaxHelperLoginModel extends TaxHelperModel {

	private static final long serialVersionUID = -1575146161143142084L;

	/**
	 * 登录时间
	 */
	private final String time;

	/**
	 * query url
	 */
	private final String queryUrl;

	public TaxHelperLoginModel(TaxHelperConfig taxHelperConfig) {
		this.appId = taxHelperConfig.getAppId();
		this.queryUrl = taxHelperConfig.getQueryUrl();
		this.appSecrete = taxHelperConfig.getAppSecrete();
		DateTimeFormatter df = DateTimeFormatter.ofPattern(CommonConstants.LOGIN_DATE_TIME_FORMAT_PATTERN);
		this.time = df.format(LocalDateTime.now());
	}

}
