修改Message的success属性为方法

This commit is contained in:
2021-04-01 22:44:21 +08:00
parent 0dd1d09916
commit 0c33f6a919
2 changed files with 3 additions and 5 deletions

View File

@@ -9,9 +9,7 @@ open class Message {
/**
* 获取状态是否成功
*/
val success: Boolean
get() = this.status == Status.Success
fun success(): Boolean = this.status == Status.Success
/**
* 附带提示消息

View File

@@ -68,8 +68,8 @@ open class Service<TAggregateRoot : IAggregateRoot<TKey>, TKey>(
var msg: Message
for (func in functions) {
msg = func(id)
if (!msg.success) {
throw java.lang.RuntimeException(msg.message)
if (!msg.success()) {
throw RuntimeException(msg.message)
}
}
this.repository.remove(id, this.clazz)