mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-01 18:53:35 +08:00
Merge remote-tracking branch 'origin/developing' into developing
This commit is contained in:
@ -38,6 +38,7 @@ import com.jcraft.jsch.Session;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -179,6 +180,11 @@ public class DataSourceController {
|
||||
public DataResult<DataSourceVO> queryById(@PathVariable("id") Long id) {
|
||||
DataResult<DataSource> dataResult = dataSourceService.queryById(id);
|
||||
DataSourceVO dataSourceVO = dataSourceWebConverter.dto2vo(dataResult.getData());
|
||||
if(StringUtils.isNotBlank(dataSourceVO.getUser())){
|
||||
dataSourceVO.setAuthenticationType("1");
|
||||
}else {
|
||||
dataSourceVO.setAuthenticationType("2");
|
||||
}
|
||||
return DataResult.of(dataSourceVO);
|
||||
}
|
||||
|
||||
|
@ -42,9 +42,13 @@ public class DataSourceCreateRequest {
|
||||
@NotNull
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证类型
|
||||
*/
|
||||
private String authenticationType;
|
||||
|
||||
/**
|
||||
* 连接类型
|
||||
* @see DbTypeEnum
|
||||
*/
|
||||
@NotNull
|
||||
private String type;
|
||||
@ -100,4 +104,7 @@ public class DataSourceCreateRequest {
|
||||
* 驱动配置
|
||||
*/
|
||||
private DriverConfig driverConfig;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,10 @@ public class DataSourceTestRequest {
|
||||
@NotNull
|
||||
private String type;
|
||||
|
||||
|
||||
/**
|
||||
* 认证类型
|
||||
*/
|
||||
private String authenticationType;
|
||||
|
||||
/**
|
||||
* host
|
||||
|
@ -40,6 +40,10 @@ public class DataSourceVO {
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 认证类型
|
||||
*/
|
||||
private String authenticationType;
|
||||
/**
|
||||
* 连接类型
|
||||
*/
|
||||
|
Reference in New Issue
Block a user