feat: 初始化

This commit is contained in:
2024-04-09 11:34:46 +08:00
commit 39f3acc15f
3209 changed files with 253442 additions and 0 deletions
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>febs-server-job</artifactId>
<groupId>com.yida.data.job</groupId>
<version>2.2-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>febs-server-job-api</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>
@@ -0,0 +1,41 @@
package com.yida.data.job.fallback;
import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.job.Job;
import com.yida.data.job.feign.RemoteJobService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
/**
* RemoteJobService fallback处理类
*
* @author ZYJ
* @date 2022/8/26
*/
@Slf4j
@Fallback
public class RemoteJobServiceFallback implements FallbackFactory<RemoteJobService> {
@Override
public RemoteJobService create(Throwable throwable) {
log.error("RemoteJobService fallback reason:{}", throwable.getMessage());
return new RemoteJobService() {
@Override
public ResultBean saveJob(Job job) {
return null;
}
@Override
public ResultBean saveJobNoPermission(Job job) {
return null;
}
@Override
public ResultBean delJobByMethod(String beanName, String methodName, String params) {
return null;
}
};
}
}
@@ -0,0 +1,28 @@
package com.yida.data.job.feign;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.constant.FebsServerConstant;
import com.yida.data.common.core.entity.job.Job;
import com.yida.data.job.fallback.RemoteJobServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestParam;
@FeignClient(value = FebsServerConstant.FEBS_SERVER_JOB, contextId = "jobServiceClient",
fallbackFactory = RemoteJobServiceFallback.class)
public interface RemoteJobService {
@PostMapping
ResultBean saveJob(@RequestBody Job job);
@PostMapping("in/job/saveJobNoPermission")
ResultBean saveJobNoPermission(@RequestBody Job job);
@GetMapping("/delJobByMethod")
ResultBean delJobByMethod(@RequestParam("beanName") String beanName,
@RequestParam("methodName") String methodName,
@RequestParam("params") String params);
}
@@ -0,0 +1,3 @@
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yida.data.job.fallback.RemoteJobServiceFallback