【发布时间】:2021-12-27 17:02:24
【问题描述】:
我的 Ktor + Exposed App 上有这个功能。
override suspend fun createNewCourse(course: CourseModel): Flow<CourseModel> {
transaction {
CoursesTable.insert {
it[requiredCourseId] = course.requiredCourse?.id!!
it[category] = course.category?.id!!
it[isPopular] = course.isPopular == true
it[position] = course.position
it[nameEN] = course.name.en
it[warningEN] = course.warning.en
}
}
它无法编译。 有时某些变量(如“warningEN”)可能为空,我不想为此字段插入任何内容。
如何制作?
类型不匹配。 必需:TypeVariable(S) 找到:字符串?
【问题讨论】:
标签: kotlin server ktor kotlin-exposed