feat:修复已知问题,提升系统稳定性
This commit is contained in:
39
remi-boot/remi-boot-api/pom.xml
Normal file
39
remi-boot/remi-boot-api/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>remi-boot-api</artifactId>
|
||||
<name>remi-boot-api</name>
|
||||
<description>remi-boot-api</description>
|
||||
|
||||
<parent>
|
||||
<groupId>ai.remi.top.boot</groupId>
|
||||
<artifactId>remi-boot</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!--remi-comm-feign-->
|
||||
<dependency>
|
||||
<groupId>ai.remi.top.comm</groupId>
|
||||
<artifactId>remi-comm-feign</artifactId>
|
||||
</dependency>
|
||||
<!--remi-boot-domain-->
|
||||
<dependency>
|
||||
<groupId>ai.remi.top.boot</groupId>
|
||||
<artifactId>remi-boot-domain</artifactId>
|
||||
</dependency>
|
||||
<!--servlet-api-->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
<!--lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,31 @@
|
||||
package ai.remi.boot.api.client;
|
||||
|
||||
import ai.remi.comm.core.result.ResultBean;
|
||||
import ai.remi.comm.feign.aspect.FeignAutoConfiguration;
|
||||
import ai.remi.boot.api.factory.IamClientFactory;
|
||||
import ai.remi.boot.domain.dto.post.LogRecordPostDTO;
|
||||
import ai.remi.boot.domain.vo.ConfigVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(value = "remi-boot-web", configuration = FeignAutoConfiguration.class, fallbackFactory = IamClientFactory.class)
|
||||
public interface IamClientApi {
|
||||
|
||||
@Operation(summary = "保存日志")
|
||||
@PostMapping("/logRecord/add")
|
||||
ResultBean<Boolean> addLogRecord(@RequestBody @Validated LogRecordPostDTO logRecordDTO);
|
||||
|
||||
@Operation(summary = "查询用户全局配置")
|
||||
@PostMapping(value = "/config/getUserConfigs")
|
||||
ResultBean<List<ConfigVO>> getUserConfigs();
|
||||
|
||||
@Operation(summary = "查询应用全局配置")
|
||||
@PostMapping(value = "/config/getAppConfigs")
|
||||
ResultBean<List<ConfigVO>> getAppConfigs(@RequestParam("appId") String appId, @RequestParam("confType") Integer confType);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package ai.remi.boot.api.factory;
|
||||
|
||||
import ai.remi.boot.api.client.IamClientApi;
|
||||
import ai.remi.boot.api.fallback.IamClientFallback;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class IamClientFactory implements FallbackFactory<IamClientApi> {
|
||||
|
||||
@Override
|
||||
public IamClientApi create(Throwable cause) {
|
||||
IamClientFallback fallback = new IamClientFallback();
|
||||
fallback.setCause(cause);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package ai.remi.boot.api.fallback;
|
||||
|
||||
import ai.remi.comm.core.result.ResultBean;
|
||||
import ai.remi.boot.api.client.IamClientApi;
|
||||
import ai.remi.boot.domain.dto.post.LogRecordPostDTO;
|
||||
import ai.remi.boot.domain.vo.ConfigVO;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class IamClientFallback implements IamClientApi {
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public ResultBean<Boolean> addLogRecord(LogRecordPostDTO logRecordDTO) {
|
||||
log.error("addLogRecord = {}", cause.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<ConfigVO>> getUserConfigs() {
|
||||
log.error("getUserConfigs = {}", cause.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<ConfigVO>> getAppConfigs(String appId, Integer confType) {
|
||||
log.error("getAppConfigs = {}", cause.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user