| | |
| | | package cn.iocoder.yudao.module.infra.framework.file.core.client; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.common.util.http.HttpUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * 文件客户端的抽象类,提供模板方法,减少子类的冗余代码 |
| | | * |
| | | * @author 芋道源码 |
| | | * @author 超级管理员 |
| | | */ |
| | | @Slf4j |
| | | public abstract class AbstractFileClient<Config extends FileClientConfig> implements FileClient { |
| | |
| | | * @return URL 访问地址 |
| | | */ |
| | | protected String formatFileUrl(String domain, String path) { |
| | | return StrUtil.format("{}/admin-api/infra/file/{}/get/{}", domain, getId(), path); |
| | | return StrUtil.format("{}/admin-api/infra/file/{}/get/{}", domain, getId(), HttpUtils.encodeUrlPath(path)); |
| | | } |
| | | |
| | | } |