package com.sckw.payment.model.dto;

import com.sckw.core.common.enums.StringConstant;
import com.sckw.core.utils.FileUtils;
import org.apache.commons.lang3.StringUtils;

/**
 * @author xucaiqin
 * @date 2023-09-27 16:03:02
 */
public interface SpliceUrl {

    String getUrl();

    void setUrl(String url);

    /**
     * 拼接地址前缀
     */
    default void appendPrefix() {
        String s = getUrl();
        if (StringUtils.isNotBlank(s) && !StringUtils.startsWith(s, StringConstant.HTTP_STRING)) {
            setUrl(FileUtils.getOSSAddressPrefix() + s);
        }
    }
}
