Browse Source

修改精简代码

NorthLan 6 years ago
parent
commit
bc6a294e86

+ 0 - 1
.gitignore

@@ -148,7 +148,6 @@ out/
 
 
 # Gradle
-data/
 build/
 
 # bus

+ 4 - 0
build.gradle

@@ -26,6 +26,7 @@ buildscript {
         shiro_version = '1.4.0'
         dubbo_starter_version = '0.1.0'
         dubbo_version = "2.6.1"
+        jsqlparser_version = '1.2'
     }
     repositories {
         mavenCentral()
@@ -151,6 +152,9 @@ subprojects {
 
         compile("org.apache.velocity:velocity-engine-core:2.0")
 
+        // sql parser
+        compile("com.github.jsqlparser:jsqlparser:$jsqlparser_version")
+
         ext.jarTree = fileTree(dir: 'libs', include: '**/*.jar')
         compile jarTree
     }

+ 3 - 3
zen-api/src/main/kotlin/com/gxzc/zen/umps/config/ShiroConfig.kt

@@ -58,8 +58,8 @@ class ShiroConfig {
     fun shiroFilter(): ShiroFilterFactoryBean {
         return ShiroFilterFactoryBean().apply {
             securityManager = securityManager()
-//            loginUrl = "/login"
-//            unauthorizedUrl = "/unauthor"
+            //            loginUrl = "/login"
+            //            unauthorizedUrl = "/unauthor"
 
             filters = hashMapOf<String, Filter>(
                     "canon" to ZenCorsAnonymousFilter(),
@@ -85,7 +85,7 @@ class ShiroConfig {
             filterChainDefinitionMap = linkedMapOf<String, String>( // BUG 此处一定要使用 linkedHashMap 否则顺序有问题
                     "/auth/setcookie" to "canon", // 设置cookie
                     "/auth/check" to "canon", // 检查登录状态
-//                    "/auth/logout" to "logout", // 登出
+                    "/auth/logout" to "logout", // 登出
                     "/test/**" to "canon", // 测试 免登录
                     "/upload/**" to "canon", // 上传免登录
                     "/api/**" to "canon", // api 免登陆

+ 9 - 0
zen-orm/src/main/kotlin/com/gxzc/zen/orm/config/MybatisPlusConfig.kt → zen-web/src/main/kotlin/com/gxzc/zen/orm/config/MybatisPlusConfig.kt

@@ -1,6 +1,7 @@
 package com.gxzc.zen.orm.config
 
 import com.baomidou.mybatisplus.plugins.PaginationInterceptor
+import com.gxzc.zen.orm.data.authority.interceptor.ZenDataAuthorityInterceptor
 import org.mybatis.spring.annotation.MapperScan
 import org.springframework.context.annotation.Bean
 import org.springframework.context.annotation.Configuration
@@ -29,4 +30,12 @@ class MybatisPlusConfig {
     fun paginationInterceptor(): PaginationInterceptor {
         return PaginationInterceptor()
     }
+
+    /**
+     * 数据权限插件
+     */
+    @Bean
+    fun zenDataAuthorityInterceptor(): ZenDataAuthorityInterceptor {
+        return ZenDataAuthorityInterceptor()
+    }
 }

+ 11 - 0
zen-web/src/main/kotlin/com/gxzc/zen/web/sys/controller/TestController.kt

@@ -1,7 +1,9 @@
 package com.gxzc.zen.web.sys.controller
 
+import com.gxzc.zen.api.sys.service.ISysUploadInfoService
 import com.gxzc.zen.api.util.SysDictUtil
 import com.gxzc.zen.common.base.BaseController
+import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.http.ResponseEntity
 import org.springframework.web.bind.annotation.GetMapping
 import org.springframework.web.bind.annotation.RequestMapping
@@ -21,4 +23,13 @@ class TestController : BaseController() {
     fun get(): ResponseEntity<*> {
         return ResponseEntity.ok(SysDictUtil.getAll())
     }
+
+
+    @Autowired
+    private lateinit var sysUploadInfoService: ISysUploadInfoService
+
+    @GetMapping("b")
+    fun getb(): ResponseEntity<*> {
+        return ResponseEntity.ok(sysUploadInfoService.selectList(null))
+    }
 }

+ 1 - 1
zen-web/src/main/resources/application-orm.yml

@@ -15,7 +15,7 @@ mybatis-plus:
     cache-enabled: true #配置的缓存的全局开关
     lazyLoadingEnabled: true #延时加载的开关
     multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
-    interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor
+    interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor, com.gxzc.zen.orm.data.authority.interceptor.ZenDataAuthorityInterceptor
     # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
 
 ---

+ 1 - 1
zen-web/src/main/resources/application-rpc.yml

@@ -1,7 +1,7 @@
 spring:
   profiles: dev
 dubbo:
-  enabled: true
+  enabled: false
   application:
     name: zen-sys
     id: zen-sys

+ 1 - 1
zen-web/src/main/resources/application.yml

@@ -18,7 +18,7 @@ spring:
     name: Zen
 
 server:
-  port: 10000
+  port: 10001
 
 zen:
   swagger-open: true # swagger-ui是否开启