package com.sysu.admin.utils.shape.geoserver;

import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author shu hao
 * @description:
 * @date 2021/12/23 9:28
 */
@Component
@ConfigurationProperties("geoserver")
public class GeoServerConfig {

    private static String user;
    private static String password;
    private static String url;
    private static String port;
    private static String path;

    public String getText(){
        StringBuffer stringBuffer = new StringBuffer(35);
        if(StringUtils.isNotBlank(url)) {
            stringBuffer.append(url);
            if(StringUtils.isNotBlank(port)) {
                stringBuffer.append(":").append(port);
            }
        }
        stringBuffer.append("/").append(path);
        return stringBuffer.toString();
    }


    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        GeoServerConfig.port = port;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        GeoServerConfig.path = path;
    }
}
