新增数据接入模块远程调用与熔断,修改任务控制层请求路径
parent
42a47e197e
commit
a4028b4b36
|
@ -22,5 +22,10 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-core</artifactId>
|
<artifactId>cloud-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-quest-remote</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-quest-common</artifactId>
|
<artifactId>muyu-source-server</artifactId>
|
||||||
|
<version>3.6.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,26 @@
|
||||||
//package com.muyu.source.remote;
|
package com.muyu.quest.remote;
|
||||||
//
|
|
||||||
//import com.muyu.source.remote.factory.RemoteDataSourceFactory;
|
import com.muyu.common.core.domain.Result;
|
||||||
//import org.springframework.cloud.openfeign.FeignClient;
|
import com.muyu.quest.remote.factory.RemoteDataSourceFactory;
|
||||||
//import com.muyu.common.core.constant.ServiceNameConstants;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
//
|
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
///**
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
// * @ Tool:IntelliJ IDEA
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
// * @ Author:CHX
|
|
||||||
// * @ Date:2024-08-21-10:50
|
/**
|
||||||
// * @ Version:1.0
|
* @ Tool:IntelliJ IDEA
|
||||||
// * @ Description:数据源远程调用
|
* @ Author:CHX
|
||||||
// * @author Lenovo
|
* @ Date:2024-08-21-10:50
|
||||||
// */
|
* @ Version:1.0
|
||||||
//@FeignClient(contextId = "RemoteDataSourceService",value = ServiceNameConstants.SOURCE_SERVICE,fallbackFactory = RemoteDataSourceFactory.class, path = "/dataSource")
|
* @ Description:数据源远程调用
|
||||||
//public interface RemoteDataSourceService {
|
* @author Lenovo
|
||||||
//
|
*/
|
||||||
//}
|
@FeignClient(contextId = "RemoteDataSourceService",
|
||||||
|
value = ServiceNameConstants.SOURCE_SERVICE,
|
||||||
|
fallbackFactory = RemoteDataSourceFactory.class,
|
||||||
|
path = "/source")
|
||||||
|
public interface RemoteDataSourceService {
|
||||||
|
|
||||||
|
@PostMapping("/value/findTableValue")
|
||||||
|
public Result findTableValue(@RequestParam("basicId") Long basicId, @RequestParam("sql") String sql);
|
||||||
|
}
|
||||||
|
|
|
@ -1,19 +1,25 @@
|
||||||
//package com.muyu.source.remote.factory;
|
package com.muyu.quest.remote.factory;
|
||||||
//
|
|
||||||
//import com.muyu.source.remote.RemoteDataSourceService;
|
import com.muyu.common.core.domain.Result;
|
||||||
//import org.springframework.cloud.openfeign.FallbackFactory;
|
import com.muyu.quest.remote.RemoteDataSourceService;
|
||||||
//
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
///**
|
|
||||||
// * @ Tool:IntelliJ IDEA
|
/**
|
||||||
// * @ Author:CHX
|
* @ Tool:IntelliJ IDEA
|
||||||
// * @ Date:2024-08-21-10:54
|
* @ Author:CHX
|
||||||
// * @ Version:1.0
|
* @ Date:2024-08-21-10:54
|
||||||
// * @ Description:
|
* @ Version:1.0
|
||||||
// * @author Lenovo
|
* @ Description:
|
||||||
// */
|
* @author Lenovo
|
||||||
//public class RemoteDataSourceFactory implements FallbackFactory<RemoteDataSourceService> {
|
*/
|
||||||
// @Override
|
public class RemoteDataSourceFactory implements FallbackFactory<RemoteDataSourceService> {
|
||||||
// public RemoteDataSourceService create(Throwable cause) {
|
@Override
|
||||||
// return null;
|
public RemoteDataSourceService create(Throwable cause) {
|
||||||
// }
|
return new RemoteDataSourceService() {
|
||||||
//}
|
@Override
|
||||||
|
public Result findTableValue(Long basicId, String sql) {
|
||||||
|
return Result.error("数据接入模块连接失败,网络异常...");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
* @date 2024-08-22
|
* @date 2024-08-22
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/quest")
|
@RequestMapping("/task")
|
||||||
public class TaskController extends BaseController
|
public class TaskController extends BaseController
|
||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
|
|
Loading…
Reference in New Issue