This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enderbyendera-realtime-prot…/src/main/java/com/realtime/protection/server/nodetree/NodeTreeController.java
2024-08-29 16:23:01 +08:00

42 lines
1.0 KiB
Java

package com.realtime.protection.server.nodetree;
import com.realtime.protection.configuration.response.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.List;
//李福连
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/nodeTree")
@Slf4j
public class NodeTreeController {
@Autowired
NodeTreeService nodeTreeService;
@GetMapping("/get")
public ResponseResult tupoInfo(String business) throws IOException {
List<NodeEntity> roots = nodeTreeService.get();
if (!roots.isEmpty()) {
return ResponseResult.ok()
.setData("data", roots);
}
return ResponseResult.error()
.setMessage("没有查到");
}
}