cn.lnkdoc.sdk.uia.instance.yztoon.request.UserInfoRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of awesome-uia-sdk Show documentation
Show all versions of awesome-uia-sdk Show documentation
Awesome Uia SDK for Java
Copyright © 2023 lnkdoc All rights reserved.
The newest version!
package cn.lnkdoc.sdk.uia.instance.yztoon.request
import cn.lnkdoc.sdk.uia.common.HttpMethod
import cn.lnkdoc.sdk.uia.common.exception.UiaException
import cn.lnkdoc.sdk.uia.common.property.IUiaProperty
import cn.lnkdoc.sdk.uia.common.request.AbstractUiaRequest
import cn.lnkdoc.sdk.uia.common.request.IUiaRequest
import cn.lnkdoc.sdk.uia.common.util.Assert.required
import cn.lnkdoc.sdk.uia.instance.yztoon.property.YztoonProperty
/**
* @author langkye
* @since 1.0.0.RELEASE
*/
@Suppress("Unchecked_cast", "unused")
class UserInfoRequest : AbstractUiaRequest(), IUiaRequest {
/**
* body
*/
var body: String? = null
/**
* request body
*
* @return request body
*/
override fun body(): T {
return body!! as T
}
/**
* request url
*
* @param property property
* @return request url
*/
override fun url(property: IUiaProperty): String {
val varProperty = property as YztoonProperty
required(varProperty, "一证通配置不能为空")
return try {
(varProperty.domain
+ varProperty.userInfoUrl
+ "?"
+ "access_token=" + body)
} catch (e: Exception) {
throw UiaException(e)
}
}
/**
* request method
*
* @return request method
*/
override fun method(): HttpMethod {
return HttpMethod.GET
}
}