- jd comment api
This commit is contained in:
@@ -80,6 +80,7 @@ func (a *API) OrderCancelDelivery(orderID string) (err error) {
|
||||
}
|
||||
|
||||
// 饿了么自配送订单回传订单已送出状态
|
||||
// 此接口目前只支持饿了么侧订单调用
|
||||
func (a *API) OrderSendOut(orderID, phone string) (err error) {
|
||||
_, err = a.AccessAPI("order.sendout", map[string]interface{}{
|
||||
"order_id": orderID,
|
||||
|
||||
@@ -111,7 +111,7 @@ func (a *API) GetCommentByOrderId(orderId int64) (map[string]interface{}, error)
|
||||
jdParams := map[string]interface{}{
|
||||
"orderId": orderId,
|
||||
}
|
||||
result, err := a.AccessAPINoPage("commentOutApi/getCommentByOrderId", jdParams, nil, nil, nil)
|
||||
result, err := a.AccessAPINoPage("commentOutApi/getCommentByOrderId", jdParams, nil, nil, genNoPageResultParser("code", "msg", "result", "200"))
|
||||
if err == nil {
|
||||
return result.(map[string]interface{}), nil
|
||||
}
|
||||
@@ -120,18 +120,15 @@ func (a *API) GetCommentByOrderId(orderId int64) (map[string]interface{}, error)
|
||||
|
||||
// 商家门店评价信息回复接口
|
||||
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=194&apiid=ea0b466a7fa8489b813e8b197efca2d4
|
||||
func (a *API) OrgReplyComment(orderID int64, storeID, content, replayPin string) (string, error) {
|
||||
func (a *API) OrgReplyComment(orderID int64, storeID, content, replayPin string) error {
|
||||
jdParams := map[string]interface{}{
|
||||
"orderId": orderID,
|
||||
"storeId": storeID,
|
||||
"content": content,
|
||||
"replyPin": replayPin,
|
||||
}
|
||||
result, err := a.AccessAPINoPage("commentOutApi/orgReplyComment", jdParams, nil, nil, genNoPageResultParser("code", "msg", "result", "200"))
|
||||
if err == nil {
|
||||
return result.(string), nil
|
||||
}
|
||||
return "", err
|
||||
_, err := a.AccessAPINoPage("commentOutApi/orgReplyComment", jdParams, nil, nil, genNoPageResultParser("code", "msg", "result", "200"))
|
||||
return err
|
||||
}
|
||||
|
||||
// 根据到家门店编码修改商家自动接单接口
|
||||
|
||||
@@ -72,7 +72,7 @@ func TestUpdateStoreInfo4Open(t *testing.T) {
|
||||
|
||||
}
|
||||
func TestGetCommentByOrderId(t *testing.T) {
|
||||
testOrderID := int64(819498819000341)
|
||||
testOrderID := int64(822347450000922)
|
||||
result, err := jdapi.GetCommentByOrderId(testOrderID)
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
@@ -81,6 +81,7 @@ func TestGetCommentByOrderId(t *testing.T) {
|
||||
if gotOrderID != testOrderID {
|
||||
t.Fatalf("GetCommentByOrderId wrong, gotOrderID:%d", gotOrderID)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestUpdateStoreConfig4Open(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user