Commit d25bab36 authored by yinjiacheng's avatar yinjiacheng

add 封装营业执照OCR接口

parent ef650234
......@@ -50,5 +50,6 @@ class URLs {
const val identifyIdOcrVerify = "/Identify/IdOcr/verify"
const val getKSYunObjectId = "Ksy/ksyun/buildObectid"
const val getKSYunBucket = "Ksy/ksyun/getBucket"
const val businessLicenseOCR = "/Identify/BusLicense/businessLicenseOcr"
}
}
\ No newline at end of file
......@@ -113,6 +113,23 @@ class ApiService {
})
}
//获取金山云Bucket
fun businessLicenseOCR(apiCallback: IBusinessLicenseOCRCallback, requestParams: BusinessLicenseOCRBean.Request) {
val paramsMap = HttpParamsUtils.getParamsMap()
ServiceFactory.getInstance().createService(CommonService::class.java)
.businessLicenseOCR(paramsMap, requestParams)
.compose(TransformUtil.defaultSchedulers())
.subscribe(object : HttpResultSubscriber<BusinessLicenseOCRBean.Response>() {
override fun onSuccess(result: HttpResult<BusinessLicenseOCRBean.Response>?) {
apiCallback.businessLicenseOCRSuccess(result?.result)
}
override fun onFailer(result: HttpResult<BusinessLicenseOCRBean.Response>?) {
apiCallback.businessLicenseOCRFailure(result?.status)
}
})
}
//游客登录接口
fun guestLogin(apiCallback: IGuestLoginCallback, requestParams: GuestLoginBean.Request) {
val paramsMap = HttpParamsUtils.getParamsMap()
......
......@@ -126,4 +126,8 @@ interface CommonService {
@GET(URLs.getKSYunBucket)
fun getKSYunBucket(@QueryMap commonParams: Map<String, String>) : Observable<HttpResult<GetKSYunBucketBean.Response>>
@Headers("Content-Type: application/json")
@POST(URLs.businessLicenseOCR)
fun businessLicenseOCR(@QueryMap commonParams: Map<String, String>, @Body requestParams: BusinessLicenseOCRBean.Request) : Observable<HttpResult<BusinessLicenseOCRBean.Response>>
}
\ No newline at end of file
package com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 5/24/21 8:59 PM
* description: 营业执照OCR
*/
class BusinessLicenseOCRBean {
data class Request(val business_image_objectid: String?)
data class Response(
val addr: String,
val code: String,
val comp: String,
val date: String,
val date_issue: String,
val form: String,
val funding: String,
val name: String,
val num: String,
val organizer: String,
val pers: String,
val regi: String,
val scope: String,
val time: String,
val type: String
)
}
\ No newline at end of file
package com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 5/24/21 9:04 PM
* description: 营业执照OCR
*/
interface IBusinessLicenseOCRCallback {
fun businessLicenseOCRSuccess(result: BusinessLicenseOCRBean.Response?)
fun businessLicenseOCRFailure(message: String?)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment