Administrator
21 hours ago 65d83e255e4e1bdfb0336bea920d6c884c510711
src/main/java/cc/mrbird/febs/mall/controller/goods/AdminMallGoodsController.java
@@ -6,6 +6,7 @@
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.common.enumerates.DataDictionaryEnum;
import cc.mrbird.febs.common.exception.FebsException;
import cc.mrbird.febs.common.utils.FileUtil;
import cc.mrbird.febs.common.utils.OssUtils;
import cc.mrbird.febs.mall.dto.*;
@@ -45,6 +46,27 @@
    private final IAdminMallGoodsService adminMallGoodsService;
    private final DataDictionaryCustomMapper dataDictionaryCustomMapper;
    // 文件保存目录URL
    @Value("${static.resource.ai.common}")
    private String commonPath;
    // 文件保存目录URL
    @Value("${static.resource.ai.company}")
    private String companyPath;
    @ControllerEndpoint(operation = "文件上传服务器", exceptionMessage = "上传失败")
    @PostMapping(value = "/fileUploadEsc")
    public Map<String,Object> fileUploadEsc(@RequestBody @Validated MultipartFile file) throws IOException {
        if (file == null) {
            throw new FebsException("上传文件不能为空");
        }
        String path = commonPath;
        String companyId = getCurrentUserCompanyId();
        if (StrUtil.isNotEmpty(companyId)){
            path = companyPath + companyId;
        }
        return FileUtil.fileUploadEsc(file,null,path);
    }
//    /**
//     *  图片上传
//     * @return