package com.xunmei.system.api; import com.xunmei.common.core.constant.ServiceNameConstants; import com.xunmei.common.core.domain.R; import com.xunmei.system.api.domain.SysFile; import com.xunmei.system.api.factory.RemoteFileFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.Map; /** * 文件服务 * * @author xunmei */ @FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class) public interface RemoteFileService { /** * 上传文件 * * @param file 文件信息 * @return 结果 */ @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public R upload(@RequestPart(value = "file") MultipartFile file); /** * 生成教育培训登记簿 * * @param data 文件信息 * @param cacheDir 缓存目录 * @return 结果 */ @PostMapping(value = "/file/generateEduTrainingPdf") R generateEduTrainingPdf(@RequestBody Map data); /** * 获取本地存储路径前缀 * * @return 结果 */ @GetMapping(value = "/file/getLocalPathPrefix") String getLocalPathPrefix(); /** * 获取nginx静态目录前缀 * * @return 结果 */ @GetMapping(value = "/file/getStaticPathPrefix") String getStaticPathPrefix(); }