Преглед на файлове

更正之前的一个controller 文件错误

tuonina преди 6 години
родител
ревизия
99aac0e786

+ 1 - 3
build.gradle

@@ -109,9 +109,7 @@ subprojects {
 
 
         //只因用shiro核心包
-        compile("org.apache.shiro:shiro-core:$shiro_version"){
-            exclude group:"org.apache.shiro"
-        }
+        compile("org.apache.shiro:shiro-spring:$shiro_version")
 
         compile("com.belerweb:pinyin4j:$pinyin4j_version")
 

BIN
classes/production/zen-web/META-INF/zen-web.kotlin_module


+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

+ 16 - 0
zen-core/src/main/java/cn/gygxzc/envir/core/orm/DataSourceConfiguration.java

@@ -0,0 +1,16 @@
+package cn.gygxzc.envir.core.orm;
+
+import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.datasource.init.DataSourceInitializer;
+
+/**
+ * Created by niantuo on 2018/12/13.
+ */
+@Configuration
+@AutoConfigureBefore(MybatisPlusAutoConfiguration.class)
+public class DataSourceConfiguration {
+
+
+}

+ 2 - 2
zen-core/src/main/kotlin/cn/gygxzc/envir/core/caffeine/CaffeineConfiguration.kt

@@ -19,13 +19,13 @@ import java.util.concurrent.TimeUnit
 @Configuration
 @EnableConfigurationProperties(CaffeineProperties::class)
 @ConditionalOnProperty(prefix = "cache.caffeine", name = arrayOf("enable"), havingValue = "true")
-class CaffeineConfiguration {
+open class CaffeineConfiguration {
 
     @Autowired
     private lateinit var properties: CaffeineProperties
 
     @Bean("caffeineCacheManager")
-    fun caffeineCacheManager(): CacheManager {
+   open fun caffeineCacheManager(): CacheManager {
         return SimpleCacheManager().also {
             it.setCaches(buildCache())
         }

+ 7 - 6
zen-core/src/main/kotlin/cn/gygxzc/envir/core/orm/MybatisPlusConfig.kt

@@ -18,24 +18,25 @@ import org.springframework.transaction.annotation.EnableTransactionManagement
  */
 @Configuration
 @EnableTransactionManagement
-class MybatisPlusConfig {
+open class MybatisPlusConfig {
 
 
     /**
      * 并不会自动注入
      */
     @Bean
-    fun physicalSqlInjector(): ISqlInjector {
+    open fun physicalSqlInjector(): ISqlInjector {
         return LogicMoreSqlInjector()
     }
 
 
     /**
      * 性能分析插件
+     * // 开发环境开启
      */
     @Bean
-    @Profile("dev") // 开发环境开启
-    fun performanceInterceptor(): PerformanceInterceptor {
+    @Profile("dev")
+    open fun performanceInterceptor(): PerformanceInterceptor {
         return PerformanceInterceptor().also { it.isFormat = true }
     }
 
@@ -43,12 +44,12 @@ class MybatisPlusConfig {
      * 分页插件
      */
     @Bean
-    fun paginationInterceptor(): PaginationInterceptor {
+    open fun paginationInterceptor(): PaginationInterceptor {
         return PaginationInterceptor()
     }
 
     @Bean
-    fun metaObjectHandler(): MetaObjectHandler {
+    open fun metaObjectHandler(): MetaObjectHandler {
         return CustomMetaObjectHandler()
     }
 

+ 1 - 1
zen-web/src/main/kotlin/cn/gygxzc/envir/MainApplication.kt

@@ -24,7 +24,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients
 @EnableJwtRedisSession
 @SpringBootApplication(scanBasePackages = ["cn.gygxzc.envir", "com.gxzc"], exclude = [RedisAutoConfiguration::class])
 @MapperScan(basePackages = ["cn.gygxzc.**.dao", "cn.gygxzc.**.mapper"])
-class MainApplication : SpringBootServletInitializer() {
+open class MainApplication : SpringBootServletInitializer() {
 
 
     override fun configure(builder: SpringApplicationBuilder?): SpringApplicationBuilder? {

+ 0 - 28
zen-web/src/main/kotlin/cn/gygxzc/envir/api/sys/controller/TokenController.java

@@ -1,28 +0,0 @@
-package cn.gygxzc.envir.api.sys.controller;
-
-import cn.gygxzc.cloud.tina.auth.annotation.ResourceApi;
-import cn.gygxzc.cloud.tina.auth.enums.ResourceLevel;
-import io.swagger.annotations.Api;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * Created by niantuo on 2018/11/1.
- * 检查是否登录,或者token是有有效
- */
-@RestController
-@RequestMapping("/token")
-@Api("检查Token的有效性")
-public class TokenController {
-
-    private Logger logger = LoggerFactory.getLogger(TokenController.class);
-
-    @GetMapping("/check")
-    @ResourceApi(name = "检查登陆状态", level = ResourceLevel.AUTHC)
-    public void check() {
-        logger.info("token 有效=》{}");
-    }
-}

+ 28 - 0
zen-web/src/main/kotlin/cn/gygxzc/envir/api/sys/controller/TokenController.kt

@@ -0,0 +1,28 @@
+package cn.gygxzc.envir.api.sys.controller
+
+import cn.gygxzc.cloud.tina.auth.annotation.ResourceApi
+import cn.gygxzc.cloud.tina.auth.enums.ResourceLevel
+import io.swagger.annotations.Api
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+/**
+ * Created by niantuo on 2018/11/1.
+ * 检查是否登录,或者token是有有效
+ */
+@RestController
+@RequestMapping("/token")
+@Api("检查Token的有效性")
+class TokenController {
+
+    private val logger = LoggerFactory.getLogger(TokenController::class.java)
+
+    @GetMapping("/check")
+    @ResourceApi(name = "检查登陆状态", level = ResourceLevel.AUTHC)
+    fun check() {
+        logger.info("token 有效=》{}")
+    }
+}

+ 3 - 3
zen-web/src/main/kotlin/cn/gygxzc/envir/config/EnvirWebMvcConfiguration.kt

@@ -17,7 +17,7 @@ import java.text.SimpleDateFormat
  *
  */
 @Configuration
-class EnvirWebMvcConfiguration : WebMvcConfigurer {
+open class EnvirWebMvcConfiguration : WebMvcConfigurer {
 
     companion object {
         const val CONVERTER_NAME = "hookMappingJackson2HttpMessageConverter"
@@ -37,7 +37,7 @@ class EnvirWebMvcConfiguration : WebMvcConfigurer {
     }
 
     @Bean(CONVERTER_NAME)
-    fun getConverter(): MappingJackson2HttpMessageConverter {
+    open fun getConverter(): MappingJackson2HttpMessageConverter {
         return MappingJackson2HttpMessageConverter().apply {
             this.objectMapper = builder().build()
         }
@@ -45,7 +45,7 @@ class EnvirWebMvcConfiguration : WebMvcConfigurer {
 
     @Bean
     @Primary
-    fun builder(): Jackson2ObjectMapperBuilder {
+    open fun builder(): Jackson2ObjectMapperBuilder {
         return Jackson2ObjectMapperBuilder().apply {
             serializerByType(java.lang.Long::class.java, ToStringSerializer.instance)
             serializerByType(java.lang.Long.TYPE, ToStringSerializer.instance)

+ 2 - 2
zen-web/src/main/kotlin/cn/gygxzc/envir/config/SwaggerConfiguration.kt

@@ -24,10 +24,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2
 @Configuration
 @EnableSwagger2
 @ConditionalOnProperty(prefix = "swagger", name = ["open"], havingValue = "true")
-class SwaggerConfiguration {
+open class SwaggerConfiguration {
 
     @Bean
-    fun createApi(): Docket {
+    open fun createApi(): Docket {
         return Docket(DocumentationType.SWAGGER_2)
                 .groupName("v1")
                 .apiInfo(apiInfo())

+ 3 - 2
zen-web/src/main/resources/application.yml

@@ -1,2 +1,3 @@
-
-
+spring:
+  main:
+    allow-bean-definition-overriding: true