From 736d81119f5bc754d84c7f57c5b8d703e4899599 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 27 May 2020 00:53:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=96=87=E4=BB=B6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BB=A5=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E8=80=83=E8=99=91=EF=BC=9B=20=E4=BF=AE=E6=94=B9service?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=BC=80=E6=94=BE=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=96=B9=E6=B3=95=E5=8F=AF=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../synebula/gaea/domain/service/Service.kt | 10 +++--- .../com/synebula/gaea/io/file/FileManager.kt | 22 ------------ .../com/synebula/gaea/io/file/IFileManager.kt | 34 ------------------- 3 files changed, 5 insertions(+), 61 deletions(-) delete mode 100644 src/gaea/src/main/kotlin/com/synebula/gaea/io/file/FileManager.kt delete mode 100644 src/gaea/src/main/kotlin/com/synebula/gaea/io/file/IFileManager.kt diff --git a/src/gaea/src/main/kotlin/com/synebula/gaea/domain/service/Service.kt b/src/gaea/src/main/kotlin/com/synebula/gaea/domain/service/Service.kt index fde1df5..6996bcd 100644 --- a/src/gaea/src/main/kotlin/com/synebula/gaea/domain/service/Service.kt +++ b/src/gaea/src/main/kotlin/com/synebula/gaea/domain/service/Service.kt @@ -20,10 +20,10 @@ import com.synebula.gaea.log.ILogger * @since 2020-05-17 */ open class Service, TKey>( - protected var clazz: Class, - protected var repository: IRepository, - protected var converter: IObjectConverter, - override var logger: ILogger + protected open var clazz: Class, + protected open var repository: IRepository, + protected open var converter: IObjectConverter, + override var logger: ILogger ) : IService { override fun add(command: ICommand): Message { @@ -50,7 +50,7 @@ open class Service, TKey>( * @param command 需要转换的命令 * @return 聚合根 */ - protected fun convert(command: ICommand): TAggregateRoot { + protected open fun convert(command: ICommand): TAggregateRoot { try { return converter.convert(command, this.clazz) } catch (ex: Exception) { diff --git a/src/gaea/src/main/kotlin/com/synebula/gaea/io/file/FileManager.kt b/src/gaea/src/main/kotlin/com/synebula/gaea/io/file/FileManager.kt deleted file mode 100644 index ba8ed45..0000000 --- a/src/gaea/src/main/kotlin/com/synebula/gaea/io/file/FileManager.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.synebula.gaea.io.file - -import java.io.InputStream -import java.io.OutputStream - -class FileManager:IFileManager { - override fun write(name: String, stream: InputStream): String { - TODO("Not yet implemented") - } - - override fun read(path: String): OutputStream { - TODO("Not yet implemented") - } - - override fun rm(path: String): Boolean { - TODO("Not yet implemented") - } - - override fun mkdir(path: String, parents: Boolean) { - TODO("Not yet implemented") - } -} \ No newline at end of file diff --git a/src/gaea/src/main/kotlin/com/synebula/gaea/io/file/IFileManager.kt b/src/gaea/src/main/kotlin/com/synebula/gaea/io/file/IFileManager.kt deleted file mode 100644 index cafa7b6..0000000 --- a/src/gaea/src/main/kotlin/com/synebula/gaea/io/file/IFileManager.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.synebula.gaea.io.file - -import java.io.InputStream -import java.io.OutputStream - -interface IFileManager { - - /** - * 写入文件 - * @param name 需要写入文件的短名称 - * @param stream 二进制文件流 - * @return 文件的全路径 - */ - fun write(name: String, stream: InputStream): String - - /** - * 读取文件 - * @param path 需要读取文件的路径 - */ - fun read(path: String): OutputStream - - /** - * 删除文件 - * @path 需要删除文件的路径 - */ - fun rm(path: String): Boolean - - /** - * 创建目录 - * @param path 需要创建的目录 - * @param parents 如果没有父目录是否自动创建, 默认创建 - */ - fun mkdir(path: String, parents: Boolean = true) -} \ No newline at end of file