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
+27
View File
@@ -0,0 +1,27 @@
<?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>edu-auth</artifactId>
<groupId>com.yida.data.auth</groupId>
<version>2.2-RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>edu-auth-api</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.yida.data</groupId>
<artifactId>febs-common-core</artifactId>
<version>2.2-RELEASE</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,20 @@
package com.yida.data.auth;
import com.yida.data.common.core.entity.constant.FebsServerConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(value = FebsServerConstant.EDU_AUTH, contextId = "authServiceClient",
fallbackFactory = RemoteAuthServiceFallback.class)
public interface RemoteAuthService {
/**
* 撤销认证
*
* @param userName
* @param clientId
*/
@GetMapping("/in/security/revokeApproval")
void revokeApproval(@RequestParam("userName") String userName, @RequestParam("clientId") String clientId);
}
@@ -0,0 +1,34 @@
package com.yida.data.auth;
import com.yida.data.common.core.annotation.Fallback;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
/**
* RemoteAuthService fallback处理类
*
* @author ZYJ
* @date 2022/8/26
*/
@Slf4j
@Fallback
public class RemoteAuthServiceFallback implements FallbackFactory<RemoteAuthService> {
@Override
public RemoteAuthService create(Throwable throwable) {
log.error("RemoteAuthService fallback reason:{}", throwable.getMessage());
return new RemoteAuthService() {
/**
* 撤销认证
*
* @param userName
* @param clientId
*/
@Override
public void revokeApproval(String userName, String clientId) {
}
};
}
}
@@ -0,0 +1,3 @@
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yida.data.auth.RemoteAuthServiceFallback