修改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 fun success(): Boolean = this.status == Status.Success
get() = this.status == Status.Success
/** /**
* 附带提示消息 * 附带提示消息

View File

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