Browse Source

controller

zxm
菅振宇 7 months ago
parent
commit
32c0e4a4d6
  1. 10
      ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java
  2. 2
      ruoyi-api/src/main/java/com/ruoyi/api/mapper/ZhyPointMapper.java
  3. 4
      ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml

10
ruoyi-api/src/main/java/com/ruoyi/api/controller/TestXiaoTuPuController.java

@ -148,12 +148,22 @@ public class TestXiaoTuPuController extends BaseController {
pointService.buildPoint(); pointService.buildPoint();
} }
// 获取所有模型
@GetMapping("getKeyWorlds") @GetMapping("getKeyWorlds")
public List<Map> getKeyWorlds() throws IOException { public List<Map> getKeyWorlds() throws IOException {
List<Map> a = zhyPointMapper.selectPointByType1("keyword"); List<Map> a = zhyPointMapper.selectPointByType1("keyword");
return a; return a;
} }
@GetMapping("getTitlebyReId/{id}")
public List<Map> getTitlebyReId(@PathVariable("id")Integer id) throws IOException {
List<Map> a = zhyPointMapper.selectPointResByNeo4jId(id);
return a;
}
public Map<String, Object> convertToGraphFormat(List<Map> rawNodes, List<Map> rawRelationships) { public Map<String, Object> convertToGraphFormat(List<Map> rawNodes, List<Map> rawRelationships) {
List<Map<String, Object>> nodes = new ArrayList<>(); List<Map<String, Object>> nodes = new ArrayList<>();
List<Map<String, Object>> links = new ArrayList<>(); List<Map<String, Object>> links = new ArrayList<>();

2
ruoyi-api/src/main/java/com/ruoyi/api/mapper/ZhyPointMapper.java

@ -8,6 +8,8 @@ import java.util.Map;
@Mapper @Mapper
public interface ZhyPointMapper { public interface ZhyPointMapper {
List<Map> selectPointByName(@Param("name") String name); List<Map> selectPointByName(@Param("name") String name);
List<Map> selectPointResByNeo4jId(@Param("neo4jId") Integer neo4jId);
List<Map> selectPointByType1(@Param("type1") String type1); List<Map> selectPointByType1(@Param("type1") String type1);
List<Map> selectPointRelationshipByName(@Param("author") String author,@Param("keyword") String keyword,@Param("agency") String agency,@Param("title") String title); List<Map> selectPointRelationshipByName(@Param("author") String author,@Param("keyword") String keyword,@Param("agency") String agency,@Param("title") String title);

4
ruoyi-api/src/main/resources/mapper/api/ZhyPointMapper.xml

@ -12,6 +12,10 @@
<select id="selectPointByType1" resultType="map"> <select id="selectPointByType1" resultType="map">
select * from zhy_point where type1=#{type1} select * from zhy_point where type1=#{type1}
</select> </select>
<select id="selectPointResByNeo4jId" resultType="map">
select * from zhy_point_relationship where relationship_id=#{neo4jId}
</select>
<select id="selectPointRelationshipByName" resultType="map"> <select id="selectPointRelationshipByName" resultType="map">
SELECT * SELECT *

Loading…
Cancel
Save