From 2c51ea916c69b3c114b6564a4ed1ceac91fa35f8 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 04 十二月 2024 16:31:26 +0800 Subject: [PATCH] 修改启动异常 --- ruoyi-service/ruoyi-other/src/test/java/com/ruoyi/order/other/RuoYiOtherApplicationTests.java | 8 ++++++++ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java | 2 +- ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/TechnicianClientFallbackFactory.java | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletions(-) diff --git a/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/TechnicianClientFallbackFactory.java b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/TechnicianClientFallbackFactory.java new file mode 100644 index 0000000..3fc2995 --- /dev/null +++ b/ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/TechnicianClientFallbackFactory.java @@ -0,0 +1,23 @@ +package com.ruoyi.other.api.factory; + +import com.ruoyi.common.core.domain.R; +import com.ruoyi.other.api.domain.Technician; +import com.ruoyi.other.api.feignClient.TechnicianClient; +import org.springframework.cloud.openfeign.FallbackFactory; + +public class TechnicianClientFallbackFactory implements FallbackFactory<TechnicianClient> { + @Override + public TechnicianClient create(Throwable cause) { + return new TechnicianClient() { + @Override + public R<Technician> shopdetail(Integer techId) { + return R.fail("根据省市区获取地区价格配置失败:" + cause.getMessage()); + } + + @Override + public R<Void> updateStatus(Integer status, Integer subscribeId) { + return R.fail("跟新技师预约状态失败:" + cause.getMessage()); + } + }; + } +} diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java index 9fc9817..f94ab2c 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/config/DataUpdateHandlerConfig.java @@ -25,7 +25,7 @@ public class DataUpdateHandlerConfig implements MetaObjectHandler { @Autowired - private TokenService tokenService; + private TokenService tokenService; /** * 新增数据执行 diff --git a/ruoyi-service/ruoyi-other/src/test/java/com/ruoyi/order/other/RuoYiOtherApplicationTests.java b/ruoyi-service/ruoyi-other/src/test/java/com/ruoyi/order/other/RuoYiOtherApplicationTests.java new file mode 100644 index 0000000..23a13de --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/test/java/com/ruoyi/order/other/RuoYiOtherApplicationTests.java @@ -0,0 +1,8 @@ +package com.ruoyi.other; + +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = RuoYiOtherApplication.class) +public class RuoYiOtherApplicationTests { + +} -- Gitblit v1.7.1