修复删除验证的提示问题; 修复Int类型查询问题
This commit is contained in:
@@ -21,7 +21,7 @@ allprojects {
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
ext {
|
ext {
|
||||||
version '0.10.2'
|
version '0.10.3'
|
||||||
spring_version = "2.3.0.RELEASE"
|
spring_version = "2.3.0.RELEASE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,12 @@ interface ICommandApp<TCommand : ICommand, TKey> : IApplication {
|
|||||||
fun remove(@PathVariable id: TKey): HttpMessage {
|
fun remove(@PathVariable id: TKey): HttpMessage {
|
||||||
val msg = HttpMessage()
|
val msg = HttpMessage()
|
||||||
if (this.service != null)
|
if (this.service != null)
|
||||||
msg.data = this.service!!.remove(id)
|
try {
|
||||||
|
msg.data = this.service!!.remove(id)
|
||||||
|
} catch (ex: IllegalStateException) {
|
||||||
|
msg.status = Status.Error
|
||||||
|
msg.message = ex.message ?: ""
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
msg.status = Status.Error
|
msg.status = Status.Error
|
||||||
msg.message = "没有对应服务,无法执行该操作"
|
msg.message = "没有对应服务,无法执行该操作"
|
||||||
|
|||||||
@@ -42,8 +42,12 @@ fun Query.where(
|
|||||||
|
|
||||||
//日期类型特殊处理为String类型
|
//日期类型特殊处理为String类型
|
||||||
val fieldType = onFieldType(key)
|
val fieldType = onFieldType(key)
|
||||||
if (fieldType != null && value.javaClass != fieldType && fieldType == Date::class.java) {
|
if (fieldType != null && value.javaClass != fieldType) {
|
||||||
value = DateTime(value.toString(), "yyyy-MM-dd HH:mm:ss").date
|
when (fieldType) {
|
||||||
|
Date::class.java -> value = DateTime(value.toString(), "yyyy-MM-ddTHH:mm:ss").date
|
||||||
|
Int::class.java -> value = value.toString().toInt()
|
||||||
|
Integer::class.java -> value = value.toString().toInt()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val where = onWhere(key)
|
val where = onWhere(key)
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ open class Service<TAggregateRoot : IAggregateRoot<TKey>, TKey>(
|
|||||||
for (func in functions) {
|
for (func in functions) {
|
||||||
msg = func(id)
|
msg = func(id)
|
||||||
if (!msg.success()) {
|
if (!msg.success()) {
|
||||||
throw RuntimeException(msg.message)
|
throw IllegalStateException(msg.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.repository.remove(id, this.clazz)
|
this.repository.remove(id, this.clazz)
|
||||||
|
|||||||
Reference in New Issue
Block a user