移除文件相关接口,以后再考虑; 修改service接口,开放部分属性方法可重写
This commit is contained in:
@@ -20,10 +20,10 @@ import com.synebula.gaea.log.ILogger
|
||||
* @since 2020-05-17
|
||||
*/
|
||||
open class Service<TAggregateRoot : IAggregateRoot<TKey>, TKey>(
|
||||
protected var clazz: Class<TAggregateRoot>,
|
||||
protected var repository: IRepository,
|
||||
protected var converter: IObjectConverter,
|
||||
override var logger: ILogger
|
||||
protected open var clazz: Class<TAggregateRoot>,
|
||||
protected open var repository: IRepository,
|
||||
protected open var converter: IObjectConverter,
|
||||
override var logger: ILogger
|
||||
) : IService<TKey> {
|
||||
|
||||
override fun add(command: ICommand): Message<TKey> {
|
||||
@@ -50,7 +50,7 @@ open class Service<TAggregateRoot : IAggregateRoot<TKey>, 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) {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user