修复删除验证的提示问题; 修复Int类型查询问题

This commit is contained in:
2021-04-12 22:38:41 +08:00
parent 038ed84a1e
commit a8a13fd7f1
4 changed files with 14 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ allprojects {
subprojects {
ext {
version '0.10.2'
version '0.10.3'
spring_version = "2.3.0.RELEASE"
}

View File

@@ -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 = "没有对应服务,无法执行该操作"

View File

@@ -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)

View File

@@ -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)