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