mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 05:12:07 +08:00
新增标签数据源列表查询接口,新增标签列表查询接口
This commit is contained in:
+10
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.datasource;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -79,6 +80,15 @@ public class DataSourceController {
|
||||
return success(BeanUtils.toBean(pageResult, DataSourceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得系统数据源列表")
|
||||
@Parameter(name = "type", description = "类型", required = false)
|
||||
@PreAuthorize("@ss.hasPermission('system:data-source:query')")
|
||||
public CommonResult<List<DataSourceRespVO>> list( @RequestParam(value = "type", required = false) Integer type) {
|
||||
List<DataSourceDO> list = dataSourceService.list(type);
|
||||
return success(BeanUtils.toBean(list, DataSourceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出系统数据源 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:data-source:export')")
|
||||
|
||||
+8
@@ -77,6 +77,14 @@ public class LabelController {
|
||||
return success(BeanUtils.toBean(pageResult, LabelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
@Operation(summary = "获得标签列表")
|
||||
@Parameter(name = "type", description = "类型", required = false, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
public CommonResult<List<LabelRespVO>> getLabel(@RequestParam("type") String type) {
|
||||
return success(BeanUtils.toBean(labelService.list(type), LabelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/group-list")
|
||||
@Operation(summary = "获得分组标签列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
|
||||
+1
@@ -53,4 +53,5 @@ public interface DataSourceService {
|
||||
*/
|
||||
PageResult<DataSourceDO> getDataSourcePage(DataSourcePageReqVO pageReqVO);
|
||||
|
||||
List<DataSourceDO> list(Integer type);
|
||||
}
|
||||
+6
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.service.datasource;
|
||||
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -69,4 +70,9 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
return dataSourceMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataSourceDO> list(Integer type) {
|
||||
return dataSourceMapper.selectList(new LambdaQueryWrapperX<DataSourceDO>().eqIfPresent(DataSourceDO::getType, type));
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -68,4 +68,6 @@ public interface LabelService {
|
||||
List<LabelElementRespVO> getLabelElementListByLabelId(Long LabelId);
|
||||
|
||||
Map<String, List<LabelRespVO>> getGroupList();
|
||||
|
||||
List<LabelDO> list(String type);
|
||||
}
|
||||
+5
@@ -239,6 +239,11 @@ public class LabelServiceImpl implements LabelService {
|
||||
return LabelRespVOS.stream().collect(Collectors.groupingBy(e -> e.getType()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LabelDO> list(String type) {
|
||||
return LabelMapper.selectList(new LambdaQueryWrapperX<LabelDO>().eqIfPresent(LabelDO::getType, type));
|
||||
}
|
||||
|
||||
private void createLabelElementList(Long LabelId, List<LabelElementDO> list) {
|
||||
list.forEach(o -> o.setLabelId(LabelId));
|
||||
labelElementMapper.insertBatch(list);
|
||||
|
||||
Reference in New Issue
Block a user