redis连接参数设置
parent
b760cc7927
commit
a0c15e85e6
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="file://$PROJECT_DIR$/etl-cleaning/src/main/java/com/etl/cleaning/server/ServerTest.java" dialect="GenericSQL" />
|
||||
<file url="file://$PROJECT_DIR$/etl-cleaning/src/main/java/com/etl/cleaning/server/MysqlServerTest.java" dialect="GenericSQL" />
|
||||
</component>
|
||||
</project>
|
File diff suppressed because one or more lines are too long
|
@ -19,6 +19,12 @@
|
|||
<spring-boot.version>2.6.13</spring-boot.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- Jedis -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>3.7.0</version> <!-- 请检查并使用最新版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.anji-plus</groupId>
|
||||
<artifactId>spring-boot-starter-captcha</artifactId>
|
||||
|
|
|
@ -8,7 +8,6 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -44,7 +43,7 @@ public class DataPlace {
|
|||
/**
|
||||
* 链接状态
|
||||
*/
|
||||
private Boolean statue;
|
||||
private Long statue;
|
||||
/**
|
||||
* 连接类型
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,7 @@ public class InsertPlaceRequest {
|
|||
/**
|
||||
* 链接状态
|
||||
*/
|
||||
private Boolean statue;
|
||||
private Long statue;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.etl.cleaning.domian.request;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* redis链接参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class RedisRequest {
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
private String itemUsername;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
private String itemPass;
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
@NotBlank(message = "端口号不能为空")
|
||||
private String itemPort;
|
||||
/**
|
||||
* 连接数据库名称
|
||||
*/
|
||||
@NotBlank(message = "数据库名称不能为空")
|
||||
private String itemName;
|
||||
/**
|
||||
* 连接地址
|
||||
*/
|
||||
@NotBlank(message = "链接地址不能为空")
|
||||
private String place;
|
||||
}
|
|
@ -27,7 +27,7 @@ public class PlaceResponse {
|
|||
/**
|
||||
* 链接状态
|
||||
*/
|
||||
private Boolean statue;
|
||||
private Long statue;
|
||||
/**
|
||||
* 连接类型
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
|||
/**
|
||||
* mysql测试连接
|
||||
*/
|
||||
public class ServerTest {
|
||||
public class MysqlServerTest {
|
||||
public static String testDatabaseConnection(DatabaseConfig databaseConfig) {
|
||||
try {
|
||||
//创建数据源
|
|
@ -0,0 +1,13 @@
|
|||
package com.etl.cleaning.server;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* redis测试连接
|
||||
*/
|
||||
public class RedisServerTest {
|
||||
public static String testRedisData(){
|
||||
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ import com.etl.cleaning.domian.request.PlaceRequest;
|
|||
import com.etl.cleaning.domian.response.PlaceResponse;
|
||||
import com.etl.cleaning.enums.EnumMsg;
|
||||
import com.etl.cleaning.mapper.PlaceMapper;
|
||||
import com.etl.cleaning.server.ServerTest;
|
||||
import com.etl.cleaning.server.MysqlServerTest;
|
||||
import com.etl.cleaning.service.PlaceService;
|
||||
import com.etl.cleaning.service.TypeService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -128,6 +128,6 @@ public class PlaceServiceImpl extends ServiceImpl<PlaceMapper, DataPlace> implem
|
|||
.username(mysqlRequest.getItemUsername())
|
||||
.password(mysqlRequest.getItemPass())
|
||||
.build();
|
||||
return ServerTest.testDatabaseConnection(databaseConfig);
|
||||
return MysqlServerTest.testDatabaseConnection(databaseConfig);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue