cn.lnkdoc.sdk.uia.instance.bjtoon.BjtoonSdkInstance.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.bjtoon
import cn.lnkdoc.sdk.uia.common.request.IUiaRequest
import cn.lnkdoc.sdk.uia.common.response.UiaResponse
import cn.lnkdoc.sdk.uia.instance.AbstractInstance
import cn.lnkdoc.sdk.uia.instance.ISdkInstance
import cn.lnkdoc.sdk.uia.instance.bjtoon.client.BjtoonUiaClient.Companion.getInstance
import cn.lnkdoc.sdk.uia.instance.bjtoon.property.BjtoonProperty
import cn.lnkdoc.sdk.uia.instance.bjtoon.request.AccessTokenRequest
/**
* @author langkye
* @since 1.0.0.RELEASE
*/
@Suppress("Unchecked_cast")
class BjtoonSdkInstance(property: BjtoonProperty) : AbstractInstance(), ISdkInstance {
/**
* constructor
*/
init {
client = getInstance(property)
}
/**
* get accessToken
*
* @param r code
* @return accessToken
*/
override fun getAccessToken(r: R): UiaResponse {
return client.execute((r as AccessTokenRequest)) as UiaResponse
}
/**
* get UserInfo
*
* @param accessToken accessToken
* @return UserInfo
*/
override fun getUserInfo(accessToken: R): UiaResponse {
return client.execute((accessToken as IUiaRequest)) as UiaResponse
}
}