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