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
0e9b1e55
Commit
0e9b1e55
authored
Aug 24, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 订单组件获取自提点列表接口封装
parent
a0296739
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
9 deletions
+102
-9
PickupPointListDto.kt
.../com/yidian/shenghuoquan/border/dto/PickupPointListDto.kt
+53
-0
OrderApiService.kt
...va/com/yidian/shenghuoquan/border/http/OrderApiService.kt
+13
-5
OrderRemoteDataSource.kt
.../yidian/shenghuoquan/border/http/OrderRemoteDataSource.kt
+23
-4
IGetPickupPointListCallback.kt
...oquan/border/http/callback/IGetPickupPointListCallback.kt
+13
-0
No files found.
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/dto/PickupPointListDto.kt
0 → 100644
View file @
0e9b1e55
package
com.yidian.shenghuoquan.border.dto
import
com.google.gson.annotations.SerializedName
/**
* author: yinjiacheng
* date: 2021/8/24 18:31
* description: 自提点列表数据结构
*/
data class
PickupPointListDto
(
@SerializedName
(
"list"
)
val
list
:
List
<
PickupPoint
>,
@SerializedName
(
"total"
)
// 总数
val
total
:
Int
,
@SerializedName
(
"total_page"
)
// 总页数
val
totalPage
:
Int
)
data class
PickupPoint
(
@SerializedName
(
"address"
)
// 详细地址
val
address
:
String
,
@SerializedName
(
"area"
)
// 区
val
area
:
String
,
@SerializedName
(
"city"
)
// 市
val
city
:
String
,
@SerializedName
(
"contact_name"
)
// 联系人
val
contactName
:
String
,
@SerializedName
(
"create_time"
)
val
createTime
:
String
,
@SerializedName
(
"distance"
)
// 距离 单位:km(如果入参没有传longitude或latitude则没有此字段)
val
distance
:
Double
,
@SerializedName
(
"is_delete"
)
val
isDelete
:
Int
,
@SerializedName
(
"latitude"
)
// 纬度
val
latitude
:
String
,
@SerializedName
(
"life_account_id"
)
// 生活号id
val
lifeAccountId
:
String
,
@SerializedName
(
"location"
)
val
location
:
String
,
@SerializedName
(
"longitude"
)
// 经度
val
longitude
:
String
,
@SerializedName
(
"phone"
)
// 联系电话
val
phone
:
String
,
@SerializedName
(
"province"
)
// 省
val
province
:
String
,
@SerializedName
(
"take_place_id"
)
// 自提点id
val
takePlaceId
:
Int
,
@SerializedName
(
"take_place_name"
)
// 自提点名称
val
takePlaceName
:
String
,
@SerializedName
(
"update_time"
)
val
updateTime
:
String
)
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/OrderApiService.kt
View file @
0e9b1e55
...
...
@@ -2,9 +2,7 @@ package com.yidian.shenghuoquan.border.http
import
com.yidian.bcommon.http.HttpResult
import
io.reactivex.rxjava3.core.Observable
import
retrofit2.http.Headers
import
retrofit2.http.POST
import
retrofit2.http.QueryMap
import
retrofit2.http.*
/**
* author: yinjiacheng
...
...
@@ -19,6 +17,7 @@ interface OrderApiService {
const
val
orderConfirm
=
"/order/order/order_confirm_page"
const
val
createOrder
=
"/order/order/create"
const
val
orderPay
=
"/pay/order/pay"
const
val
getPickupPointList
=
"/marketing/wxapp/get_bind_take_place_list"
}
/**
...
...
@@ -28,7 +27,7 @@ interface OrderApiService {
@Headers
(
"Content-Type: application/json"
)
fun
getOrderDetail
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@
QueryMap
requestParams
:
Map
<
String
,
String
?
>
@
Body
requestParams
:
Map
<
String
,
String
?
>
):
Observable
<
HttpResult
<
Any
?
>>
/**
...
...
@@ -38,7 +37,7 @@ interface OrderApiService {
@Headers
(
"Content-Type: application/json"
)
fun
applyRefund
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@
QueryMap
requestParams
:
Map
<
String
,
String
?
>
@
Body
requestParams
:
Map
<
String
,
String
?
>
):
Observable
<
HttpResult
<
Any
?
>>
/**
...
...
@@ -71,4 +70,13 @@ interface OrderApiService {
@QueryMap
requestParams
:
Map
<
String
,
String
?
>
):
Observable
<
HttpResult
<
Any
?
>>
/**
* 获取活动设置的自提点列表
*/
@GET
(
getPickupPointList
)
fun
getPickupPointList
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
?
>
):
Observable
<
HttpResult
<
Any
?
>>
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/OrderRemoteDataSource.kt
View file @
0e9b1e55
...
...
@@ -5,12 +5,10 @@ import com.yidian.bcommon.http.HttpResult
import
com.yidian.bcommon.http.HttpResultSubscriber
import
com.yidian.bcommon.http.TransformUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.border.dto.CreateOrderResDto
import
com.yidian.shenghuoquan.border.dto.OrderConfirmResDto
import
com.yidian.shenghuoquan.border.dto.OrderDetailDto
import
com.yidian.shenghuoquan.border.dto.OrderPayResDto
import
com.yidian.shenghuoquan.border.dto.*
import
com.yidian.shenghuoquan.border.http.callback.IApplyRefundCallback
import
com.yidian.shenghuoquan.border.http.callback.IGetOrderDetailCallback
import
com.yidian.shenghuoquan.border.http.callback.IGetPickupPointListCallback
/**
* author: yinjiacheng
...
...
@@ -123,4 +121,25 @@ object OrderRemoteDataSource {
}
})
}
/**
* 获取活动设置的自提点列表
*/
fun
getPickupPointList
(
callback
:
IGetPickupPointListCallback
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
ServiceFactory
.
getInstance
().
createService
(
OrderApiService
::
class
.
java
)
.
getPickupPointList
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
PickupPointListDto
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
PickupPointListDto
>?)
{
callback
.
getPickupPointListSuccess
(
result
?.
result
)
}
override
fun
onFailure
(
result
:
HttpResult
<
PickupPointListDto
>?)
{
callback
.
getPickupPointListFailure
(
result
?.
reason
)
}
})
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/callback/IGetPickupPointListCallback.kt
0 → 100644
View file @
0e9b1e55
package
com.yidian.shenghuoquan.border.http.callback
import
com.yidian.shenghuoquan.border.dto.PickupPointListDto
/**
* author: yinjiacheng
* date: 2021/8/24 19:01
* description: API /marketing/wxapp/get_bind_take_place_list
*/
interface
IGetPickupPointListCallback
{
fun
getPickupPointListSuccess
(
result
:
PickupPointListDto
?)
fun
getPickupPointListFailure
(
message
:
String
?)
}
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