@Entity
interface UserTask : BaseEntity {
/**
* 任务
*/
@ManyToOne
@Key
val task: Task?
UserTaskView {
finishState
finishTime?
flat(task) {
id as taskId
title as taskTitle
type as taskType
requireFinishTime
}
}
生成的dto代码
public open class UserTaskView(
/**
* 完成状态
*/
@get:JsonProperty(required = true)
public val finishState: UserTaskFinishStateEnum,
/**
* 完成时间
*/
public val finishTime: LocalDateTime? = null,
/**
* 任务
*/
public val taskId: Long? = null,
/**
* 任务
*/
public val taskTitle: String? = null,
/**
* 任务
*/
public val taskType: TaskTypeEnum? = null,
/**
* 任务
*/
public val requireFinishTime: LocalDateTime? = null,
) : View<UserTask> {
生成的dto代码
flat自关联实体的属性的注释全部变成关联属性本身的注释了