feat(img-files): 添加图片路径配置功能
parent
bfc8525bdb
commit
fa7643edd4
|
|
@ -87,5 +87,11 @@ public class ImgFilesController {
|
|||
imgFilesService.edit(imgFilesUpdateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("获取图片前缀地址")
|
||||
@GetMapping("/getImagePath")
|
||||
public SingleResponse<String> getImagePath() {
|
||||
return SingleResponse.of(imgFilesService.getImagePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.zcloud.basic.info.command.query;
|
|||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.basic.info.command.convertor.ImgFilesCoConvertor;
|
||||
import com.zcloud.basic.info.domain.config.CodeConfig;
|
||||
import com.zcloud.basic.info.domain.config.ImageConfig;
|
||||
import com.zcloud.basic.info.dto.ImgFilesAddCmd;
|
||||
import com.zcloud.basic.info.dto.ImgFilesPageQry;
|
||||
import com.zcloud.basic.info.dto.ImgFilesQryCmd;
|
||||
|
|
@ -11,6 +13,7 @@ import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
|||
import com.zcloud.basic.info.persistence.repository.ImgFilesRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -28,7 +31,10 @@ import java.util.Map;
|
|||
public class ImgFilesQueryExe {
|
||||
private final ImgFilesRepository imgFilesRepository;
|
||||
private final ImgFilesCoConvertor imgFilesCoConvertor;
|
||||
//image:
|
||||
// path: https://jpfz.qhdsafety.com/gbsFileTest/
|
||||
|
||||
private final ImageConfig imageConfig;
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
|
|
@ -53,5 +59,9 @@ public class ImgFilesQueryExe {
|
|||
List<ImgFilesCO> imgFilesCOList = imgFilesCoConvertor.converDOsToCOs(imgFilesDOList);
|
||||
return MultiResponse.of(imgFilesCOList);
|
||||
}
|
||||
|
||||
public String getImagePath() {
|
||||
return imageConfig.getPath();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,5 +66,10 @@ public class ImgFilesServiceImpl implements ImgFilesServiceI {
|
|||
public MultiResponse<ImgFilesCO> listAll(ImgFilesQryCmd imgFilesQryCmd) {
|
||||
return imgFilesQueryExe.executeList(imgFilesQryCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImagePath() {
|
||||
return imgFilesQueryExe.getImagePath();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,5 +28,7 @@ public interface ImgFilesServiceI {
|
|||
void removeBatch(Long[] ids);
|
||||
|
||||
MultiResponse<ImgFilesCO> listAll(ImgFilesQryCmd imgFilesQryCmd);
|
||||
|
||||
String getImagePath();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.zcloud.basic.info.domain.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "image")
|
||||
@Data
|
||||
public class ImageConfig {
|
||||
|
||||
private String path;
|
||||
}
|
||||
Loading…
Reference in New Issue