Browse Source

Merge branch 'master' into dev

NorthLan 6 years ago
parent
commit
6a2a6125cd
25 changed files with 502 additions and 269 deletions
  1. 5 0
      zen-api/src/main/kotlin/com/gxzc/zen/rpc/api/sys/RDictService.kt
  2. 52 0
      zen-core/src/main/kotlin/com/gxzc/zen/common/dto/UploadFileInfo.kt
  3. 81 0
      zen-web/src/main/kotlin/com/gxzc/zen/web/sys/controller/UploadController.kt
  4. 81 0
      zen-web/src/main/kotlin/com/gxzc/zen/web/sys/util/UploadCacheUtil.kt
  5. 0 47
      zen-web/src/main/resources/application-cache-prod.yml
  6. 41 20
      zen-web/src/main/resources/application-cache.yml
  7. 0 12
      zen-web/src/main/resources/application-job-dev.yml
  8. 0 12
      zen-web/src/main/resources/application-job-prod.yml
  9. 30 0
      zen-web/src/main/resources/application-job.yml
  10. 0 16
      zen-web/src/main/resources/application-mq-dev.yml
  11. 0 16
      zen-web/src/main/resources/application-mq-prod.yml
  12. 36 0
      zen-web/src/main/resources/application-mq.yml
  13. 0 38
      zen-web/src/main/resources/application-orm-prod.yml
  14. 42 21
      zen-web/src/main/resources/application-orm.yml
  15. 0 2
      zen-web/src/main/resources/application-platform-dev.yml
  16. 0 2
      zen-web/src/main/resources/application-platform-prod.yml
  17. 10 0
      zen-web/src/main/resources/application-platform.yml
  18. 0 20
      zen-web/src/main/resources/application-rpc-dev.yml
  19. 0 20
      zen-web/src/main/resources/application-rpc-prod.yml
  20. 46 0
      zen-web/src/main/resources/application-rpc.yml
  21. 0 20
      zen-web/src/main/resources/application-umps-dev.yml
  22. 0 20
      zen-web/src/main/resources/application-umps-prod.yml
  23. 42 0
      zen-web/src/main/resources/application-umps.yml
  24. 34 0
      zen-web/src/main/resources/application-upload.yml
  25. 2 3
      zen-web/src/main/resources/application.yml

+ 5 - 0
zen-api/src/main/kotlin/com/gxzc/zen/rpc/api/sys/RDictService.kt

@@ -28,4 +28,9 @@ interface RDictService {
      * 根据code前缀与value获取指定字典值
      */
     fun getDictValueByPrefixAndValue(prefix: String, value: String): SysDictValue?
+
+    /**
+     * 根据code值取出指定字典值
+     */
+    fun getDictValueByCode(code: String): SysDictValue?
 }

+ 52 - 0
zen-core/src/main/kotlin/com/gxzc/zen/common/dto/UploadFileInfo.kt

@@ -0,0 +1,52 @@
+package com.gxzc.zen.common.dto
+
+import java.io.Serializable
+import java.util.*
+
+/**
+ * 上传的文件信息(本地)
+ * @author NorthLan
+ * @date 2018/7/3
+ * @url https://noahlan.com
+ */
+open class UploadFileInfo : Serializable {
+    companion object {
+        private const val serialVersionUID = 100000000000002L
+    }
+
+    /**
+     * 当前虚拟文件名
+     */
+    var filename: String? = null
+    /**
+     * 真实文件名
+     */
+    var realFilename: String? = null
+    /**
+     * 原始文件名
+     */
+    var originFilename: String? = null
+    /**
+     * 虚拟相对路径
+     */
+    var relativePath: String? = null
+    /**
+     * 最后一次修改时间
+     */
+    var lastModified: Date? = null
+    /**
+     * 文件非完整md5(头+[尾]+修改时间)
+     */
+    var md5: String? = null
+    /**
+     * 后缀名
+     */
+    var extension: String? = null
+    /**
+     * 文件大小(byte)
+     */
+    var filesize: Long? = null
+
+    ////////////////////// url
+    var url: String? = null
+}

+ 81 - 0
zen-web/src/main/kotlin/com/gxzc/zen/web/sys/controller/UploadController.kt

@@ -0,0 +1,81 @@
+package com.gxzc.zen.web.sys.controller
+
+import com.gxzc.zen.common.base.BaseController
+import com.gxzc.zen.common.dto.ZenFileMetadata
+import com.gxzc.zen.common.exception.ZenException
+import com.gxzc.zen.common.util.UploadUtil
+import com.gxzc.zen.web.sys.util.UploadCacheUtil
+import io.swagger.annotations.ApiOperation
+import org.slf4j.LoggerFactory
+import org.springframework.http.HttpStatus
+import org.springframework.http.ResponseEntity
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import org.springframework.web.multipart.MultipartFile
+
+/**
+ * 上传文件 控制器
+ * @author NorthLan
+ * @date 2018/5/19
+ * @url https://noahlan.com
+ */
+@RestController
+@RequestMapping("/upload")
+class UploadController : BaseController() {
+    companion object {
+        private val logger = LoggerFactory.getLogger(UploadController::class.java)
+    }
+
+    @ApiOperation("获取已上传分片列表")
+    @GetMapping
+    fun checkChunk(fileMetadata: ZenFileMetadata): ResponseEntity<*> {
+        // 检查已上传文件分片
+        val ret = UploadUtil.checkUpload(fileMetadata)
+        return if (ret.uploadedChunks != null) {
+            when (ret.status) {
+            // 单文件完成,插入数据库
+                UploadUtil.STATUS.UPLOADED -> UploadCacheUtil.addUploadFileInfo(fileMetadata, ret.file!!)
+            // 批次完成,将最后个文件插入 而后取出所有本批次文件信息
+                UploadUtil.STATUS.BATCH_UPLOADED -> {
+                    UploadCacheUtil.addUploadFileInfo(fileMetadata, ret.file!!)
+                    ret.info = UploadCacheUtil.getUploadInfosByBatchId(fileMetadata.batchId!!)
+                    UploadCacheUtil.evictCache(fileMetadata.batchId!!)
+                }
+            }
+            ResponseEntity.ok(ret)
+        } else {
+            ResponseEntity.status(204).body(ret)
+        }
+    }
+
+    @ApiOperation("上传", notes = "支持小文件上传,大文件分片上传(统一分片)")
+    @PostMapping
+    fun upload(fileMetadata: ZenFileMetadata, file: MultipartFile?): ResponseEntity<*> {
+        if (file == null) {
+            return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE.value()).body(null)
+        }
+        val uploadResponse = try {
+            UploadUtil.upload(fileMetadata, file)
+        } catch (e: ZenException) {
+            null
+        }
+
+        return if (uploadResponse != null) {
+            when (uploadResponse.status) {
+            // 单文件完成,插入数据库
+                UploadUtil.STATUS.UPLOADED -> UploadCacheUtil.addUploadFileInfo(fileMetadata, uploadResponse.file!!)
+            // 批次完成,将最后个文件插入 而后取出所有本批次文件信息
+                UploadUtil.STATUS.BATCH_UPLOADED -> {
+                    UploadCacheUtil.addUploadFileInfo(fileMetadata, uploadResponse.file!!)
+                    uploadResponse.info = UploadCacheUtil.getUploadInfosByBatchId(fileMetadata.batchId!!)
+                    UploadCacheUtil.evictCache(fileMetadata.batchId!!)
+                }
+            }
+            ResponseEntity.ok(uploadResponse)
+        } else {
+            ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE.value()).body(null)
+        }
+    }
+}

+ 81 - 0
zen-web/src/main/kotlin/com/gxzc/zen/web/sys/util/UploadCacheUtil.kt

@@ -0,0 +1,81 @@
+package com.gxzc.zen.web.sys.util
+
+import com.github.benmanes.caffeine.cache.Caffeine
+import com.gxzc.zen.common.dto.UploadFileInfo
+import com.gxzc.zen.common.dto.ZenFileMetadata
+import org.apache.commons.io.FilenameUtils
+import org.springframework.cache.caffeine.CaffeineCache
+import java.io.File
+import java.util.*
+import java.util.concurrent.TimeUnit
+
+/**
+ *
+ * @author NorthLan
+ * @date 2018/7/3
+ * @url https://noahlan.com
+ */
+@Suppress("UNCHECKED_CAST")
+object UploadCacheUtil {
+    private val batchFileMap = CaffeineCache("batchFileMap", Caffeine.newBuilder().expireAfterWrite(1L, TimeUnit.HOURS).build(), true) // 文件批量上传批次实际文件信息
+
+    private fun getBatchFileList(batchId: String): MutableList<UploadFileInfo>? {
+        return batchFileMap[batchId]?.get() as? MutableList<UploadFileInfo>
+    }
+
+    private fun addFileInfo(fileInfo: UploadFileInfo, batchId: String) {
+        var fileList = getBatchFileList(batchId)
+        if (fileList == null) {
+            fileList = mutableListOf()
+            batchFileMap.put(batchId, fileList)
+        }
+        fileList.add(fileInfo)
+    }
+
+    /**
+     * 添加文件数据
+     */
+    fun addUploadFileInfo(fileMetadata: ZenFileMetadata, file: File) {
+        val entity = UploadFileInfo().apply {
+            // filename
+            this.filename = if (fileMetadata.rename.isNullOrEmpty()) {
+                fileMetadata.filename
+            } else {
+                "${FilenameUtils.removeExtension(fileMetadata.rename)}.${FilenameUtils.getExtension(fileMetadata.filename)}"
+            }
+            this.realFilename = file.name
+            this.originFilename = fileMetadata.filename
+            // infomation
+            this.relativePath = if (fileMetadata.repath.isNullOrEmpty()) fileMetadata.relativePath?.replace(this.originFilename!!, "") else fileMetadata.repath
+            this.lastModified = Date(file.lastModified())
+            this.md5 = fileMetadata.md5
+            this.extension = FilenameUtils.getExtension(file.name)
+            this.filesize = fileMetadata.totalSize
+        }
+        addFileInfo(entity, fileMetadata.batchId!!)
+    }
+
+    /**
+     * 获取某上传批次所有文件数据
+     */
+    fun getUploadInfosByBatchId(batchId: String): MutableList<UploadFileInfo> {
+        val ret = getBatchFileList(batchId) ?: mutableListOf()
+        ret.forEach {
+            generateURL(it)
+        }
+        return ret
+    }
+
+    /**
+     * 清理缓存
+     */
+    fun evictCache(batchId: String) {
+        batchFileMap.evict(batchId)
+    }
+
+    private fun generateURL(it: UploadFileInfo?) {
+        if (it != null) {
+            it.url = "/${it.realFilename}"
+        }
+    }
+}

+ 0 - 47
zen-web/src/main/resources/application-cache-prod.yml

@@ -1,47 +0,0 @@
-############## cache 配置 ##############
-spring:
-  cache:
-    type: redis # 使用什么作为缓存框架
-    # type: caffeine
-    caffeine:
-      spec:
-  redis:
-    database: 0 # redis数据库索引
-    host: 10.214.38.177
-    port: 6379
-    password:
-    timeout: 5000 # 连接超时时间(毫秒)
-    pool:
-      min-idle: 1 # 连接池中的最小空闲连接
-      max-idle: 20 # 连接池中的最大空闲连接
-      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
-      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-
-cache:
-  caffeine:
-  ################ cache配置说明 以下配置均为默认值(不填即默认) #######################
-  # initialCapacity: -1 # 初始化容量 默认-1
-  # maximumSize: -1 # 最大容量 默认-1 超出部分TinyLfu移除
-  # maximumWeight: -1 # 最大权重,与maximumSize冲突
-  # expireAfterAccess: -1 # 最后一次写入或访问后经过固定时间过期 以expireAfterWrite为准
-  # expireAfterWrite: -1 # 最后一次写入后经过固定时间过期
-  # refreshAfterWrite: -1 # 创建缓存或者最近一次更新缓存后经过固定的时间间隔刷新缓存
-  # recordStats: false # 开发统计功能
-  # weakKeys: false # 该key是否为弱引用
-  # weakValues: false # 该key对应的values是否为弱引用 与softValues冲突
-  # softValues: false # 该key对应的values是否为软引用
-  #################################################################################
-    enable: false
-    cache-specs: # see also {CaffeineSpec}
-      user: # cache name
-        initialCapacity: -1 # 初始化容量 默认-1
-        maximumSize: 100 # 最大容量
-      user_perm: # cache name
-        initialCapacity: -1 # 初始化容量 默认-1
-        maximumSize: 100 # 最大容量
-      user_role: # cache name
-        initialCapacity: -1 # 初始化容量 默认-1
-        maximumSize: 100 # 最大容量
-      sys: # cache name
-        initialCapacity: -1 # 初始化容量 默认-1
-        maximumSize: 128 # 最大容量]

+ 41 - 20
zen-web/src/main/resources/application-cache-dev.yml → zen-web/src/main/resources/application-cache.yml

@@ -1,22 +1,3 @@
-############## cache 配置 ##############
-spring:
-  cache:
-    type: redis # 使用什么作为缓存框架
-    # type: caffeine
-    caffeine:
-      spec:
-  redis:
-    database: 0 # redis数据库索引
-    host: 192.168.1.10
-    port: 6379
-    password:
-    timeout: 5000 # 连接超时时间(毫秒)
-    pool:
-      min-idle: 1 # 连接池中的最小空闲连接
-      max-idle: 20 # 连接池中的最大空闲连接
-      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
-      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-
 cache:
   caffeine:
   ################ cache配置说明 以下配置均为默认值(不填即默认) #######################
@@ -44,4 +25,44 @@ cache:
         maximumSize: 100 # 最大容量
       sys: # cache name
         initialCapacity: -1 # 初始化容量 默认-1
-        maximumSize: 128 # 最大容量]
+        maximumSize: 128 # 最大容量]
+
+---
+spring:
+  profiles: dev
+  cache:
+    type: redis # 使用什么作为缓存框架
+    # type: caffeine
+    caffeine:
+      spec:
+  redis:
+    database: 0 # redis数据库索引
+    host: 192.168.1.10
+    port: 6379
+    password:
+    timeout: 5000 # 连接超时时间(毫秒)
+    pool:
+      min-idle: 1 # 连接池中的最小空闲连接
+      max-idle: 20 # 连接池中的最大空闲连接
+      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
+      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+
+---
+spring:
+  profiles: prod
+  cache:
+    type: redis # 使用什么作为缓存框架
+    # type: caffeine
+    caffeine:
+      spec:
+  redis:
+    database: 0 # redis数据库索引
+    host: 127.0.0.1
+    port: 6379
+    password:
+    timeout: 5000 # 连接超时时间(毫秒)
+    pool:
+      min-idle: 1 # 连接池中的最小空闲连接
+      max-idle: 20 # 连接池中的最大空闲连接
+      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
+      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)

+ 0 - 12
zen-web/src/main/resources/application-job-dev.yml

@@ -1,12 +0,0 @@
-xxl:
-  job:
-    enable: false
-    admin:
-      address: http://127.0.0.1:8090
-    executor:
-      appname: xxl-job-sys
-      ip: 0.0.0.0
-      port: 10001
-      logpath: /data/applogs/xxl-job/jobhandler
-      logretentiondays: -1
-    accessToken:

+ 0 - 12
zen-web/src/main/resources/application-job-prod.yml

@@ -1,12 +0,0 @@
-xxl:
-  job:
-    enable: false
-    admin:
-      address: http://127.0.0.1:8090
-    executor:
-      appname: xxl-job-sys
-      ip: 0.0.0.0
-      port: 10001
-      logpath: /data/applogs/xxl-job/jobhandler
-      logretentiondays: -1
-    accessToken:

+ 30 - 0
zen-web/src/main/resources/application-job.yml

@@ -0,0 +1,30 @@
+spring:
+  profiles: dev
+xxl:
+  job:
+    enable: false
+    admin:
+      address: http://127.0.0.1:8090
+    executor:
+      appname: xxl-job-sys
+      ip: 0.0.0.0
+      port: 10001
+      logpath: /data/applogs/xxl-job/jobhandler
+      logretentiondays: -1
+    accessToken:
+
+---
+spring:
+  profiles: prod
+xxl:
+  job:
+    enable: false
+    admin:
+      address: http://127.0.0.1:8090
+    executor:
+      appname: xxl-job-sys
+      ip: 0.0.0.0
+      port: 10001
+      logpath: /data/applogs/xxl-job/jobhandler
+      logretentiondays: -1
+    accessToken:

+ 0 - 16
zen-web/src/main/resources/application-mq-dev.yml

@@ -1,16 +0,0 @@
-spring:
-  rabbitmq:
-    enable: false
-    host: localhost
-    port: 5672
-    username: admin
-    password: admin
-    publisher-confirms: true
-    publisher-returns: true
-    template:
-      mandatory: true
-    listener:
-      simple:
-        concurrency: 2 # 最小消息监听线程数
-        max-concurrency: 2 # 最大消息监听线程数
-    virtual-host: /

+ 0 - 16
zen-web/src/main/resources/application-mq-prod.yml

@@ -1,16 +0,0 @@
-spring:
-  rabbitmq:
-    enable: false
-    host: localhost
-    port: 5672
-    username: admin
-    password: admin
-    publisher-confirms: true
-    publisher-returns: true
-    template:
-      mandatory: true
-    listener:
-      simple:
-        concurrency: 2 # 最小消息监听线程数
-        max-concurrency: 2 # 最大消息监听线程数
-    virtual-host: /

+ 36 - 0
zen-web/src/main/resources/application-mq.yml

@@ -0,0 +1,36 @@
+spring:
+  profiles: dev
+  rabbitmq:
+    enable: false
+    host: localhost
+    port: 5672
+    username: admin
+    password: admin
+    publisher-confirms: true
+    publisher-returns: true
+    template:
+      mandatory: true
+    listener:
+      simple:
+        concurrency: 2 # 最小消息监听线程数
+        max-concurrency: 2 # 最大消息监听线程数
+    virtual-host: /
+
+---
+spring:
+  profiles: prod
+  rabbitmq:
+    enable: false
+    host: localhost
+    port: 5672
+    username: admin
+    password: admin
+    publisher-confirms: true
+    publisher-returns: true
+    template:
+      mandatory: true
+    listener:
+      simple:
+        concurrency: 2 # 最小消息监听线程数
+        max-concurrency: 2 # 最大消息监听线程数
+    virtual-host: /

+ 0 - 38
zen-web/src/main/resources/application-orm-prod.yml

@@ -1,38 +0,0 @@
-################## Alibaba Druid 配置 ##################
-spring:
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    druid:
-      stat-view-servlet:
-        enabled: true
-        login-username: root
-        login-password: root
-        reset-enable: false
-      test-on-borrow: true
-      test-on-return: false
-      test-while-idle: true
-    driver-class-name: com.mysql.jdbc.Driver
-    username: archives
-    password: archives
-    url: jdbc:mysql://10.214.38.177:8066/SYS?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
-# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
-
-###################  mybatis-plus配置  ###################
-mybatis-plus:
-  mapper-locations: classpath*:mapping/**/*.xml
-  type-aliases-package: com.gxzc.zen.api.sys.mapper,com.gxzc.zen.api.biz.mapper
-  global-config:
-    id-type: 0  #0:数据库ID自增   1:用户输入id  2:全局唯一id(IdWorker)  3:全局唯一ID(uuid)
-    db-column-underline: true
-    refresh-mapper: true
-    logic-delete-value: 0
-    logic-not-delete-value: 1
-    sql-injector: com.gxzc.zen.orm.sql.ZenSqlInjector # 自定义injector
-    meta-object-handler: com.gxzc.zen.orm.CustomMetaObjectHandler
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: true #配置的缓存的全局开关
-    lazyLoadingEnabled: true #延时加载的开关
-    multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
-    interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor
-    # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用

+ 42 - 21
zen-web/src/main/resources/application-orm-dev.yml → zen-web/src/main/resources/application-orm.yml

@@ -1,26 +1,7 @@
-################## Alibaba Druid 配置 ##################
-spring:
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    druid:
-      stat-view-servlet:
-        enabled: true
-        login-username: root
-        login-password: root
-        reset-enable: false
-      test-on-borrow: true
-      test-on-return: false
-      test-while-idle: true
-    driver-class-name: com.mysql.jdbc.Driver
-    username: archives
-    password: archives
-    url: jdbc:mysql://192.168.1.10:3306/archives_common?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
-# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
-
 ###################  mybatis-plus配置  ###################
 mybatis-plus:
   mapper-locations: classpath*:mapping/**/*.xml
-  type-aliases-package: com.gxzc.zen.api.sys.mapper,com.gxzc.zen.api.biz.mapper
+  type-aliases-package: com.gxzc.zen.api.sys.mapper
   global-config:
     id-type: 0  #0:数据库ID自增   1:用户输入id  2:全局唯一id(IdWorker)  3:全局唯一ID(uuid)
     db-column-underline: true
@@ -35,4 +16,44 @@ mybatis-plus:
     lazyLoadingEnabled: true #延时加载的开关
     multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
     interceptors: com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor, com.baomidou.mybatisplus.plugins.PaginationInterceptor
-    # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
+    # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
+
+---
+spring:
+  profiles: dev
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      stat-view-servlet:
+        enabled: true
+        login-username: root
+        login-password: root
+        reset-enable: false
+      test-on-borrow: true
+      test-on-return: false
+      test-while-idle: true
+    driver-class-name: com.mysql.jdbc.Driver
+    username: archives
+    password: archives
+    url: jdbc:mysql://192.168.1.10:3306/archives_sys?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
+# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
+
+---
+spring:
+  profiles: prod
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      stat-view-servlet:
+        enabled: true
+        login-username: root
+        login-password: root
+        reset-enable: false
+      test-on-borrow: true
+      test-on-return: false
+      test-while-idle: true
+    driver-class-name: com.mysql.jdbc.Driver
+    username: archives
+    password: archives
+    url: jdbc:mysql://rm-wz9on0bqphwygm14j.mysql.rds.aliyuncs.com:3306/archives_sys?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
+# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

+ 0 - 2
zen-web/src/main/resources/application-platform-dev.yml

@@ -1,2 +0,0 @@
-platform:
-  id: 1 # 平台ID (0:通用,1:系统,2:接收,3:保存,4:管理,5:利用,6:库存)

+ 0 - 2
zen-web/src/main/resources/application-platform-prod.yml

@@ -1,2 +0,0 @@
-platform:
-  id: 1 # 平台ID (0:通用,1:系统,2:接收,3:保存,4:管理,5:利用,6:库存)

+ 10 - 0
zen-web/src/main/resources/application-platform.yml

@@ -0,0 +1,10 @@
+spring:
+  profiles: dev
+platform:
+  id: 1 # 平台ID (0:通用,1:系统,2:接收,3:保存,4:管理,5:利用,6:库存)
+
+---
+spring:
+  profiles: prod
+platform:
+  id: 1 # 平台ID (0:通用,1:系统,2:接收,3:保存,4:管理,5:利用,6:库存)

+ 0 - 20
zen-web/src/main/resources/application-rpc-dev.yml

@@ -1,20 +0,0 @@
-dubbo:
-  enabled: true
-  application:
-    name: zen-xxx # 业务模块名称,必须区分开来
-    id: zen-xxx # 系统:sys 收:rec 存:save 管:mgr 用:util 库:inv
-  scan:
-    base-packages: com.gxzc.zen.rpc.provider
-  protocol:
-    id: dubbo
-    name: dubbo
-    port: -1
-  registry:
-    address: 192.168.1.10:2181
-    protocol: zookeeper
-    client: curator
-    id: zen-reg
-  consumer:
-    check: false
-    lazy: true
-    timeout: 300000

+ 0 - 20
zen-web/src/main/resources/application-rpc-prod.yml

@@ -1,20 +0,0 @@
-dubbo:
-  enabled: false
-  application:
-    name: zen-dubbo
-    id: zen-dubbo
-  scan:
-    base-packages: com.gxzc.zen.rpc.provider
-  protocol:
-    id: dubbo
-    name: dubbo
-    port: -1
-  registry:
-    address: 192.168.1.10:2181
-    protocol: zookeeper
-    client: curator
-    id: zen-reg
-  consumer:
-    check: false
-    lazy: true
-    timeout: 300000

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

@@ -0,0 +1,46 @@
+spring:
+  profiles: dev
+dubbo:
+  enabled: true
+  application:
+    name: zen-sys
+    id: zen-sys
+  scan:
+    base-packages: com.gxzc.zen.rpc.provider
+  protocol:
+    id: dubbo
+    name: dubbo
+    port: -1
+  registry:
+    address: 192.168.1.10:2181
+    protocol: zookeeper
+    client: curator
+    id: zen-reg
+  consumer:
+    check: false
+    lazy: true
+    timeout: 300000
+
+---
+spring:
+  profiles: prod
+dubbo:
+  enabled: true
+  application:
+    name: zen-sys
+    id: zen-sys
+  scan:
+    base-packages: com.gxzc.zen.rpc.provider
+  protocol:
+    id: dubbo
+    name: dubbo
+    port: -1
+  registry:
+    address: 127.0.0.1:2181
+    protocol: zookeeper
+    client: curator
+    id: zen-reg
+  consumer:
+    check: false
+    lazy: true
+    timeout: 300000

+ 0 - 20
zen-web/src/main/resources/application-umps-dev.yml

@@ -1,20 +0,0 @@
-shiro:
-  redis:
-    database: 1 # redis数据库索引
-    host: 192.168.1.10
-    port: 6379
-    password:
-    timeout: 5000 # 连接超时时间(毫秒)
-    sessionPrefix: zen_s #
-    sessionTime: 604800 # 秒 7天
-    cachePrefix: zen_c
-    cacheTime: 604800 # s
-    pool:
-      min-idle: 1 # 连接池中的最小空闲连接
-      max-idle: 20 # 连接池中的最大空闲连接
-      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
-      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-
-spring:
-  session:
-    store-type: redis

+ 0 - 20
zen-web/src/main/resources/application-umps-prod.yml

@@ -1,20 +0,0 @@
-shiro:
-  redis:
-    database: 1 # redis数据库索引
-    host: 10.214.38.177
-    port: 6379
-    password:
-    timeout: 5000 # 连接超时时间(毫秒)
-    sessionPrefix: zen_s #
-    sessionTime: 604800 # 秒 7天
-    cachePrefix: zen_c
-    cacheTime: 604800 # s
-    pool:
-      min-idle: 1 # 连接池中的最小空闲连接
-      max-idle: 20 # 连接池中的最大空闲连接
-      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
-      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
-
-spring:
-  session:
-    store-type: redis

+ 42 - 0
zen-web/src/main/resources/application-umps.yml

@@ -0,0 +1,42 @@
+spring:
+  profiles: dev
+  session:
+    store-type: redis
+shiro:
+  redis:
+    database: 1 # redis数据库索引
+    host: 192.168.1.10
+    port: 6379
+    password:
+    timeout: 5000 # 连接超时时间(毫秒)
+    sessionPrefix: zen_s #
+    sessionTime: 604800 # 秒 7天
+    cachePrefix: zen_c
+    cacheTime: 604800 # s
+    pool:
+      min-idle: 1 # 连接池中的最小空闲连接
+      max-idle: 20 # 连接池中的最大空闲连接
+      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
+      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+
+---
+spring:
+  profiles: prod
+  session:
+    store-type: redis
+shiro:
+  redis:
+    database: 1 # redis数据库索引
+    host: 127.0.0.1
+    port: 6379
+    password:
+    timeout: 5000 # 连接超时时间(毫秒)
+    sessionPrefix: zen_s #
+    sessionTime: 604800 # 秒 7天
+    cachePrefix: zen_c
+    cacheTime: 604800 # s
+    pool:
+      min-idle: 1 # 连接池中的最小空闲连接
+      max-idle: 20 # 连接池中的最大空闲连接
+      max-active: 20 # 连接池最大连接数(使用负值表示没有限制)
+      max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)

+ 34 - 0
zen-web/src/main/resources/application-upload.yml

@@ -0,0 +1,34 @@
+spring:
+  profiles: dev
+  http:
+    multipart:
+      enabled: true
+      max-request-size: 50MB #最大请求大小
+      max-file-size: 25MB #最大文件大小
+      location: ${java.io.tmpdir}
+      file-size-threshold: 5MB
+
+# 自定义配置
+upload:
+  tmpPath: D:\\tmp # 临时文件存放位置 默认 /tmp/zen
+  dataPath: D:\\data
+  maxFileSize: 4294967296 # 单位 byte 为0表示无限制
+  chunkSize: 10485760 # 10*1024*1024 = 10MB
+
+---
+spring:
+  profiles: prod
+  http:
+    multipart:
+      enabled: true
+      max-request-size: 50MB #最大请求大小
+      max-file-size: 25MB #最大文件大小
+      location: ${java.io.tmpdir}
+      file-size-threshold: 5MB
+
+# 自定义配置
+upload:
+  tmpPath: /tmp # 临时文件存放位置 默认 /tmp/zen
+  dataPath: /archives/upload
+  maxFileSize: 4294967296 # 单位 byte 为0表示无限制
+  chunkSize: 10485760 # 10*1024*1024 = 10MB

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

@@ -1,8 +1,7 @@
 spring:
   profiles:
     active: dev
-    include: orm-dev,rpc-dev,mq-dev,cache-dev,umps-dev,platform-dev,job-dev
-#    include: orm-mycat-prod,rpc-prod,mq-prod,cache-prod,umps-prod,platform-prod,job-prod
+    include: orm,rpc,mq,cache,umps,platform,job,upload
 ---
 spring:
   profiles: dev
@@ -19,7 +18,7 @@ spring:
     name: Zen
 
 server:
-  port: 8868
+  port: 10000
 
 zen:
   swagger-open: true # swagger-ui是否开启