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
1eb0eeab
Commit
1eb0eeab
authored
May 23, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 封装获取金山云objectId和bucket接口
parent
3ba508c9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
0 deletions
+84
-0
URLs.kt
...onLib/Common/src/main/java/com/yidian/common/http/URLs.kt
+2
-0
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+34
-0
CommonService.kt
...com/yidian/shenghuoquan/newscontent/http/CommonService.kt
+6
-0
GetKSYunBucketBean.kt
...nghuoquan/newscontent/http/httpbean/GetKSYunBucketBean.kt
+10
-0
GetKSYunObjectIdBean.kt
...huoquan/newscontent/http/httpbean/GetKSYunObjectIdBean.kt
+10
-0
IGetKSYunBucketCallback.kt
...quan/newscontent/http/httpbean/IGetKSYunBucketCallback.kt
+11
-0
IGetKSYunObjectIdCallback.kt
...an/newscontent/http/httpbean/IGetKSYunObjectIdCallback.kt
+11
-0
No files found.
CommonLib/Common/src/main/java/com/yidian/common/http/URLs.kt
View file @
1eb0eeab
...
...
@@ -48,5 +48,7 @@ class URLs {
const
val
getKSYunToken
=
"/ksy/Ksyun/getToken"
const
val
getIDCardOCR
=
"Identify/IdOcr/idCardOcr"
const
val
identifyIdOcrVerify
=
"/Identify/IdOcr/verify"
const
val
getKSYunObjectId
=
"Ksy/ksyun/buildObectid"
const
val
getKSYunBucket
=
"Ksy/ksyun/getBucket"
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
1eb0eeab
...
...
@@ -79,6 +79,40 @@ class ApiService {
})
}
//获取金山云ObjectId
fun
getKSYunObjectId
(
apiCallback
:
IGetKSYunObjectIdCallback
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
getKSYunObjectId
(
paramsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
GetKSYunObjectIdBean
.
Response
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetKSYunObjectIdBean
.
Response
>?)
{
apiCallback
.
getKSYunObjectIdSuccess
(
result
?.
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
GetKSYunObjectIdBean
.
Response
>?)
{
apiCallback
.
getKSYunObjectIdFailure
(
result
?.
status
)
}
})
}
//获取金山云Bucket
fun
getKSYunBucket
(
apiCallback
:
IGetKSYunBucketCallback
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
getKSYunBucket
(
paramsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
GetKSYunBucketBean
.
Response
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
GetKSYunBucketBean
.
Response
>?)
{
apiCallback
.
getKSYunBucketSuccess
(
result
?.
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
GetKSYunBucketBean
.
Response
>?)
{
apiCallback
.
getKSYunBucketFailure
(
result
?.
status
)
}
})
}
//游客登录接口
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 @
1eb0eeab
...
...
@@ -120,4 +120,10 @@ interface CommonService {
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
identifyIdOcrVerify
)
fun
identifyIdOcrVerify
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
IdentifyIdOcrVerifyBean
.
Request
):
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
getKSYunObjectId
)
fun
getKSYunObjectId
(
@QueryMap
commonParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
GetKSYunObjectIdBean
.
Response
>>
@GET
(
URLs
.
getKSYunBucket
)
fun
getKSYunBucket
(
@QueryMap
commonParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
GetKSYunBucketBean
.
Response
>>
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/GetKSYunBucketBean.kt
0 → 100644
View file @
1eb0eeab
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 5/23/21 12:13 PM
* description: 获取金山云Bucket
*/
class
GetKSYunBucketBean
{
data class
Response
(
val
bucket
:
String
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/GetKSYunObjectIdBean.kt
0 → 100644
View file @
1eb0eeab
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 5/23/21 12:13 PM
* description: 获取金山云ObjectId
*/
class
GetKSYunObjectIdBean
{
data class
Response
(
val
bucket
:
String
,
val
objectid
:
String
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/IGetKSYunBucketCallback.kt
0 → 100644
View file @
1eb0eeab
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 5/23/21 12:18 PM
* description: 获取金山云Bucket
*/
interface
IGetKSYunBucketCallback
{
fun
getKSYunBucketSuccess
(
result
:
GetKSYunBucketBean
.
Response
?)
fun
getKSYunBucketFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/IGetKSYunObjectIdCallback.kt
0 → 100644
View file @
1eb0eeab
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 5/23/21 12:18 PM
* description: 获取金山云ObjectId
*/
interface
IGetKSYunObjectIdCallback
{
fun
getKSYunObjectIdSuccess
(
result
:
GetKSYunObjectIdBean
.
Response
?)
fun
getKSYunObjectIdFailure
(
message
:
String
?)
}
\ 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