im
This commit is contained in:
@@ -129,10 +129,11 @@ func TestSgin(t *testing.T) {
|
||||
|
||||
func TestBaokuanHuodong(t *testing.T) {
|
||||
// 获取门店所有的爆款活动
|
||||
storeId := 668887
|
||||
vendorStoreId := "17056471"
|
||||
storeId := 103201
|
||||
vendorStoreId := "8694421"
|
||||
|
||||
actList, _ := api.RetailDiscountList(vendorStoreId, 56)
|
||||
actList, err := api.RetailDiscountList(vendorStoreId, 56)
|
||||
fmt.Println(err)
|
||||
if len(actList) > 0 {
|
||||
allActivitySkuIdList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
|
||||
activationActivitySkuIdList := make([]*StoreSkuInfo, 0, 0) // 此门店正在进行的折扣(爆款)活动商品
|
||||
|
||||
143
platformapi/mtwmapi/bill_list.go
Normal file
143
platformapi/mtwmapi/bill_list.go
Normal file
@@ -0,0 +1,143 @@
|
||||
package mtwmapi
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
type Bill struct {
|
||||
AppPoiCode string `json:"app_poi_code"` // APP方门店id,传商家中台系统里门店的编码。如商家在操作绑定门店至开放平台应用中时,未绑定三方门店id信息,则默认APP方门店id与美团门店id相同。
|
||||
StartDate int64 `json:"start_date"` // 秒级时间戳
|
||||
EndDate int64 `json:"end_date"` // 秒级时间戳
|
||||
Offset int64 `json:"offset"`
|
||||
Limit int64 `json:"limit"`
|
||||
}
|
||||
|
||||
// GetStoreBillList 获取门店的订单账单
|
||||
/*
|
||||
1.金额类字段单位使用“分”
|
||||
2.当日10点前不能查询昨日账单。
|
||||
3.开始日期和结束日期相隔不能超过7天。
|
||||
4.仅支持查询90天内的账单。
|
||||
5.如订单在状态完成之前取消了,则该订单不会记账,本接口不会查询到该订单的账单信息。
|
||||
6.商家如需对接,请按如下流程申请开通接口权限:请商家发送邮件至 MT.lingshou.open@meituan.com邮件标题:【appid+appname】开通日账单接口权限申请 邮件内容:需包括但不限于以下几点:
|
||||
1)需开通账单接口调用权限的应用appid、appname;
|
||||
2)开通的目的或背景;
|
||||
3)想要实现的效果;
|
||||
4)预计开发周期和上线时间;
|
||||
5)商家公司授权开通日账单接口的证明。(点击下载授权证明模板,授权证明以附件形式提供。)*/
|
||||
func (a *API) GetStoreBillList(param *Bill) (*StoreBillListRes, error) {
|
||||
result, err := a.AccessAPI3("bill/list", true, utils.Struct2Map(param, "", false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var data *StoreBillListRes
|
||||
if err := utils.Map2StructByJson(result, &data, false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// StoreBillListReq 门店结算查询条件
|
||||
type StoreBillListReq struct {
|
||||
AppPoiCode string `json:"app_poi_code"` // APP方门店id
|
||||
StartDate int64 `json:"start_date"` // 开始时间
|
||||
EndDate int64 `json:"end_date"` // 结束时间
|
||||
Offset int64 `json:"offset"` // 偏移量
|
||||
Limit int64 `json:"limit"` // 最大返回条数 (200)
|
||||
}
|
||||
|
||||
// StoreBillListRes 门店结算返回值
|
||||
type StoreBillListRes struct {
|
||||
ExtraInfo ExtraInfoData `json:"extra_info"`
|
||||
Data []*BillListData `json:"data"`
|
||||
}
|
||||
|
||||
type ExtraInfoData struct {
|
||||
TotalCount int `json:"total_count"` // 当前查询时间条件下返回的账单数据总条数
|
||||
SettleSum string `json:"settle_sum"` // 当前查询时间条件下返回的账单数据总结算金额(settleMilli汇总),单位分
|
||||
}
|
||||
|
||||
type BillListData struct {
|
||||
Id string `json:"id"` // 账单的唯一标识id
|
||||
WmPoiName string `json:"wmPoiName"` // 门店名称
|
||||
BillChargeType int `json:"billChargeType"` // 结算类型
|
||||
ChargeFeeDesc string `json:"chargeFeeDesc"` // 结算类型描述
|
||||
UserPayType int `json:"userPayType"` // 用户支付方式
|
||||
WmPoiOrderPushDayseq string `json:"wmPoiOrderPushDayseq"` // 订单流水号
|
||||
WmOrderViewId string `json:"wmOrderViewId"` // 订单展示ID
|
||||
OrderTime string `json:"orderTime"` // 下单时间
|
||||
FinishTime string `json:"finishTime"` // 完成时间
|
||||
RefundTime string `json:"refundTime"` // 退款时间
|
||||
OrderState int `json:"orderState"` // 订单当前状态
|
||||
ShippingType int `json:"shippingType"` // 订单配送方式,以订单完成时刻的配送方式为准。参考值:10-商家自配;20-美团快送;30-美团跑腿;40-美团专送;50-代理商配送;60-到店取餐;70-聚合配送;80-企客光速达;90-企客快速达;100-企客及时达;120-企客全城送。
|
||||
ShippingStatus int `json:"shippingStatus"` // 配送状态,参考值:0-未知;1-已推单;10-已抢单;15-已取餐;20-派送中;40-已送达;100-已取消。如为自配送订单,则配送状态默认为0。
|
||||
AccountState int `json:"accountState"` // 结算状态,参考值:0-已入账;1-未入账。
|
||||
DaliyBillDate string `json:"daliyBillDate"` // 账单日期
|
||||
SettleBillDesc string `json:"settleBillDesc"` // 归账日期,返回结算周期。商家在美团平台上建店时,与美团协议约定的门店结算周期(自外卖信息首次发布之日起算)。如订单未入账(accountState=1),此字段返回null。
|
||||
SettleAmount int64 `json:"settleAmount"` // 商家应收款,单位分。
|
||||
TotalFoodAmount int64 `json:"totalFoodAmount"` // 商品总价(不含商品包装盒费),单位分。公式:商品总价=商品原价+赠品原价
|
||||
BoxAmount int64 `json:"boxAmount"` // 商品包装盒费总价,单位分。
|
||||
ActivityPoiAmount int64 `json:"activityPoiAmount"` // 商家活动总支出金额(含赠品成本),单位分。
|
||||
ActivityMeituanAmount int64 `json:"activityMeituanAmount"` // 美团活动补贴总金额,单位分。
|
||||
ActivityAgentAmount int64 `json:"activityAgentAmount"` // 代理商活动承担金额,单位分。
|
||||
PlatformChargeFee int64 `json:"platformChargeFee"` // 平台服务费,单位分。
|
||||
PerformanceServiceFee int64 `json:"performanceServiceFee"` // 订单履约服务费金额,单位分。如订单无履约服务费,则返回0。(订单履约服务费金额=基础价格+距离收费+重量收费+节假日收费+品类收费+时段收费)
|
||||
BaseShippingAmount int64 `json:"baseShippingAmount"` // 履约服务费-基础价格,单位分
|
||||
Distance int64 `json:"distance"` // 履约服务费-导航距离,获取的导航距离,单位米
|
||||
DistanceFee int64 `json:"distanceFee"` // 履约服务费-距离收费,距离加价费用,单位分
|
||||
WeightChargeFee int64 `json:"weightChargeFee"` // 履约服务费-重量收费,重量加价费用,单位分
|
||||
HolidayChargeFee int64 `json:"holidayChargeFee"` // 履约服务费-节假日收费,单位分
|
||||
CategoryChargeFee int64 `json:"categoryChargeFee"` // 履约服务费-品类收费,单位分
|
||||
SlaFee int64 `json:"slaFee"` // 履约服务费-时段收费,时段加价费用,单位分
|
||||
UserPayShippingAmount int64 `json:"userPayShippingAmount"` // 用户支付配送费,为运费优惠前的金额,单位分。
|
||||
UserOnlinePayAmount int64 `json:"userOnlinePayAmount"` // 用户在线支付金额,为用户实际支付的订单总金额,单位分。
|
||||
UserOfflinePayAmount int64 `json:"userOfflinePayAmount"` // 用户线下支付金额,单位分。目前美团订单仅支持在线支付。
|
||||
Rate int64 `json:"rate"` // 平台服务费的费率,单位百分比(%)。是商家在美团平台建店时,与美团协议约定的每单抽佣比例。
|
||||
Bottom int64 `json:"bottom"` // 保底金额,单位元。是商家在美团平台建店时,与美团协议约定的每单保底抽佣金额。
|
||||
RefundId int64 `json:"refund_id"` // 退款id,与订单退款消息接口中退款id的值相对应。 目前只有在结算类型(billChargeType)为:2,6,7,26,27时,该字段会有合法值;其他结算类型下,该字段值无意义。当billChargeType=2时,该字段的取值与订单ID相同。
|
||||
Discount int64 `json:"discount"` // 分成折扣,目前默认返回100。
|
||||
SettleMilli int64 `json:"settleMilli"` // 结算金额,单位毫。
|
||||
SettleSettingId string `json:"settleSettingId"` // 结算id,表示账期等信息的结算设置id。同一门店的结算设置不变的情况下,结算id不变。
|
||||
WmDonationAmount int64 `json:"wmDonationAmount"` // 青山计划-公益捐赠金额,单位分。
|
||||
WmDoggyBagAmount int64 `json:"wmDoggyBagAmount"` // 商超-打包袋金额,单位分。注意,打包袋费用规则为: (1)订单打包袋如由美团提供给商家,费用结算美团平台,则打包袋字段wmDoggyBagAmount为0; (2)订单打包袋如由商家自己提供,费用结算给商家,则打包袋字段wmDoggyBagAmount为商家设置金额。
|
||||
DealTip int64 `json:"dealTip"` // 配送小费,单位分。
|
||||
ProductPreferences float64 `json:"productPreferences"` // 商家活动支出分摊到商品上的优惠总金额,单位分。
|
||||
NotProductPreferences float64 `json:"notProductPreferences"` // 商家活动支出的未分摊到商品上的总金额,单位分。
|
||||
WmAppOrderSkuBenefitDetailList []WmAppOrderSkuBenefitDetailList `json:"wmAppOrderSkuBenefitDetailList"` // 商家承担成本的商品优惠分摊明细,json格式数组。
|
||||
WmAppOrderSkuShippingDetailList []MedicalInsuranceFee `json:"wmAppOrderSkuShippingDetailList"` // 商家承担配送费活动分摊明细。
|
||||
ChargeFeeType int64 `json:"chargeFeeType"` // 用来标识退款是部分退还是退差价,billChargeType为26时,该值为1代表 退差价,0为部分退。billChargeType为其他值得情况,忽略该字段
|
||||
MedicalInsuranceFee string `json:"medicalInsuranceFee"` // 医保报销费用字段(单位分),只有医保报销的商家这个字段有值
|
||||
}
|
||||
|
||||
type WmAppOrderSkuBenefitDetailList struct {
|
||||
AppSpuCode string `json:"app_spu_code"` // (原app_food_code字段)APP方商品的id,即商家中台系统里商品的编码:(1) 同一门店内商品id不允许重复;(2)字段信息限定长度不超过128个字符。
|
||||
Name string `json:"name"` // 商品名称。
|
||||
SkuId string `json:"sku_id"` // 商品sku的规格编码,SKU码/货号。
|
||||
Count int `json:"count"` // 商品数量 注:当字段count=0时,此账单记录为商家发起的按重量退差价,但结算类型仍为“26-闪购品类订单部分退款”(billChargeType=26)。
|
||||
TotalOriginPrice float64 `json:"totalOriginPrice"` // 商品原价总价(含商品包装盒费),单位分。
|
||||
TotalActivityPrice float64 `json:"totalActivityPrice"` //商品优惠总金额,包括商家承担金额和美团承担金额,单位分。
|
||||
TotalReducePrice float64 `json:"totalReducePrice"` // 商品优惠总金额,包括商家承担金额和美团承担金额,单位分。
|
||||
WmAppOrderActDetails []wmAppOrderActDetails // 商品参与活动详情,json格式数组。
|
||||
|
||||
}
|
||||
|
||||
type wmAppOrderActDetails struct {
|
||||
actId int64 `json:"act_id"` // 商品参与活动的活动id
|
||||
MTType int `json:"type"` // 参与活动的活动类型,参考值:1-首单立减;2-满减优惠;4-套餐惠赠优惠;9-美团红包;11-提前下单减优惠;17-折扣商品;18-美团专送再减;20-第二份半价优惠;22-门店新客立减;27-指定商品满减;40-加价购;43-X元M件;46-超值换购;66-会员折扣商品;101-商家代金券优惠;117-商品优惠券;118-商品折扣券;900-首单红包优惠。
|
||||
PoiCharge float64 `json:"poiCharge"` // 本活动id及活动类型下商家承担的金额,单位分。
|
||||
}
|
||||
|
||||
type MedicalInsuranceFee struct {
|
||||
Name string `json:"name"` // 商品名称。
|
||||
SkuId string `json:"sku_id"` // 商品sku的规格编码,SKU码/货号。
|
||||
Count int `json:"count"` // 商品数量 注:当字段count=0时,此账单记录为商家发起的按重量退差价,但结算类型仍为“26-闪购品类订单部分退款”(billChargeType=26)。
|
||||
totalOriginPrice float64 `json:"totalOriginPrice"` // 商品原价总价(含商品包装盒费),单位分。
|
||||
totalPoiCharge float64 `json:"totalPoiCharge"` // 配送费优惠商家承担总金额,单位分。
|
||||
wmAppOrderShippingActDetailList []wmAppOrderShippingActDetailList `json:"wmAppOrderShippingActDetailList"` // sku商品参与的配送费活动详情。
|
||||
}
|
||||
|
||||
type wmAppOrderShippingActDetailList struct {
|
||||
MTType int `json:"type"` // 参与配送费活动的活动类型,参考值:9-美团红包,21-会员免配送费,25-立减配送费,30-满减配送费,36-新人减配送费,54-新客专享减配送费,59-新客专享减配送费,300-商家会员减配送费,302-预订单减配送费,304-减免运费券,101-商家代金券优惠,305-津贴优惠。
|
||||
PoiCharge float64 `json:"poiCharge"` // 商家承担金额,单位分。
|
||||
}
|
||||
26
platformapi/mtwmapi/bill_list_test.go
Normal file
26
platformapi/mtwmapi/bill_list_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package mtwmapi
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestBillList(t *testing.T) {
|
||||
now := time.Now()
|
||||
from := time.Date(now.Year(), now.Month(), now.Day()-5, 0, 0, 0, 0, time.Local)
|
||||
to := time.Date(now.Year(), now.Month(), now.Day()-5, 23, 59, 59, 59, time.Local)
|
||||
param := &Bill{
|
||||
AppPoiCode: "16967920",
|
||||
StartDate: from.Unix(),
|
||||
EndDate: to.Unix(),
|
||||
Offset: 0,
|
||||
Limit: 200,
|
||||
}
|
||||
|
||||
data, _ := api.GetStoreBillList(param)
|
||||
globals.SugarLogger.Debugf("data := %s", utils.Format4Output(data.Data[0], false))
|
||||
// performanceServiceFee 订单配送费
|
||||
// userPayShippingAmount 用户支付配送费
|
||||
}
|
||||
@@ -27,7 +27,7 @@ const (
|
||||
MsgTypeUserUrgeOrder = "userUrgeOrder"
|
||||
MsgTypePrivateNumberDowngrade = "numberDowngrade"
|
||||
MsgTypeOrderModified = "orderModified" // 这个不是订单调整,是订单信息(地址、联系人等)变化后推送的消息
|
||||
MsgTypeOrderRefund = "orderRefund" // 订单退款
|
||||
MsgTypeOrderRefund = "orderRefund" // 订单退款(全额)
|
||||
MsgTypeOrderPartialRefund = "orderPartialRefund" // /订单部分退款
|
||||
MsgTypeOrderFinishedPickup = "orderFinishedPickup"
|
||||
|
||||
|
||||
@@ -265,3 +265,16 @@ func TestGetClient(t *testing.T) {
|
||||
func TestMal(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestGetWayBillFee(t *testing.T) {
|
||||
//order, _ := api.OrderGetOrderDetail(1100486451772280163, false)
|
||||
//globals.SugarLogger.Debugf("order:==%s", utils.Format4Output(order, false)) 2002
|
||||
api.GetWayBillFee("1100486451772280163", 2)
|
||||
api.GetWayBillFee("1100486451772280163", 1)
|
||||
}
|
||||
|
||||
// 商家没有接入众包配送,无法进行众包配送相关操作
|
||||
func TestGetShippingFeeList(t *testing.T) {
|
||||
api.GetShippingFeeList("1300486314174032613,1100487300210228389", 1)
|
||||
api.GetShippingFeeList("1300486314174032613,1100487300210228389", 2)
|
||||
}
|
||||
|
||||
53
platformapi/mtwmapi/logistics_fee.go
Normal file
53
platformapi/mtwmapi/logistics_fee.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package mtwmapi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
// GetWayBillFee 获取美团众包配送费已经保险费
|
||||
func (a *API) GetWayBillFee(orderId string, serviceBrand int) (*GetOrderLogisticsFee, error) {
|
||||
data, err := a.AccessAPI("order/logistics/pt/preview", true, map[string]interface{}{"order_id": orderId, "service_brand": serviceBrand})
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := %v", err)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(data)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
type GetOrderLogisticsFeeRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
data string `json:"data"`
|
||||
}
|
||||
|
||||
type GetOrderLogisticsFee struct {
|
||||
WmOrderId int64 `json:"wm_order_id"` // 订单id
|
||||
ShippingFee float64 `json:"shipping_fee"` // 配送费(基础+临时)
|
||||
OriginalPrice float64 `json:"original_price"` // 订单的总原价,单位为元此字段数据为未扣减所有优惠前订单的总金额,含打包袋、配送费等。
|
||||
LogisticsStatus int64 `json:"logistics_status"` // 美团配送订单状态code
|
||||
ShippingTips string `json:"shipping_tips"` // 配送费浮动说明
|
||||
PayAmount float64 `json:"pay_amount"` // 实付金额
|
||||
Distance int `json:"distance"` // 配送距离(m)
|
||||
CouponViewId string `json:"coupon_view_id"` // 配送费优惠券id
|
||||
CouponName string `json:"coupon_name"` // 优惠券名称
|
||||
CouponAmount float64 `json:"coupon_amount"` // 优惠券金额
|
||||
ReduceDetail ReduceDetailObj
|
||||
}
|
||||
|
||||
type ReduceDetailObj struct {
|
||||
UserTaskId int64 `json:"user_task_id"` // 立减活动id
|
||||
TaskId int64 `json:"task_id"` // 立减活动task id
|
||||
BmlAmount float64 `json:"bml_amount"` // 立减金额(元)
|
||||
}
|
||||
|
||||
func (a *API) GetShippingFeeList(orderIds string, serviceBrand int) (*GetOrderLogisticsFeeRes, error) {
|
||||
data, err := a.AccessAPI("order/zhongbao/shippingFee", true, map[string]interface{}{"order_id": orderIds, "service_brand": serviceBrand})
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := %v", err)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(data)
|
||||
return nil, nil
|
||||
}
|
||||
@@ -245,11 +245,21 @@ func (a *API) AccessAPI3(cmd string, isGet bool, bizParams map[string]interface{
|
||||
// 不管有无错误,都尝试取得数据(因为有出错,但有有效数据返回的情况),比如ecommerce/order/getOrderIdByDaySeq
|
||||
retVal = jsonResult1
|
||||
if errObj, ok := jsonResult1["data"]; ok {
|
||||
errorInfo := errObj.(string)
|
||||
if errorInfo != "ok" {
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["code"])))
|
||||
return errLevel, newErr
|
||||
switch errObj.(type) {
|
||||
case string:
|
||||
errorInfo := errObj.(string)
|
||||
if errorInfo != "ok" {
|
||||
var newErr *utils.ErrorWithCode
|
||||
if cmd == "bill/list" {
|
||||
newErr = utils.NewErrorIntCode(jsonResult1["error"].(interface{}).(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error"].(interface{}).(map[string]interface{})["code"])))
|
||||
} else {
|
||||
newErr = utils.NewErrorIntCode(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["code"])))
|
||||
}
|
||||
return errLevel, newErr
|
||||
}
|
||||
case interface{}:
|
||||
}
|
||||
|
||||
}
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
})
|
||||
|
||||
@@ -23,10 +23,10 @@ func init() {
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
// api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_n4TwqCntWWuvQwAawzxC0w") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
@@ -42,7 +42,7 @@ func TestAccessAPI(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetOAuthCode(t *testing.T) {
|
||||
result, err := api.GetOAuthCode("12422751")
|
||||
result, err := api.GetOAuthCode("17395411")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func TestGetAccessToken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetAccessToken2(t *testing.T) {
|
||||
result, err := api.GetAccessToken2("16708848") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||
result, err := api.GetAccessToken2("17395411") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func TestGetAccessToken2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRefreshAccessToken(t *testing.T) {
|
||||
result, err := api.RefreshAccessToken("refresh_token_jOp7ekeHrzjBUvLdVuZHIg") //token_qbAyE3ajWYT8ecwoI-FMjw
|
||||
result, err := api.RefreshAccessToken("refresh_token_jajfdTMzYvB28v-3q4RFgQ") //token_qbAyE3ajWYT8ecwoI-FMjw
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -19,14 +19,19 @@ func TestOrderViewStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail(t *testing.T) {
|
||||
result, err := api.OrderGetOrderDetail(1100449970093397157, false)
|
||||
result, err := api.OrderGetOrderDetail(1100496043552579025, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
globals.SugarLogger.Debugf("====%s", utils.Format4Output(result["poi_receive_detail_yuan"], false))
|
||||
if len(result) == 0 {
|
||||
t.Fatal("result should have value")
|
||||
}
|
||||
globals.SugarLogger.Debugf("%s", utils.Format4Output(result, false))
|
||||
|
||||
for k, v := range result {
|
||||
fmt.Println(fmt.Sprintf("%s=%v", k, v))
|
||||
}
|
||||
//globals.SugarLogger.Debugf("%s", utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail2(t *testing.T) {
|
||||
|
||||
@@ -45,8 +45,9 @@ func TestPoiSave(t *testing.T) {
|
||||
poiParams := map[string]interface{}{}
|
||||
//utils.FilterMapNilMembers(utils.Struct2FlatMap(result[0]))
|
||||
//poiParams["address"] = "成都市温江区柳城学海路585号"
|
||||
poiParams["pic_url"] = "http://image.jxc4.com/image/5c9fc4fffb4d5ff1aecf85a2d2543e00.jpg"
|
||||
err := api.PoiSave("17218722", poiParams)
|
||||
//poiParams["pic_url"] = "http://image.jxc4.com/image/5c9fc4fffb4d5ff1aecf85a2d2543e00.jpg"
|
||||
poiParams["name"] = "京西菜市(礼嘉桥村市场店)"
|
||||
err := api.PoiSave("17395411", poiParams)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ const ( // {"attrId":1200000275,"attrName":"是否有机","valueList":[{"valueId
|
||||
MtwmSkuAttr200000592 = `[{"attrId":1200000088,"attrName":"品牌","valueList":[{"valueId":1000001,"value":"其他品牌"}]}]`
|
||||
//200002704
|
||||
MtwmSkuAttr200002731 = `[{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
MtwmSkuAttr200002716 = `[{"attrId":1200000287,"attrName":"特产品种","valueList":[{"valueId":1300003951,"value":"非特产品种"}]},{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
MtwmSkuAttr200002716 = `[{"attrId":1200000287,"attrName":"特产品种","valueList":[{"valueId":1300016304,"value":"其他"}]},{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
//200002667,200002713
|
||||
MtwmSkuAttr200002670 = `[{"attrId":1200000202,"attrName":"品种","valueList":[{"valueId":1300000249,"value":"其他"}]},{"attrId":1200000287,"attrName":"特产品种","valueList":[{"valueId":1300003951,"value":"非特产品种"}]},{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
MtwmSkuAttr200002670 = `[{"attrId":1200000202,"attrName":"品种","valueList":[{"valueId":1300000249,"value":"其他"}]},{"attrId":1200000287,"attrName":"特产品种","valueList":[{"valueId":1300016304,"value":"其他"}]},{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
//MtwmSkuAttr200002680 = `[{"attrId":1200000289,"attrName":"品规","valueList":[{"valueId":1300004255,"value":"未区分品规"}]},{"attrId":1200000202,"attrName":"品种","valueList":[{"valueId":1300000249,"value":"其他"}]},{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
MtwmSkuAttr200002680 = `[{"attrId":1200004607,"attrName":"水果形态","valueList":[{"valueId":1300017364,"value":"新鲜整果"}]},{"attrId":1200004608,"attrName":"单果重量","valueList":[{"valueId":1300017449,"value":"约4.5kg~5kg"}]},{"attrId":1200000202,"attrName":"品种","valueList":[{"valueId":1300000249,"value":"其他"}]},{"attrId":1200000094,"attrName":"产地","valueList":[{"valueId":100000050,"value":"中国"}]},{"attrId":1200000132,"attrName":"国产/进口","valueList":[{"valueId":1300000003,"value":"国产"}]},{"attrId":1200000286,"attrName":"果品品牌","valueList":[{"valueId":1300000249,"value":"其他"}]}]`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user