瀏覽代碼

朗通知识图谱框架

gaodm 5 年之前
父節點
當前提交
6796f31992
共有 25 個文件被更改,包括 240 次插入1012 次删除
  1. 20 73
      config-server/src/main/resources/shared/ltkg-service-dev.yml
  2. 20 73
      config-server/src/main/resources/shared/ltkg-service-local.yml
  3. 20 73
      config-server/src/main/resources/shared/ltkg-service-pre.yml
  4. 20 73
      config-server/src/main/resources/shared/ltkg-service-pro.yml
  5. 20 73
      config-server/src/main/resources/shared/ltkg-service-test.yml
  6. 3 21
      ltkg-service/pom.xml
  7. 3 1
      ltkg-service/src/main/java/com/diagbot/LtkgServiceApplication.java
  8. 0 25
      ltkg-service/src/main/java/com/diagbot/client/UserServiceClient.java
  9. 0 23
      ltkg-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java
  10. 0 33
      ltkg-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  11. 2 2
      ltkg-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  12. 20 20
      ltkg-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  13. 0 196
      ltkg-service/src/main/java/com/diagbot/entity/SysLog.java
  14. 0 142
      ltkg-service/src/main/java/com/diagbot/entity/User.java
  15. 2 2
      ltkg-service/src/main/java/com/diagbot/facade/SysLogFacade.java
  16. 16 0
      ltkg-service/src/main/java/com/diagbot/mapper/KgMapper.java
  17. 0 16
      ltkg-service/src/main/java/com/diagbot/mapper/SysLogMapper.java
  18. 16 0
      ltkg-service/src/main/java/com/diagbot/service/KgService.java
  19. 0 15
      ltkg-service/src/main/java/com/diagbot/service/SysLogService.java
  20. 29 0
      ltkg-service/src/main/java/com/diagbot/service/impl/KgServiceImpl.java
  21. 0 19
      ltkg-service/src/main/java/com/diagbot/service/impl/SysLogServiceImpl.java
  22. 39 0
      ltkg-service/src/main/java/com/diagbot/web/KgController.java
  23. 0 110
      ltkg-service/src/main/java/com/diagbot/web/SysLogController.java
  24. 10 0
      ltkg-service/src/main/resources/mapper/KgMapper.xml
  25. 0 22
      ltkg-service/src/main/resources/mapper/SysLogMapper.xml

+ 20 - 73
config-server/src/main/resources/shared/ltkg-service-dev.yml

@@ -1,54 +1,25 @@
 server:
-  port: 8831
+  port: 8775
 
 # 驱动配置信息
 spring:
+  profiles:
+    active: local
   datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/sys-log?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-      username: root
-      password: lantone
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
+    driver-class-name: org.neo4j.jdbc.Driver
+    url: jdbc:neo4j:http://192.168.3.150:7474
+    username: neo4j
+    password: 12345678
+    #定义初始连接数
+    initialSize: 0
+    #定义最大连接数
+    maxActive: 20
+    #定义最大空闲
+    maxIdle: 20
+    #定义最小空闲
+    minIdle: 1
+    #定义最长等待时间
+    maxWait: 60000
 
   cloud:
     stream:
@@ -67,30 +38,6 @@ spring:
     virtual-host: /
 
 #mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
+mybatis:
+  type-aliases-package: com.diagbot.entity
+  mapper-locations: classpath:mapper/**/*.xml

+ 20 - 73
config-server/src/main/resources/shared/ltkg-service-local.yml

@@ -1,54 +1,25 @@
 server:
-  port: 8831
+  port: 8775
 
 # 驱动配置信息
 spring:
+  profiles:
+    active: local
   datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/sys-log?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-      username: root
-      password: lantone
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
+    driver-class-name: org.neo4j.jdbc.Driver
+    url: jdbc:neo4j:http://192.168.3.150:7474
+    username: neo4j
+    password: 12345678
+    #定义初始连接数
+    initialSize: 0
+    #定义最大连接数
+    maxActive: 20
+    #定义最大空闲
+    maxIdle: 20
+    #定义最小空闲
+    minIdle: 1
+    #定义最长等待时间
+    maxWait: 60000
 
   cloud:
     stream:
@@ -67,30 +38,6 @@ spring:
     virtual-host: /
 
 #mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
+mybatis:
+  type-aliases-package: com.diagbot.entity
+  mapper-locations: classpath:mapper/**/*.xml

+ 20 - 73
config-server/src/main/resources/shared/ltkg-service-pre.yml

@@ -1,54 +1,25 @@
 server:
-  port: 8831
+  port: 8775
 
 # 驱动配置信息
 spring:
+  profiles:
+    active: local
   datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.121:3306/sys-log?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-      username: teamback
-      password: goTulmLeon
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
+    driver-class-name: org.neo4j.jdbc.Driver
+    url: jdbc:neo4j:http://192.168.3.150:7474
+    username: neo4j
+    password: 12345678
+    #定义初始连接数
+    initialSize: 0
+    #定义最大连接数
+    maxActive: 20
+    #定义最大空闲
+    maxIdle: 20
+    #定义最小空闲
+    minIdle: 1
+    #定义最长等待时间
+    maxWait: 60000
 
   cloud:
     stream:
@@ -67,30 +38,6 @@ spring:
     virtual-host: /
 
 #mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
+mybatis:
+  type-aliases-package: com.diagbot.entity
+  mapper-locations: classpath:mapper/**/*.xml

+ 20 - 73
config-server/src/main/resources/shared/ltkg-service-pro.yml

@@ -1,54 +1,25 @@
 server:
-  port: 8831
+  port: 8775
 
 # 驱动配置信息
 spring:
+  profiles:
+    active: local
   datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.122:3306/sys-log?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-      username: root
-      password: lantone
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
+    driver-class-name: org.neo4j.jdbc.Driver
+    url: jdbc:neo4j:http://192.168.3.150:7474
+    username: neo4j
+    password: 12345678
+    #定义初始连接数
+    initialSize: 0
+    #定义最大连接数
+    maxActive: 20
+    #定义最大空闲
+    maxIdle: 20
+    #定义最小空闲
+    minIdle: 1
+    #定义最长等待时间
+    maxWait: 60000
 
   cloud:
     stream:
@@ -67,30 +38,6 @@ spring:
     virtual-host: /
 
 #mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
+mybatis:
+  type-aliases-package: com.diagbot.entity
+  mapper-locations: classpath:mapper/**/*.xml

+ 20 - 73
config-server/src/main/resources/shared/ltkg-service-test.yml

@@ -1,54 +1,25 @@
 server:
-  port: 8831
+  port: 8775
 
 # 驱动配置信息
 spring:
+  profiles:
+    active: local
   datasource:
-    druid:
-      driver-class-name: com.mysql.cj.jdbc.Driver
-      platform: mysql
-      url: jdbc:mysql://192.168.2.241:3306/sys-log?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
-      username: root
-      password: lantone
-      # 连接池的配置信息
-      # 初始化大小,最小,最大
-      initialSize: 5
-      minIdle: 5
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      # 打开PSCache,并且指定每个连接上PSCache的大小
-      poolPreparedStatements: true
-      maxPoolPreparedStatementPerConnectionSize: 20
-      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-      filters.commons-log.connection-logger-name: wall,log4j
-      filter:
-        stat:
-          enabled: true
-          mergeSql: true
-          log-slow-sql: true
-          slow-sql-millis: 2000
-      #监控配置
-      web-stat-filter:
-        enabled: true
-        url-pattern: /*
-        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
-
-      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        reset-enable: false
-        login-username: root
-        login-password: root
+    driver-class-name: org.neo4j.jdbc.Driver
+    url: jdbc:neo4j:http://192.168.3.150:7474
+    username: neo4j
+    password: 12345678
+    #定义初始连接数
+    initialSize: 0
+    #定义最大连接数
+    maxActive: 20
+    #定义最大空闲
+    maxIdle: 20
+    #定义最小空闲
+    minIdle: 1
+    #定义最长等待时间
+    maxWait: 60000
 
   cloud:
     stream:
@@ -67,30 +38,6 @@ spring:
     virtual-host: /
 
 #mybatis
-mybatis-plus:
-  mapper-locations: classpath:/mapper/*Mapper.xml
-  #实体扫描,多个package用逗号或者分号分隔
-  typeAliasesPackage: com.diagbot.entity
-  global-config:
-    #刷新mapper 调试神器
-    db-config:
-      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-      id-type: id_worker
-      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-      field-strategy: not_empty
-      #驼峰下划线转换
-      column-underline: true
-      #数据库大写下划线转换
-      #capital-mode: true
-      #刷新mapper 调试神器
-      refresh-mapper: true
-      #逻辑删除配置
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      #自定义填充策略接口实现
-      #meta-object-handler: com.baomidou.springboot.xxx
-      #自定义SQL注入器
-      #sql-injector: com.baomidou.springboot.xxx
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
+mybatis:
+  type-aliases-package: com.diagbot.entity
+  mapper-locations: classpath:mapper/**/*.xml

+ 3 - 21
ltkg-service/pom.xml

@@ -91,9 +91,9 @@
         </dependency>
         <!--database-->
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <scope>runtime</scope>
+            <groupId>org.neo4j</groupId>
+            <artifactId>neo4j-jdbc-driver</artifactId>
+            <version>3.4.0</version>
         </dependency>
         <!--security-->
         <dependency>
@@ -123,30 +123,12 @@
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
 
-        <!-- mybatis-plus begin -->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-generator</artifactId>
-        </dependency>
-        <!-- mybatis-plus end -->
-
-        <!-- 阿里巴巴druid数据库连接池 -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-        </dependency>
 
         <!-- springboot整合mybatis(核心就这一个) -->
         <!-- 注意顺序,这个一定要放在最下面 -->
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>${mybatis-spring-boot.version}</version>
         </dependency>
 
         <dependency>

+ 3 - 1
ltkg-service/src/main/java/com/diagbot/LtkgServiceApplication.java

@@ -1,5 +1,6 @@
 package com.diagbot;
 
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@@ -19,7 +20,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
  * @author: gaodm
  * @time: 2018/8/7 9:26
  */
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
+@SpringBootApplication(exclude = { HibernateJpaAutoConfiguration.class,
         JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class })
 @EnableEurekaClient
 @EnableFeignClients({ "com.diagbot.client" })
@@ -28,6 +29,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 @EnableCircuitBreaker
 @RefreshScope
 @ConfigurationPropertiesScan
+@MapperScan("com.diagbot.mapper")
 public class LtkgServiceApplication {
 
     public static void main(String[] args) {

+ 0 - 25
ltkg-service/src/main/java/com/diagbot/client/UserServiceClient.java

@@ -1,25 +0,0 @@
-package com.diagbot.client;
-
-import com.diagbot.client.hystrix.UserServiceHystrix;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.User;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestHeader;
-
-
-/**
- * @Description: 调用用户服务
- * @author: gaodm
- * @time: 2018/8/6 9:52
- */
-@FeignClient(value = "user-service", fallback = UserServiceHystrix.class)
-public interface UserServiceClient {
-
-    @PostMapping(value = "/user/{username}")
-    RespDTO<User> getUser(@RequestHeader(value = "Authorization") String token, @PathVariable("username") String username);
-}
-
-
-

+ 0 - 23
ltkg-service/src/main/java/com/diagbot/client/hystrix/UserServiceHystrix.java

@@ -1,23 +0,0 @@
-package com.diagbot.client.hystrix;
-
-import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.User;
-import org.springframework.stereotype.Component;
-
-
-/**
- * @Description: 调用用户服务
- * @author: gaodm
- * @time: 2018/8/6 9:52
- */
-@Component
-public class UserServiceHystrix implements UserServiceClient {
-
-    @Override
-    public RespDTO<User> getUser(String token, String username) {
-        System.out.println(token);
-        System.out.println(username);
-        return null;
-    }
-}

+ 0 - 33
ltkg-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java

@@ -1,33 +0,0 @@
-package com.diagbot.config;
-
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-/**
- * @Description: MybatisPlus配置类
- * @author: gaodm
- * @time: 2018/8/2 13:39
- */
-@EnableTransactionManagement
-@Configuration
-@MapperScan("com.diagbot.mapper*")//这个注解,作用相当于下面的@Bean MapperScannerConfigurer,2者配置1份即可
-public class MybatisPlusConfigurer {
-
-    /**
-     * mybatis-plus分页插件<br>
-     * 文档:http://mp.baomidou.com<br>
-     */
-    @Bean
-    public PaginationInterceptor paginationInterceptor() {
-        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
-        // 设置请求的页面大于最大页后操作,true调回到首页,false继续请求,默认false
-        //paginationInterceptor.setOverflow(false);
-        // 设置最大单页限制数量,默认500条,-1不受限制
-        paginationInterceptor.setLimit(500L);
-        return paginationInterceptor;
-    }
-
-}

+ 2 - 2
ltkg-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -26,8 +26,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .csrf().disable()
                 .authorizeRequests()
                 .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
-                .antMatchers("/**").authenticated();
-        //        .antMatchers("/**").permitAll();
+//                .antMatchers("/**").authenticated();
+                .antMatchers("/**").permitAll();
     }
 
 

+ 20 - 20
ltkg-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -23,26 +23,26 @@ import java.util.Collection;
 public class UrlAccessDecisionManager implements AccessDecisionManager {
     @Override
     public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
-        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
-        String url, method;
-        if (matchPermitAllUrl(request)) {
-            return;
-        }
-        if ("anonymousUser".equals(authentication.getPrincipal())) {
-            throw new AccessDeniedException("no right");
-        } else {
-            for (GrantedAuthority ga : authentication.getAuthorities()) {
-                String[] authority = ga.getAuthority().split(";");
-                url = authority[0];
-                method = authority[1];
-                if (matchers(url, request)) {
-                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
-                        return;
-                    }
-                }
-            }
-        }
-        throw new AccessDeniedException("no right");
+//        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
+//        String url, method;
+//        if (matchPermitAllUrl(request)) {
+//            return;
+//        }
+//        if ("anonymousUser".equals(authentication.getPrincipal())) {
+//            throw new AccessDeniedException("no right");
+//        } else {
+//            for (GrantedAuthority ga : authentication.getAuthorities()) {
+//                String[] authority = ga.getAuthority().split(";");
+//                url = authority[0];
+//                method = authority[1];
+//                if (matchers(url, request)) {
+//                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
+//                        return;
+//                    }
+//                }
+//            }
+//        }
+//        throw new AccessDeniedException("no right");
     }
 
 

+ 0 - 196
ltkg-service/src/main/java/com/diagbot/entity/SysLog.java

@@ -1,196 +0,0 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 系统操作日志表
- * </p>
- *
- * @author gaodm
- * @since 2018-09-14
- */
-public class SysLog implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 日志ID
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 访问者的IP
-     */
-    private String ip;
-
-    /**
-     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
-     */
-    private Integer sysType;
-
-    /**
-     * 方法
-     */
-    private String method;
-
-    /**
-     * 操作名
-     */
-    private String operation;
-
-    /**
-     * 参数
-     */
-    private String params;
-
-    /**
-     * 用户名
-     */
-    private String username;
-
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getIp() {
-        return ip;
-    }
-
-    public void setIp(String ip) {
-        this.ip = ip;
-    }
-
-    public Integer getSysType() {
-        return sysType;
-    }
-
-    public void setSysType(Integer sysType) {
-        this.sysType = sysType;
-    }
-
-    public String getMethod() {
-        return method;
-    }
-
-    public void setMethod(String method) {
-        this.method = method;
-    }
-
-    public String getOperation() {
-        return operation;
-    }
-
-    public void setOperation(String operation) {
-        this.operation = operation;
-    }
-
-    public String getParams() {
-        return params;
-    }
-
-    public void setParams(String params) {
-        this.params = params;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    @Override
-    public String toString() {
-        return "SysLog{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", ip=" + ip +
-                ", sysType=" + sysType +
-                ", method=" + method +
-                ", operation=" + operation +
-                ", params=" + params +
-                ", username=" + username +
-                "}";
-    }
-}

+ 0 - 142
ltkg-service/src/main/java/com/diagbot/entity/User.java

@@ -1,142 +0,0 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 系统用户表
- * </p>
- *
- * @author gaodm
- * @since 2018-08-30
- */
-@TableName("sys_user")
-public class User implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 用户ID
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 用户密码
-     */
-    private String password;
-
-    /**
-     * 用户名
-     */
-    private String username;
-
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    @Override
-    public String toString() {
-        return "User{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", password=" + password +
-                ", username=" + username +
-                "}";
-    }
-}

+ 2 - 2
ltkg-service/src/main/java/com/diagbot/facade/SysLogFacade.java

@@ -1,6 +1,6 @@
 package com.diagbot.facade;
 
-import com.diagbot.service.impl.SysLogServiceImpl;
+import com.diagbot.service.impl.KgServiceImpl;
 import org.springframework.stereotype.Component;
 
 /**
@@ -9,5 +9,5 @@ import org.springframework.stereotype.Component;
  * @time: 2018/8/6 9:11
  */
 @Component
-public class SysLogFacade extends SysLogServiceImpl {
+public class KgFacade extends KgServiceImpl {
 }

+ 16 - 0
ltkg-service/src/main/java/com/diagbot/mapper/KgMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+public interface KgMapper {
+    List<Map> selectDisease();
+}

+ 0 - 16
ltkg-service/src/main/java/com/diagbot/mapper/SysLogMapper.java

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.entity.SysLog;
-
-/**
- * <p>
- * Mapper 接口
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-public interface SysLogMapper extends BaseMapper<SysLog> {
-
-}

+ 16 - 0
ltkg-service/src/main/java/com/diagbot/service/KgService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+public interface KgService {
+    List<Map> selectDisease();
+}

+ 0 - 15
ltkg-service/src/main/java/com/diagbot/service/SysLogService.java

@@ -1,15 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.SysLog;
-
-/**
- * <p>
- * 服务类
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-public interface SysLogService extends IService<SysLog> {
-}

+ 29 - 0
ltkg-service/src/main/java/com/diagbot/service/impl/KgServiceImpl.java

@@ -0,0 +1,29 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.mapper.KgMapper;
+import com.diagbot.service.KgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2018-08-02
+ */
+@Service
+public class KgServiceImpl implements KgService {
+    @Autowired
+    private KgMapper kgMapper;
+
+    @Override
+    public List<Map> selectDisease() {
+        return kgMapper.selectDisease();
+    }
+}

+ 0 - 19
ltkg-service/src/main/java/com/diagbot/service/impl/SysLogServiceImpl.java

@@ -1,19 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.SysLog;
-import com.diagbot.mapper.SysLogMapper;
-import com.diagbot.service.SysLogService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-@Service
-public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
-}

+ 39 - 0
ltkg-service/src/main/java/com/diagbot/web/KgController.java

@@ -0,0 +1,39 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.KgFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.integration.support.StringObjectMapBuilder;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 日志操作控制层
+ * @author: gaodm
+ * @time: 2018/8/30 10:12
+ */
+@RestController
+@RequestMapping("/kg")
+@Api(value = "朗通知识图谱API", tags = { "朗通知识图谱API" })
+public class KgController {
+
+    @Autowired
+    private KgFacade kgFacade;
+
+    @ApiOperation(value = "查看疾病", notes = "查看疾病")
+    @PostMapping("/selectDisease")
+    @SysLogger("selectDisease")
+    public RespDTO<List<Map>> selectDisease() {
+        return RespDTO.onSuc(kgFacade.selectDisease());
+    }
+}
+

+ 0 - 110
ltkg-service/src/main/java/com/diagbot/web/SysLogController.java

@@ -1,110 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.SysLog;
-import com.diagbot.facade.SysLogFacade;
-import com.diagbot.vo.SysLogVo;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Date;
-
-/**
- * @Description: 日志操作控制层
- * @author: gaodm
- * @time: 2018/8/30 10:12
- */
-@RestController
-@RequestMapping("/log")
-public class SysLogController {
-
-    @Autowired
-    private SysLogFacade sysLogFacade;
-
-    /**
-     * 新增日志信息
-     *
-     * @param sysLogVo 新增日志输入参数
-     * @return 新增日志是否成功
-     */
-    @ApiOperation(value = "添加日志", notes = "添加日志")
-    @PostMapping("/add")
-    @SysLogger("postLog")
-    public RespDTO add(@RequestBody SysLogVo sysLogVo) {
-        //初始化新增日志信息
-        SysLog sysLog = new SysLog();
-        sysLog.setGmtCreate(new Date());
-        sysLog.setIp(sysLogVo.getIp());
-        sysLog.setMethod(sysLogVo.getMethod());
-        sysLog.setOperation(sysLogVo.getOperation());
-        sysLog.setParams(sysLogVo.getParams());
-        return RespDTO.onSuc(sysLogFacade.save(sysLog) ? "添加成功" : "添加失败");
-    }
-
-    /**
-     * 删除日志
-     *
-     * @param id 日志信息ID
-     * @return 删除是否成功
-     */
-    @ApiOperation(value = "删除日志", notes = "删除日志")
-    @DeleteMapping("/delete/{id}")
-    @SysLogger("deleteLog")
-    public RespDTO delete(@PathVariable(value = "id") Integer id) {
-        return RespDTO.onSuc(sysLogFacade.removeById(id) ? "删除成功" : "删除失败");
-    }
-
-    /**
-     * 修改日志
-     *
-     * @param sysLog 修改日志输入参数
-     * @return 修改是否成功
-     */
-    @ApiOperation(value = "修改日志", notes = "修改日志")
-    @PostMapping("/update")
-    @SysLogger("updateLog")
-    public RespDTO update(@RequestBody SysLog sysLog) {
-        return RespDTO.onSuc(sysLogFacade.updateById(sysLog) ? "修改成功" : "修改失败");
-    }
-
-    /**
-     * 获取日志列表
-     *
-     * @return 日志列信息
-     */
-    @ApiOperation(value = "获取日志列表", notes = "获取日志列表")
-    @GetMapping("/list")
-    @SysLogger("listLog")
-    public RespDTO list() {
-        Wrapper<SysLog> wrapper = new QueryWrapper<>();
-        return RespDTO.onSuc(sysLogFacade.list(wrapper));
-    }
-
-    /**
-     * 获取日志翻页信息
-     *
-     * @return 日志翻页信息
-     */
-    @ApiOperation(value = "获取日志翻页信息", notes = "获取日志翻页信息")
-    @GetMapping("/page")
-    @SysLogger("pageLog")
-    public RespDTO page() {
-        //初始化日志翻页参数
-        IPage<SysLog> wrapper = new Page<>();
-        return RespDTO.onSuc(sysLogFacade.page(wrapper, null));
-    }
-}
-

+ 10 - 0
ltkg-service/src/main/resources/mapper/KgMapper.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.KgMapper">
+
+    <select id="selectDisease" resultType="java.util.Map">
+      MATCH (obj:`疾病名称`) RETURN obj LIMIT 25
+    </select>
+
+</mapper>

+ 0 - 22
ltkg-service/src/main/resources/mapper/SysLogMapper.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.diagbot.mapper.SysLogMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysLog">
-        <id column="id" property="id"/>
-        <result column="is_deleted" property="isDeleted"/>
-        <result column="gmt_create" property="gmtCreate"/>
-        <result column="gmt_modified" property="gmtModified"/>
-        <result column="creator" property="creator"/>
-        <result column="modifier" property="modifier"/>
-        <result column="ip" property="ip"/>
-        <result column="sys_type" property="sysType"/>
-        <result column="method" property="method"/>
-        <result column="operation" property="operation"/>
-        <result column="params" property="params"/>
-        <result column="username" property="username"/>
-    </resultMap>
-
-</mapper>