com.tairitsu.ignotus.foundation.model.JsonApiBody.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ignotus-foundation Show documentation
Show all versions of ignotus-foundation Show documentation
JSON:API like Controller utils.
package com.tairitsu.ignotus.foundation.model
import com.tairitsu.ignotus.validation.annotation.Required
/**
* 一个 Json Api 格式的对象
*/
class JsonApiObject {
var type: String? = null
var id: String? = null
@Required
var attributes: T? = null
}
/**
* 一个由单个 Json Api 对象组成的请求体
*/
class JsonApiObjectBody {
@Required
lateinit var data: JsonApiObject
}
/**
* 一个由多个 Json Api 对象组成的请求体
*/
class JsonApiListBody {
@Required
lateinit var data: List>
}