1
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package dadaapi
|
package dadaapi
|
||||||
|
|
||||||
|
import "go.uber.org/zap"
|
||||||
|
|
||||||
//
|
//
|
||||||
//import (
|
//import (
|
||||||
// "net/http"
|
// "net/http"
|
||||||
@@ -11,11 +13,12 @@ package dadaapi
|
|||||||
// "go.uber.org/zap"
|
// "go.uber.org/zap"
|
||||||
//)
|
//)
|
||||||
//
|
//
|
||||||
//var (
|
var (
|
||||||
// dadaapi *API
|
dadaapi *API
|
||||||
// sugarLogger *zap.SugaredLogger
|
sugarLogger *zap.SugaredLogger
|
||||||
// testOrder *OperateOrderParams
|
testOrder *OperateOrderParams
|
||||||
//)
|
)
|
||||||
|
|
||||||
//
|
//
|
||||||
//const (
|
//const (
|
||||||
// testShopNo = "11047059"
|
// testShopNo = "11047059"
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package dadaapi
|
package dadaapi
|
||||||
|
|
||||||
//
|
//
|
||||||
//import (
|
import (
|
||||||
// "fmt"
|
//"fmt"
|
||||||
// "testing"
|
"testing"
|
||||||
//
|
|
||||||
// "git.rosy.net.cn/baseapi"
|
//"git.rosy.net.cn/baseapi"
|
||||||
// "git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
//)
|
)
|
||||||
|
|
||||||
//
|
//
|
||||||
//func TestAddOrderAfterQuery(t *testing.T) {
|
//func TestAddOrderAfterQuery(t *testing.T) {
|
||||||
// // orderID := utils.GetUUID()
|
// // orderID := utils.GetUUID()
|
||||||
@@ -65,13 +66,15 @@ package dadaapi
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//func TestQueryOrderInfo(t *testing.T) {
|
func TestQueryOrderInfo(t *testing.T) {
|
||||||
// result, err := dadaapi.QueryOrderInfo("80704840263399812")
|
dadaapi = New("dada154e2a41fd6cef3", "7f97d8f258b70b450f04e7ab274ed8f8", "6660", "http://callback.jxc4.com/dadadelivery/msg", true)
|
||||||
// if err != nil {
|
result, err := dadaapi.QueryOrderInfo("1454997324435816448")
|
||||||
// t.Fatal(err)
|
if err != nil {
|
||||||
// }
|
t.Fatal(err)
|
||||||
// t.Log(utils.Format4Output(result, false))
|
}
|
||||||
//}
|
t.Log(utils.Format4Output(result, false))
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//func TestAddTip(t *testing.T) {
|
//func TestAddTip(t *testing.T) {
|
||||||
// err := dadaapi.AddTip("80704840263399812", 1.0, "530100", "")
|
// err := dadaapi.AddTip("80704840263399812", 1.0, "530100", "")
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -18,7 +18,7 @@ import (
|
|||||||
// "authority_id": ""
|
// "authority_id": ""
|
||||||
//}`
|
//}`
|
||||||
|
|
||||||
var token = `{"access_token":"e1c4333c-6e5e-4db8-83d3-173923e0815f","expires_in":1677450559,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"89d62aee-5bb3-433c-9514-e435172a3263","authority_id":""}`
|
var token = `{"access_token":"f1ee4188-d49a-4eaf-9cb8-7d754a23d19e","expires_in":1678053416,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"08ce6c28-37b4-4c3e-9942-7d078c551bc2","authority_id":""}`
|
||||||
|
|
||||||
//var token = `{"access_token":"e3173e9f-266f-4d87-88e7-e7cd837bc9d9","expires_in":1672882632,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"5070aae2-493f-46bd-b5d6-6ea0cd64729f","authority_id":""}`
|
//var token = `{"access_token":"e3173e9f-266f-4d87-88e7-e7cd837bc9d9","expires_in":1672882632,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"5070aae2-493f-46bd-b5d6-6ea0cd64729f","authority_id":""}`
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func TestApi(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestQueryOrderDetail(t *testing.T) {
|
func TestQueryOrderDetail(t *testing.T) {
|
||||||
data, err := a.GetTiktokOrderDetail("5012575500183489614")
|
data, err := a.GetTiktokOrderDetail("5039319444977829100")
|
||||||
globals.SugarLogger.Debugf("=====%s", utils.Format4Output(data, false))
|
globals.SugarLogger.Debugf("=====%s", utils.Format4Output(data, false))
|
||||||
globals.SugarLogger.Debugf("=====%s", err)
|
globals.SugarLogger.Debugf("=====%s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,18 @@ func (a *API) UnsuspendStore(param *shop_unsuspendStore_request.ShopUnsuspendSto
|
|||||||
}
|
}
|
||||||
return response.Data, nil
|
return response.Data, nil
|
||||||
}
|
}
|
||||||
|
func (a *API) UnsuspendStore2(storeID int64) (*shop_unsuspendStore_response.ShopUnsuspendStoreData, error) {
|
||||||
|
request := shop_unsuspendStore_request.New()
|
||||||
|
request.Param.StoreId = storeID
|
||||||
|
response, err := request.Execute(a.accessTokenObj)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if response.Code != RequestSuccessCode {
|
||||||
|
return nil, errors.New(response.SubMsg)
|
||||||
|
}
|
||||||
|
return response.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
type VendorAndStoreId struct {
|
type VendorAndStoreId struct {
|
||||||
StoreId string `json:"store_id"` //京西本地ID
|
StoreId string `json:"store_id"` //京西本地ID
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user