Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
a589d400
Commit
a589d400
authored
May 21, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 身份证OCR接口
parent
73e13026
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
0 deletions
+74
-0
URLs.kt
...onLib/Common/src/main/java/com/yidian/common/http/URLs.kt
+1
-0
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+17
-0
CommonService.kt
...com/yidian/shenghuoquan/newscontent/http/CommonService.kt
+4
-0
GetIDCardOCRBean.kt
...henghuoquan/newscontent/http/httpbean/GetIDCardOCRBean.kt
+45
-0
IGetIDCardOCRCallback.kt
...uoquan/newscontent/http/httpbean/IGetIDCardOCRCallback.kt
+7
-0
No files found.
CommonLib/Common/src/main/java/com/yidian/common/http/URLs.kt
View file @
a589d400
...
...
@@ -46,5 +46,6 @@ class URLs {
// 生活圈B端
const
val
authPersonalGetToken
=
"/auth/personal/get_token"
const
val
getKSYunToken
=
"/ksy/Ksyun/getToken"
const
val
getIDCardOCR
=
"Identify/IdOcr/idCardOcr"
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
a589d400
...
...
@@ -47,6 +47,23 @@ class ApiService {
.
execute
().
body
()
}
//获取身份证OCR接口
fun
getIDCardOCR
(
apiCallback
:
IGetIDCardOCRCallback
,
requestParams
:
GetIDCardOCRBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
getIDCardOCR
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
GetIDCardOCRBean
.
Response
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetIDCardOCRBean
.
Response
?
>?)
{
apiCallback
.
getIDCardOCR
(
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
GetIDCardOCRBean
.
Response
?
>?)
{
apiCallback
.
getIDCardOCR
(
result
)
}
})
}
//游客登录接口
fun
guestLogin
(
apiCallback
:
IGuestLoginCallback
,
requestParams
:
GuestLoginBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/CommonService.kt
View file @
a589d400
...
...
@@ -108,4 +108,8 @@ interface CommonService {
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
getKSYunToken
)
fun
getKSYunToken
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
GetKSYunTokenBean
.
Request
):
Call
<
HttpResult
<
GetKSYunTokenBean
.
Response
?
>>
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
getIDCardOCR
)
fun
getIDCardOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
GetIDCardOCRBean
.
Request
)
:
Observable
<
HttpResult
<
GetIDCardOCRBean
.
Response
?
>>
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/GetIDCardOCRBean.kt
0 → 100644
View file @
a589d400
package
com.yidian.shenghuoquan.newscontent.http.httpbean
class
GetIDCardOCRBean
(
val
request
:
Request
,
val
response
:
Response
)
{
data class
Request
(
val
posit_image_objectid
:
String
,
val
back_image_objectid
:
String
,
val
bucket
:
String
)
data class
Response
(
val
back
:
Back
,
val
posit
:
Posit
)
data class
Back
(
val
issued_by
:
String
,
val
valid_date_end
:
String
,
val
valid_date_start
:
String
)
data class
Posit
(
val
address
:
String
,
val
birth_day
:
String
,
val
birth_month
:
String
,
val
birth_year
:
String
,
val
completeness
:
Int
,
val
gender
:
String
,
val
idcard_number
:
String
,
val
legality
:
Legality
,
val
name
:
String
,
val
nationality
:
String
)
data class
Legality
(
val
Edited
:
Int
,
val
ID_Photo
:
Double
,
val
ID_Photo_Threshold
:
Double
,
val
Photocopy
:
Int
,
val
Screen
:
Double
,
val
Temporary_ID_Photo
:
Int
)
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/IGetIDCardOCRCallback.kt
0 → 100644
View file @
a589d400
package
com.yidian.shenghuoquan.newscontent.http.httpbean
import
com.yidian.common.http.HttpResult
interface
IGetIDCardOCRCallback
{
fun
getIDCardOCR
(
t
:
HttpResult
<
GetIDCardOCRBean
.
Response
?
>?)
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment