105 lines
3.1 KiB
Java
105 lines
3.1 KiB
Java
package net.srt.controller;
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.AllArgsConstructor;
|
|
import net.srt.framework.common.cache.bean.Neo4jInfo;
|
|
import net.srt.framework.common.utils.Result;
|
|
import net.srt.framework.common.utils.TreeNodeVo;
|
|
import net.srt.service.MetadataService;
|
|
import net.srt.vo.MetadataVo;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.validation.Valid;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @BelongsProject: srt_cloud
|
|
* @BelongsPackage: net.srt.controller
|
|
* @Author: jpz
|
|
* @CreateTime: 2023/12/24 14:24
|
|
*/
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.AllArgsConstructor;
|
|
import net.srt.service.MetadataService;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
@RequestMapping("metadata")
|
|
@Tag(name = "数据治理-元数据")
|
|
@AllArgsConstructor
|
|
public class MetadataController {
|
|
private final MetadataService metadataService;
|
|
@GetMapping("/list-chlid")
|
|
@Operation(summary = "根据父类id获取信息")
|
|
public Result<List<TreeNodeVo>> listByPatenId(@RequestParam Long parentId){
|
|
List<TreeNodeVo> list=metadataService.listByPatenId(parentId);
|
|
return Result.ok(list);
|
|
}
|
|
@GetMapping("/list-floder")
|
|
@Operation(summary = "获取目录树")
|
|
public Result<List<TreeNodeVo>> listFloder(){
|
|
List<TreeNodeVo> list=metadataService.listFloder();
|
|
return Result.ok(list);
|
|
}
|
|
@GetMapping("/list-db")
|
|
@Operation(summary = "获取库表目录树")
|
|
public Result<List<TreeNodeVo>> listDb() {
|
|
List<TreeNodeVo> list=metadataService.listDb();
|
|
return Result.ok(list);
|
|
}
|
|
|
|
@GetMapping("/list-keyword")
|
|
@Operation(summary = "模糊查询")
|
|
public Result<List<TreeNodeVo>> listKeyword( String keyword) {
|
|
List<TreeNodeVo> list=metadataService.listKeyword(keyword);
|
|
return Result.ok(list);
|
|
}
|
|
|
|
@GetMapping("{id}")
|
|
@Operation(summary = "信息")
|
|
public Result<MetadataVo> get(@PathVariable("id") Long id){
|
|
return Result.ok(metadataService.get(id));
|
|
}
|
|
|
|
@PostMapping
|
|
@Operation(summary = "保存")
|
|
public Result<String> save(@RequestBody MetadataVo vo){
|
|
metadataService.save(vo);
|
|
return Result.ok();
|
|
}
|
|
|
|
@PutMapping
|
|
@Operation(summary = "修改")
|
|
public Result<String> update(@RequestBody @Valid MetadataVo vo){
|
|
metadataService.update(vo);
|
|
return Result.ok();
|
|
}
|
|
|
|
@DeleteMapping("{id}")
|
|
@Operation(summary = "删除")
|
|
public Result<String> delete(@PathVariable Long id){
|
|
metadataService.delete(id);
|
|
return Result.ok();
|
|
}
|
|
|
|
@PostMapping("{neo4j}")
|
|
@Operation(summary = "更新neo4路径")
|
|
public Result<String> updateNeo4j(@PathVariable Neo4jInfo neo4jInfo){
|
|
metadataService.updateNeo4j(neo4jInfo);
|
|
return Result.ok();
|
|
}
|
|
|
|
@GetMapping("/neo4j")
|
|
@Operation(summary = "获取neo4的路径")
|
|
public Result<Neo4jInfo> getNeo4j(){
|
|
return Result.ok(metadataService.getNeo4j());
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|