修改Message的success属性为方法
This commit is contained in:
@@ -9,9 +9,7 @@ open class Message {
|
|||||||
/**
|
/**
|
||||||
* 获取状态是否成功
|
* 获取状态是否成功
|
||||||
*/
|
*/
|
||||||
val success: Boolean
|
fun success(): Boolean = this.status == Status.Success
|
||||||
get() = this.status == Status.Success
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附带提示消息
|
* 附带提示消息
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user