Commit a0981050 authored by mcb's avatar mcb

no message

parent 8a01a3da
...@@ -6,7 +6,6 @@ import com.jz.common.page.PageInfoResponse; ...@@ -6,7 +6,6 @@ import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto; import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq; import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.DmpSyncingDatasourceReq; import com.jz.dmp.modules.controller.DataIntegration.bean.DmpSyncingDatasourceReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.SyncingDatasourceTypeDto;
import com.jz.dmp.modules.service.DmpSyncingDatasourceService; import com.jz.dmp.modules.service.DmpSyncingDatasourceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -172,11 +171,11 @@ public class DataSourceController { ...@@ -172,11 +171,11 @@ public class DataSourceController {
@ApiImplicitParam(name = "datasourceTypeId", value = "数据源类型id") @ApiImplicitParam(name = "datasourceTypeId", value = "数据源类型id")
@ApiOperation(value = "获取数据源类型输入框属性", notes = "获取数据源类型输入框属性") @ApiOperation(value = "获取数据源类型输入框属性", notes = "获取数据源类型输入框属性")
@GetMapping(value = "/getDatasourceTypeAttr") @GetMapping(value = "/getDatasourceTypeAttr")
public JsonResult<SyncingDatasourceTypeDto> getDatasourceTypeAttr(@RequestParam String datasourceTypeId, HttpServletRequest httpRequest) throws Exception { public JsonResult getDatasourceTypeAttr(@RequestParam String datasourceTypeId, HttpServletRequest httpRequest) throws Exception {
if (StringUtils.isEmpty(datasourceTypeId)) { if (StringUtils.isEmpty(datasourceTypeId)) {
return new JsonResult(ResultCode.PARAMS_ERROR); return new JsonResult(ResultCode.PARAMS_ERROR);
} }
JsonResult<SyncingDatasourceTypeDto> result = dmpSyncingDatasourceService.selectDatasourceTypeAttrById(datasourceTypeId); JsonResult result = dmpSyncingDatasourceService.selectDatasourceTypeAttrById(datasourceTypeId);
return result; return result;
} }
......
package com.jz.dmp.modules.controller.DataIntegration.bean;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* 数据源类型(DmpSyncingDatasourceType)实体类
*
* @author Bellamy
* @since 2020-12-21 18:39:06
*/
@ApiModel(value = "数据源类型返回对象", description = "数据源类型")
public class SyncingDatasourceTypeDto implements Serializable {
private static final long serialVersionUID = 526021146272437267L;
/**
* 数据源类型ID
*/
@ApiModelProperty(value = "数据源类型ID")
private String datasourceTypeId;
/**
* 数据源名称
*/
@ApiModelProperty(value = "数据源名称")
private String datasourceTypeName;
/**
* 数据源分类
*/
@ApiModelProperty(value = "数据源分类")
private String datasourceCatecode;
/**
* 数据源分类
*/
@ApiModelProperty(value = "数据源分类名称")
private String datasourceCatename;
/**
* jdbcUrl
*/
@ApiModelProperty(value = "jdbcUrl")
private String jdbcUrl;
/**
* 密码
*/
@ApiModelProperty(value = "密码")
private String password;
/**
* 账户
*/
@ApiModelProperty(value = "账户")
private String userName;
@ApiModelProperty(value = "数据源描述")
private String datasourceDesc;
@ApiModelProperty(value = "数据源名称")
private String datasourceName;
@ApiModelProperty(value = "网络连接类型")
private String networkConnectionType;
/**
* 数据源类型
*/
@ApiModelProperty(value = "数据源分类输入框属性json")
private JSONObject dbAttrs;
public String getDatasourceCatecode() {
return datasourceCatecode;
}
public void setDatasourceCatecode(String datasourceCatecode) {
this.datasourceCatecode = datasourceCatecode;
}
public String getDatasourceCatename() {
return datasourceCatename;
}
public void setDatasourceCatename(String datasourceCatename) {
this.datasourceCatename = datasourceCatename;
}
public String getDatasourceTypeId() {
return datasourceTypeId;
}
public void setDatasourceTypeId(String datasourceTypeId) {
this.datasourceTypeId = datasourceTypeId;
}
public String getDatasourceTypeName() {
return datasourceTypeName;
}
public void setDatasourceTypeName(String datasourceTypeName) {
this.datasourceTypeName = datasourceTypeName;
}
public JSONObject getDbAttrs() {
return dbAttrs;
}
public void setDbAttrs(JSONObject dbAttrs) {
this.dbAttrs = dbAttrs;
}
public String getJdbcUrl() {
return jdbcUrl;
}
public void setJdbcUrl(String jdbcUrl) {
this.jdbcUrl = jdbcUrl;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDatasourceDesc() {
return datasourceDesc;
}
public void setDatasourceDesc(String datasourceDesc) {
this.datasourceDesc = datasourceDesc;
}
public String getDatasourceName() {
return datasourceName;
}
public void setDatasourceName(String datasourceName) {
this.datasourceName = datasourceName;
}
public String getNetworkConnectionType() {
return networkConnectionType;
}
public void setNetworkConnectionType(String networkConnectionType) {
this.networkConnectionType = networkConnectionType;
}
}
\ No newline at end of file
...@@ -6,7 +6,6 @@ import com.jz.common.page.PageInfoResponse; ...@@ -6,7 +6,6 @@ import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto; import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq; import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.DmpSyncingDatasourceReq; import com.jz.dmp.modules.controller.DataIntegration.bean.DmpSyncingDatasourceReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.SyncingDatasourceTypeDto;
import com.jz.dmp.modules.model.DmpSyncingDatasource; import com.jz.dmp.modules.model.DmpSyncingDatasource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -80,5 +79,5 @@ public interface DmpSyncingDatasourceService { ...@@ -80,5 +79,5 @@ public interface DmpSyncingDatasourceService {
List<DmpSyncingDatasource> findListByParams(DmpSyncingDatasource ds) throws Exception; List<DmpSyncingDatasource> findListByParams(DmpSyncingDatasource ds) throws Exception;
JsonResult<SyncingDatasourceTypeDto> selectDatasourceTypeAttrById(String datasourceTypeId) throws Exception; JsonResult selectDatasourceTypeAttrById(String datasourceTypeId) throws Exception;
} }
\ No newline at end of file
package com.jz.dmp.modules.service.impl; package com.jz.dmp.modules.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -15,7 +14,6 @@ import com.jz.dmp.agent.DmpAgentResult; ...@@ -15,7 +14,6 @@ import com.jz.dmp.agent.DmpAgentResult;
import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto; import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListDto;
import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq; import com.jz.dmp.modules.controller.DataIntegration.bean.DataSourceListReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.DmpSyncingDatasourceReq; import com.jz.dmp.modules.controller.DataIntegration.bean.DmpSyncingDatasourceReq;
import com.jz.dmp.modules.controller.DataIntegration.bean.SyncingDatasourceTypeDto;
import com.jz.dmp.modules.dao.DmpProjectDao; import com.jz.dmp.modules.dao.DmpProjectDao;
import com.jz.dmp.modules.dao.DmpSyncingDatasourceDao; import com.jz.dmp.modules.dao.DmpSyncingDatasourceDao;
import com.jz.dmp.modules.model.DmpAgentDatasourceInfo; import com.jz.dmp.modules.model.DmpAgentDatasourceInfo;
...@@ -343,37 +341,16 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ ...@@ -343,37 +341,16 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
* @author Bellamy * @author Bellamy
*/ */
@Override @Override
public JsonResult<SyncingDatasourceTypeDto> selectDatasourceTypeAttrById(String datasourceTypeId) throws Exception { public JsonResult selectDatasourceTypeAttrById(String datasourceTypeId) throws Exception {
Map returnMap = new HashMap();
Map map = new HashMap(); Map map = new HashMap();
map.put("datasourceTypeId", datasourceTypeId); map.put("datasourceTypeId", datasourceTypeId);
SyncingDatasourceTypeDto dto = new SyncingDatasourceTypeDto();
List<Map> list = dmpSyncingDatasourceDao.queryGroupDatasourceType(map); List<Map> list = dmpSyncingDatasourceDao.queryGroupDatasourceType(map);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
Map str = list.get(0); Map str = list.get(0);
if (StringUtils.isNotEmpty(str.get("datasourceTypeId").toString())) { returnMap = JSONObject.parseObject(str.get("dbAttrs").toString());
dto.setDatasourceTypeId(str.get("datasourceTypeId").toString());
} }
if (StringUtils.isNotEmpty(str.get("datasourceCatecode").toString())) { return new JsonResult(returnMap);
dto.setDatasourceCatecode(str.get("datasourceCatecode").toString());
}
if (StringUtils.isNotEmpty(str.get("datasourceCatename").toString())) {
dto.setDatasourceCatename(str.get("datasourceCatename").toString());
}
if (StringUtils.isNotEmpty(str.get("datasourceTypeName").toString())) {
dto.setDatasourceTypeName(str.get("datasourceTypeName").toString());
}
if (StringUtils.isNotEmpty(str.get("dbAttrs").toString())) { //数据源字段属性json
Map<String, Object> dbAttrs = JSONObject.parseObject(str.get("dbAttrs").toString());
dto.setJdbcUrl(dbAttrs.get("jdbcUrl").toString());
dto.setPassword(dbAttrs.get("password").toString());
dto.setDatasourceDesc(dbAttrs.get("datasourceDesc").toString());
dto.setUserName(dbAttrs.get("userName").toString());
dto.setDatasourceName(dbAttrs.get("datasourceName").toString());
dto.setNetworkConnectionType(dbAttrs.get("networkConnectionType").toString());
dto.setDbAttrs(JSONObject.parseObject(str.get("dbAttrs").toString()));
}
}
return new JsonResult(dto);
} }
/* /*
......
{
"data":[
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "mysql"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "SqlServer"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "PostgreSQL"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "Oracle"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "Hive"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"kudu Master": "Y", //
"impala Master fqdn": "Y", //
"databaseType": "Kudu"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"hdfs.namenode.principal": "Y", //
"hive.metastore.uris:thrift": "Y", //
"keytab.location":"Y",
"databaseType": "HDFS"
},
{
"port": "Y",//端口
"agreement":"Y", //协议
"host":"Y",//主机
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "FTP"
},
{
"jdbcUrl": "Y",
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"databaseType": "Elasticsearch"
},
{
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"bootstrap地址":"Y",
"jaas地址":"Y",
"krb5地址":"Y",
"databaseType": "Kafka"
}
]
}
/*{
"jdbcUrl": "Y",
"port": "N",//端口
"agreement":"N", //协议
"host":"N", //主机
"password": "Y", //密码
"userName": "Y", //用户名
"datasourceDesc": "Y", //数据源描述
"datasourceName": "Y", //数据源名称
"hdfs.namenode.principal": "N", //
"hive.metastore.uris:thrift": "N", //
"keytab.location":"N",
"bootstrap地址":"N",
"jaas地址":"N",
"krb5地址":"N",
"kudu Master": "N", //
"impala Master fqdn": "N", //
"databaseType": "Elasticsearch"
}*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment