info.gratour.adaptor.impl.MediaRepoApiImpl.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jt-core Show documentation
Show all versions of jt-core Show documentation
`jt-core` is a java/scala communication processing library for JT808/JT809/JT1078 standard.
The newest version!
package info.gratour.adaptor.impl
import java.lang.reflect.Type
import com.google.gson.reflect.TypeToken
import info.gratour.adaptor.MediaRepo
import info.gratour.adaptor.types.CreateMMReq
import info.gratour.common.types.rest.Reply
import info.gratour.jtmodel.MultiMedia
class MediaRepoApiImpl(val endPointUrl: String, val authentication: APIAuthentication) extends MediaRepo with APIClient {
override def createMedia(req: CreateMMReq): MultiMedia = {
checkReply(post[MultiMedia](MediaRepoApiImpl.MULTI_MEDIA_PATH, MediaRepoApiImpl.MULTI_MEDIA_REPLY_TYPE, req)).firstOrNull()
}
}
object MediaRepoApiImpl {
val MULTI_MEDIA_PATH = "mm"
val MULTI_MEDIA_REPLY_TYPE: Type = new TypeToken[Reply[MultiMedia]](){}.getType
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy