This commit is contained in:
suyl
2021-06-18 15:06:16 +08:00
parent 8a4c91c007
commit 8ce4c93c5f
8 changed files with 34 additions and 17 deletions

View File

@@ -7,7 +7,7 @@ import (
)
func TestGetCoordinateFromAddressByPage(t *testing.T) {
lng, lat, err := autonaviAPI.GetCoordinateFromAddressByPage("兴月宏干杂", 510100)
lng, lat, err := autonaviAPI.GetCoordinateFromAddressByPage("四川成都市武侯区望江路街道南三环五段188密苏里小城62栋3单元501", 510100)
if err != nil {
t.Fatal(err)
}

View File

@@ -51,7 +51,7 @@ func TestOrderListAll(t *testing.T) {
}
func TestOrderPartRefundGet(t *testing.T) {
result, err := api.OrderPartRefundGet("5028611225947901495")
result, err := api.OrderPartRefundGet("115082650031169457")
if err != nil {
t.Fatal(err)
} else {
@@ -64,7 +64,7 @@ func TestOrderPartRefundGet(t *testing.T) {
// if err != nil {
// t.Fatal(err)
// } else {
// t.Log(utils.Format4Output(result, false))
// t.Log(utils.Format4Output(result, false))image/upload
// }
// }

View File

@@ -114,6 +114,18 @@ type RefundSkuDetail struct {
Spec string `json:"spec"`
}
type RefundDetail struct {
TotalFoodAmount string `json:"total_food_amount"`
BoxAmount string `json:"box_amount"`
ActivityPoiAmount string `json:"activity_poi_amount"`
ActivityMeituanAmount string `json:"activity_meituan_amount"`
ActivityAgentAmount string `json:"activity_agent_amount"`
PlatformChargeFee string `json:"platform_charge_fee"`
SettleAmount string `json:"settle_amount"`
Productpreferences string `json:"productpreferences"`
NotProductpreferences string `json:"not_productpreferences"`
}
type RefundOrderDetail struct {
ApplyReason string `json:"apply_reason"`
ApplyType int `json:"apply_type"`
@@ -128,6 +140,7 @@ type RefundOrderDetail struct {
UTime int64 `json:"utime"`
WmAppRetailForOrderPartRefundList []*RefundSkuDetail `json:"wmAppRetailForOrderPartRefundList"`
WmOrderIDView int64 `json:"wm_order_id_view"`
RefundPartialEstimateCharge *RefundDetail `json:"refund_partial_estimate_charge"`
}
type OrderExtraInfo struct {

View File

@@ -97,7 +97,7 @@ func TestOrderGetRiderInfoPhoneNumber(t *testing.T) {
}
func TestGetOrderRefundDetail(t *testing.T) {
result, err := api.GetOrderRefundDetail(94310371440052951, 0)
result, err := api.GetOrderRefundDetail(115082650031169457, 0)
if err != nil {
t.Fatal(err)
}

View File

@@ -36,16 +36,14 @@ func TestPoiMGet(t *testing.T) {
}
func TestPoiSave(t *testing.T) {
result, err := api.PoiMGet([]string{testPoiCode})
if err != nil {
t.Fatal(err)
}
poiParams := utils.FilterMapNilMembers(utils.Struct2FlatMap(result[0]))
poiParams["name"] = "中国"
err = api.PoiSave(testPoiCode, poiParams)
if err != nil {
t.Fatal(err)
}
//result, err := api.PoiMGet([]string{testPoiCode})
//if err != nil {
// t.Fatal(err)
//}
poiParams := map[string]interface{}{}
//utils.FilterMapNilMembers(utils.Struct2FlatMap(result[0]))
poiParams["name"] = "京西果园·果切·水果捞(宝山店)"
api.PoiSave("9202094", poiParams)
}
func TestPoiTagList(t *testing.T) {
@@ -60,7 +58,7 @@ func TestPoiTagList(t *testing.T) {
}
func TestImageUploadByURL(t *testing.T) {
result, err := api.ImageUploadByURL(testPoiCode, "hello.jpg", "http://image.jxc4.com/56cd1e88ada3660f37548c2d29ea2158.jpg")
result, err := api.ImageUploadByURL("11918886", "菜市800x600.jpg", "http://image.jxc4.com/image/ff8c9443c894bfb4822f7d2f742718df.jpg")
if err != nil {
t.Fatal(err)
}

View File

@@ -13,6 +13,12 @@ const (
MaterialTypeVoice = "voice"
MaterialTypeNews = "news"
MaterialTypeThumb = "thumb"
SNSCutLine = `
<br>
<hr style=\"border-style: solid;border-width: 1px 0 0;border-color: rgba(0,0,0,0.1);-webkit-transform-origin: 0 0;-webkit-transform: scale(1, 0.5);transform-origin: 0 0;transform: scale(1, 0.5);\" />
<br>
`
)
type CBUserInfo struct {

View File

@@ -65,7 +65,7 @@ func TestCBGetTicketInfo(t *testing.T) {
}
func TestCBBatchgetMaterial(t *testing.T) {
userInfo, err := api.CBBatchgetMaterial(MaterialTypeNews, 19, 1)
userInfo, err := api.CBBatchgetMaterial(MaterialTypeThumb, 0, 1)
if err != nil {
t.Fatal(err)
}

View File

@@ -27,7 +27,7 @@ func init() {
//weixinapp
//api = New("wx18111a41fd17f24f", "c79ac6e1b2d6d7968e72a9658a8b6715")
api.CBSetToken("46_wVx1dpEvGz0nGoSl_4mngTxlmLMYXMkixtDpppskseIwPJCa0U9JclQWGVPRtEShpwEhZumF6SoLpwtQMwndEOWOaZnI9tbdC1nOggw594wTadHzco4Dl8qmkrvvaPDwwHuz43bBWtURKruyNCFfABAJYB")
api.CBSetToken("46_sKrKhgoeh0Om1V2_IcTERUux4-pLL5CplvhOh7civG51UCSUTt6g3WkTutvk107i2SMhdcU5q9MYGbciZ4PHyPzhlzx34yBPblf8dpRHx3VYE_a9JbE2wbtjJY93GmXc4KcRHxlEa8s_QWFVOLCgADAKHY")
}
func handleError(t *testing.T, err error) {