feat(): 资产结构树形结构
parent
9953c7c202
commit
bd68e9030f
|
@ -0,0 +1,27 @@
|
||||||
|
package com.etl.data.structure.domain.resp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据资产返回类
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureResp 数据资产返回类
|
||||||
|
* @CreateTime: 2024/4/22 下午7:23
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class AssetStructureResp {
|
||||||
|
|
||||||
|
private List<AssetResp> assetRespList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.etl.data.structure.controller;
|
||||||
|
|
||||||
|
import com.etl.common.core.domain.Result;
|
||||||
|
import com.etl.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.etl.data.structure.domain.AssetStructure;
|
||||||
|
import com.etl.data.structure.service.IAssetStructureService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据资产 Controller 层
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureController 数据资产 Controller 层
|
||||||
|
* @CreateTime: 2024/4/22 上午10:09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/structure")
|
||||||
|
public class AssetStructureController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAssetStructureService assetStructureService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据源信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("data:structure:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<List<AssetStructure>> list() {
|
||||||
|
return Result.success(assetStructureService.selectAssetSouructureList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.etl.data.structure.controller;
|
||||||
|
|
||||||
|
import com.etl.common.core.domain.Result;
|
||||||
|
import com.etl.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.etl.data.structure.domain.AssetStructureTable;
|
||||||
|
import com.etl.data.structure.service.IAssetStructureTableService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据资产表 Controller 层
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureTableController 数据资产表 Controller 层
|
||||||
|
* @CreateTime: 2024/4/22 下午7:28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/structureTable")
|
||||||
|
public class AssetStructureTableController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAssetStructureTableService assetStructureTableService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有的表
|
||||||
|
* @param assetStructureId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("data:structureTable:list")
|
||||||
|
@PostMapping("list/{assetStructureId}")
|
||||||
|
public Result<List<AssetStructureTable>> list(@PathVariable("assetStructureId") Long assetStructureId) {
|
||||||
|
return Result.success(assetStructureTableService.selectAssetSouructureTableList(assetStructureId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.etl.data.structure.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.etl.data.structure.domain.AssetStructure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据资产Mapper接口
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureMapper 数据资产Mapper
|
||||||
|
* @CreateTime: 2024/4/22 下午2:12
|
||||||
|
*/
|
||||||
|
public interface AssetStructureMapper extends BaseMapper<AssetStructure> {
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.etl.data.structure.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.etl.data.structure.domain.AssetStructureTable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产结构Mapper接口
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureTableMapper 资产结构Mapper接口
|
||||||
|
* @CreateTime: 2024/4/22 下午5:23
|
||||||
|
*/
|
||||||
|
public interface AssetStructureTableMapper extends BaseMapper<AssetStructureTable> {
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.etl.data.structure.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.etl.data.structure.domain.AssetStructure;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据资产Service 接口
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: IAssetStructureService 数据资产Service 接口
|
||||||
|
* @CreateTime: 2024/4/22 下午2:08
|
||||||
|
*/
|
||||||
|
public interface IAssetStructureService extends IService<AssetStructure> {
|
||||||
|
/**
|
||||||
|
* 查询数据资产列表
|
||||||
|
*
|
||||||
|
* @return 数据资产集合
|
||||||
|
*/
|
||||||
|
List<AssetStructure> selectAssetSouructureList();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.etl.data.structure.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.etl.data.structure.domain.AssetStructureTable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产结构表表Service接口
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: IAssetStructureTableService 资产结构表表Service接口
|
||||||
|
* @CreateTime: 2024/4/22 下午5:21
|
||||||
|
*/
|
||||||
|
public interface IAssetStructureTableService extends IService<AssetStructureTable> {
|
||||||
|
/**
|
||||||
|
* 查询该数据资产表
|
||||||
|
* @param assetStructureId 数据资产id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AssetStructureTable> selectAssetSouructureTableList(Long assetStructureId );
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.etl.data.structure.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.etl.data.structure.domain.AssetStructure;
|
||||||
|
import com.etl.data.structure.mapper.AssetStructureMapper;
|
||||||
|
import com.etl.data.structure.service.IAssetStructureService;
|
||||||
|
import com.etl.data.structure.service.IAssetStructureTableService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据资产Service 业务实现层
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureServiceImpl 数据资产Service 业务实现层
|
||||||
|
* @CreateTime: 2024/4/22 下午2:10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AssetStructureServiceImpl extends ServiceImpl<AssetStructureMapper, AssetStructure> implements IAssetStructureService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAssetStructureTableService assetStructureTableService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据资产列表
|
||||||
|
*
|
||||||
|
* @return 数据资产列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AssetStructure> selectAssetSouructureList() {
|
||||||
|
// 创建一个列表
|
||||||
|
List<AssetStructure> assetStructureList = this.list();
|
||||||
|
|
||||||
|
return assetStructureList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.etl.data.structure.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.etl.data.structure.domain.AssetStructureTable;
|
||||||
|
import com.etl.data.structure.mapper.AssetStructureTableMapper;
|
||||||
|
import com.etl.data.structure.service.IAssetStructureTableService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产结构表表Service业务实现层
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetStructureTableServiceImpl 资产结构表表Service业务实现层
|
||||||
|
* @CreateTime: 2024/4/22 下午5:22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AssetStructureTableServiceImpl extends ServiceImpl<AssetStructureTableMapper, AssetStructureTable> implements IAssetStructureTableService {
|
||||||
|
/**
|
||||||
|
* 查询该数据资产表
|
||||||
|
* @param assetStructureId 数据资产id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AssetStructureTable> selectAssetSouructureTableList(Long assetStructureId) {
|
||||||
|
List<AssetStructureTable> list = this.list(
|
||||||
|
new LambdaQueryWrapper<AssetStructureTable>()
|
||||||
|
.eq(AssetStructureTable::getAssetStructureId, assetStructureId)
|
||||||
|
);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue