默认使用minio 作为文件服务
This commit is contained in:
parent
d0e85a00f8
commit
494668ea37
30
publish.sh
30
publish.sh
|
|
@ -3,25 +3,25 @@
|
|||
# 使用方法: ./publish.sh 版本号.
|
||||
# git pull; git add . ;git commit -m " 发布版本 $*" ; git push
|
||||
|
||||
gradleArgs="clean publish -DbuildProduct=true -DreleaseVersion=$1 -DdevVersion=$1"
|
||||
gradleArgs=" -s clean publish -DbuildProduct=true -DreleaseVersion=$1 -DdevVersion=$1"
|
||||
|
||||
|
||||
# 发布公共模块,必须按照下列顺序 编译发布。
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-core/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-api/ruoyi-api-system/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-redis/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-security/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-log/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-datascope/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-swagger/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-core/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-api/ruoyi-api-system/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-redis/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-security/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-log/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-datascope/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-common/ruoyi-common-swagger/build.gradle
|
||||
|
||||
|
||||
### 六个 微服务依赖, monitor 不需要发布。
|
||||
gradle $gradleArgs -b ./ruoyi-auth/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-gateway/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-system/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-file/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-gen/build.gradle -s
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-job/build.gradle -s
|
||||
|
||||
gradle $gradleArgs -b ./ruoyi-auth/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-gateway/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-system/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-file/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-gen/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-modules/ruoyi-job/build.gradle
|
||||
gradle $gradleArgs -b ./ruoyi-visual/ruoyi-monitor/build.gradle
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
package com.ruoyi.system.api;
|
||||
|
||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.system.api.domain.SysFile;
|
||||
import com.ruoyi.system.api.factory.RemoteFileFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.system.api.domain.SysFile;
|
||||
import com.ruoyi.system.api.factory.RemoteFileFallbackFactory;
|
||||
|
||||
/**
|
||||
* 文件服务
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
||||
public interface RemoteFileService
|
||||
{
|
||||
public interface RemoteFileService {
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
|
|
@ -25,5 +24,5 @@ public interface RemoteFileService
|
|||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
|
||||
R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,24 @@
|
|||
package com.ruoyi.system.api.factory;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.system.api.RemoteFileService;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.system.api.RemoteFileService;
|
||||
import com.ruoyi.system.api.domain.SysFile;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
|
||||
/**
|
||||
* 文件服务降级处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService>
|
||||
{
|
||||
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteFileFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteFileService create(Throwable throwable)
|
||||
{
|
||||
public RemoteFileService create(Throwable throwable) {
|
||||
log.error("文件服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteFileService()
|
||||
{
|
||||
@Override
|
||||
public R<SysFile> upload(MultipartFile file)
|
||||
{
|
||||
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
return file -> R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
../../build-config/publish.sh
|
||||
Loading…
Reference in New Issue