Merge remote-tracking branch 'origin/developing' into developing

This commit is contained in:
JiaJu Zhuang
2023-07-09 19:18:29 +08:00
25 changed files with 272 additions and 191 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -47,7 +47,10 @@ public class DataSourceTestRequest {
@NotNull
private String type;
/**
* 认证类型
*/
private String authenticationType;
/**
* host

View File

@ -40,6 +40,10 @@ public class DataSourceVO {
*/
private String password;
/**
* 认证类型
*/
private String authenticationType;
/**
* 连接类型
*/