package com.tax.token.model;

import com.yxcheng.token.utils.StringUtil;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TkUser {

    private Integer id;

    private String userName;

    private String serverNo;

    private String forceGetToken;

    private String isSyn;

    private String isCheckToken;

    private String defaultCleanType;

    private String showFlag;

    private String functionNo;

    private String zoneFlag;

    private String jsonFlag;

    private String toServerNo;

    public String getLastServerNo(String zoneCode) {
        String serverNo = getServerNo();
        if(StringUtil.isNotEmpty(getToServerNo())) {
            String[] serverNoConfigArr = getToServerNo().split(";");
            for(String serverNoConfig:serverNoConfigArr) {
                if(serverNoConfig.contains(zoneCode)) {
                    serverNo = serverNoConfig.split("=")[1];
                    break;
                }
            }
        }
        return serverNo;
    }

}