Commit 7cd9c5eb authored by mcb's avatar mcb

no message

parent fef4fdb3
......@@ -28,7 +28,7 @@ public class JsonResult<T> {
public JsonResult() {
this.setCode(ResultCode.SUCCESS);
this.setMessage("成功�?");
this.setMessage("成功");
}
public JsonResult(ResultCode code) {
......@@ -53,6 +53,12 @@ public class JsonResult<T> {
this.setData(data);
}
public JsonResult(T data) {
this.setCode(ResultCode.SUCCESS);
this.setMessage("成功!");
this.setData(data);
}
public JsonResult(com.jz.dmp.agent.ResultCode code, String message) {
}
......
......@@ -22,7 +22,7 @@ public enum ResultCode {
PARAMS_ERROR_TOKEN("446", "token无效"),
/** 不支持当前请求方�? */
METHOD_NOT_ALLOWED("405", "不支持当前请求方�? "),
METHOD_NOT_ALLOWED("405", "不支持当前请求方式! "),
/** 不支持或已经废弃 */
NOT_SUPPORTED("410", "不支持或已经废弃"),
......@@ -31,7 +31,7 @@ public enum ResultCode {
UNSUPPORTED_MEDIA_TYPE("415", "不支持当前媒体类�?"),
/** AuthCode错误 */
INVALID_AUTHCODE("444", "无权限访�?"),
INVALID_AUTHCODE("444", "无权限访问!"),
/** 太频繁的调用 */
TOO_FREQUENT("445", "太频繁的调用"),
......
......@@ -71,4 +71,28 @@ public class DataSourceController {
JsonResult result = dmpSyncingDatasourceService.delDataSourceById(datasourceId);
return result;
}
/**
* 获取数据源类型-下拉框
*
* @return
*/
@ApiOperation(value = "获取数据源类型", notes = "获取数据源类型-下拉框")
@GetMapping(value = "/queryDatasourceType")
public JsonResult getDatasourceType(HttpServletRequest httpRequest) throws Exception {
JsonResult result = dmpSyncingDatasourceService.queryDatasourceType();
return result;
}
/**
* 新增获取数据源类型
*
* @return
*/
@ApiOperation(value = "新增--获取数据源类型", notes = "获取数据源类型")
@GetMapping(value = "/queryGroupDatasourceType")
public JsonResult getGroupDatasourceType(HttpServletRequest httpRequest) throws Exception {
JsonResult result = dmpSyncingDatasourceService.queryGroupDatasourceType();
return result;
}
}
......@@ -24,15 +24,5 @@ public class DmpTableColumnController {
@Autowired
private DmpTableColumnService dmpTableColumnService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public DmpTableColumn selectOne(Integer id) {
return this.dmpTableColumnService.queryById(id);
}
}
\ No newline at end of file
......@@ -23,15 +23,5 @@ public class DmpTableController {
@Resource
private DmpTableService dmpTableService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public DmpTable selectOne(Integer id) {
return this.dmpTableService.queryById(id);
}
}
\ No newline at end of file
......@@ -24,15 +24,5 @@ public class DmpTableFieldMappingController{
@Autowired
private DmpTableFieldMappingService dmpTableFieldMappingService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public DmpTableFieldMapping selectOne(Integer id) {
return this.dmpTableFieldMappingService.queryById(id);
}
}
\ No newline at end of file
......@@ -24,15 +24,5 @@ public class DmpTableFieldSchemaController{
@Autowired
private DmpTableFieldSchemaService dmpTableFieldSchemaService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public DmpTableFieldSchema selectOne(Integer id) {
return this.dmpTableFieldSchemaService.queryById(id);
}
}
\ No newline at end of file
......@@ -24,15 +24,5 @@ public class DvRuleTController {
@Autowired
private DvRuleTService dvRuleTService;
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("selectOne")
public DvRuleT selectOne(Long id) {
return this.dvRuleTService.queryById(id);
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.jz.dmp.modules.model.DmpSyncingDatasource;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 数据源配置(DmpSyncingDatasource)表数据库访问层
......@@ -89,4 +90,8 @@ public interface DmpSyncingDatasourceDao {
List<DataSourceListDto> queryDataSourceListPage(DataSourceListReq req) throws Exception;
void delDataSourceById(@Param("ids") String[] ids) throws Exception;
List<Map> queryDatasourceType() throws Exception;
List<Map> queryGroupDatasourceType() throws Exception;
}
\ No newline at end of file
......@@ -62,4 +62,8 @@ public interface DmpSyncingDatasourceService {
PageInfoResponse<DataSourceListDto> queryDataSourceListPage(DataSourceListReq req, HttpServletRequest httpRequest) throws Exception;
JsonResult delDataSourceById(String datasourceId) throws Exception;
JsonResult queryDatasourceType() throws Exception;
JsonResult queryGroupDatasourceType() throws Exception;
}
\ No newline at end of file
......@@ -7,7 +7,6 @@ import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse;
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.TaskListPageDto;
import com.jz.dmp.modules.dao.DmpSyncingDatasourceDao;
import com.jz.dmp.modules.model.DmpSyncingDatasource;
import com.jz.dmp.modules.service.DmpSyncingDatasourceService;
......@@ -18,8 +17,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -129,4 +128,32 @@ public class DmpSyncingDatasourceServiceImpl implements DmpSyncingDatasourceServ
dmpSyncingDatasourceDao.delDataSourceById(ids);
return new JsonResult();
}
@Override
public JsonResult queryDatasourceType() throws Exception {
List<Map> list = dmpSyncingDatasourceDao.queryDatasourceType();
return new JsonResult(list);
}
/**
* 新增-获取数据源类型
*
* @return
*/
@Override
public JsonResult queryGroupDatasourceType() throws Exception {
Map<String, ArrayList<Map>> returnMap = new HashMap();
List<Map> list = dmpSyncingDatasourceDao.queryGroupDatasourceType();
if (list.size() > 0 && list != null) {
for (Map<String,Object> dto : list) {
String datasourceCatename = (String) dto.get("datasourceCatename");
if (returnMap.get(datasourceCatename) == null) {
returnMap.put(datasourceCatename,new ArrayList<Map>());
}
ArrayList<Map> param = returnMap.get(datasourceCatename);
param.add(dto);
}
}
return new JsonResult(returnMap);
}
}
\ No newline at end of file
......@@ -278,4 +278,28 @@
</foreach>
</delete>
<!--查询数据源类型名称-->
<select id="queryDatasourceType" resultType="map">
select
datasource as datasourceName,
id as datasourceTypeId
from dmp_syncing_datasource_type
where data_status = '1' and is_enabled = '1'
order by datasource_catetype
</select>
<select id="queryGroupDatasourceType" resultType="map">
SELECT
id as datasourceTypeId,
datasource as datasourceTypeName,
datasource_catename as datasourceCatename,
datasource_catecode as datasourceCatecode,
IFNULL(img_url, '') as imgUrl,
IFNULL(is_enabled, '0') as isEnabled,
IFNULL(is_enable_test, '0') as isEnableTest
from dmp_syncing_datasource_type
where data_status = '1'
order by datasource_catetype
</select>
</mapper>
\ No newline at end of file
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