1
This commit is contained in:
@@ -30,7 +30,7 @@ func init() {
|
||||
// 天天果园
|
||||
//api = New("c45e6510-00ba-4be2-977e-bcb9c9792cc7", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26")
|
||||
// 京东果园 320406
|
||||
api = New("de4a9818-b171-41ed-ba37-0b060cad001f", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
||||
//api = New("de4a9818-b171-41ed-ba37-0b060cad001f", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
||||
// 京东白货
|
||||
//api = New("9053e4fd-4e0e-4e9e-8ab1-f348e5cbf3e7", "4602bd4b84984186815dbc03299c7094", "386ab19719d9470487011217d0c57349")
|
||||
// 果切 379599
|
||||
@@ -38,7 +38,7 @@ func init() {
|
||||
// 李氏水果 346254
|
||||
//api = New("c7c41cb6-6db4-4f67-a864-ca5f524653d0", "13493b4a951945f689dcc989b6693631", "7e28a37be43a430bb5928c835e482fe2")
|
||||
// 381564
|
||||
//api = New("4d0c707a-54eb-4f05-8187-6cedf95827c7", "d2d1e2e3213d4320bc2712a684307831", "1750f5b9848d4a6492c1c20b487074da")
|
||||
api = New("4d0c707a-54eb-4f05-8187-6cedf95827c7", "d2d1e2e3213d4320bc2712a684307831", "1750f5b9848d4a6492c1c20b487074da")
|
||||
// 390558
|
||||
//api = New("9053e4fd-4e0e-4e9e-8ab1-f348e5cbf3e7", "4602bd4b84984186815dbc03299c7094", "386ab19719d9470487011217d0c57349")
|
||||
|
||||
|
||||
@@ -79,12 +79,13 @@ func TestQueryChildCategoriesForOP(t *testing.T) {
|
||||
func TestDelete(t *testing.T) {
|
||||
var searchAfterSkuId string = ""
|
||||
for i := 0; i < 130; i++ {
|
||||
globals.SugarLogger.Debugf("----i:= %d", i)
|
||||
idList, afterSkuId, err := api.AuerySkuInfoList(int64(i), 20, searchAfterSkuId)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("--------err:%v", err)
|
||||
return
|
||||
}
|
||||
time.Sleep(time.Second * 5)
|
||||
time.Sleep(time.Second * 1)
|
||||
searchAfterSkuId = utils.Int64ToStr(afterSkuId)
|
||||
if len(idList) != 0 {
|
||||
globals.SugarLogger.Debugf("------len := %d", len(idList))
|
||||
|
||||
@@ -349,7 +349,9 @@ func (a *API) AuerySkuInfoList(pageNo, pageSize int64, searchAfterSkuId string)
|
||||
return nil, 0, err
|
||||
}
|
||||
skuList := data.(map[string]interface{})["result"]
|
||||
|
||||
if skuList == nil {
|
||||
return nil, 0, nil
|
||||
}
|
||||
sku := make([]*JDSkuList, 0, 0)
|
||||
json.Unmarshal([]byte(skuList.(string)), &sku)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ func (a *API) QueryBillBalance(param *QueryBillBalanceReq) (*QueryBillBalanceRes
|
||||
"ver": "1.0.0",
|
||||
"timestamp": time.Now().Unix(),
|
||||
}
|
||||
result, err := a.AccessAPISign(BillTestUrl, BillQuery, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(BillProdUrl, BillQuery, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func (a *API) EwalletWithdrawD1(param *EwalletWithdrawD1Req) (string, string, er
|
||||
"ver": "1.0.0",
|
||||
"timestamp": time.Now().Unix(),
|
||||
}
|
||||
result, err := a.AccessAPISign(BillTestUrl, BillDrawD1, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(BillProdUrl, BillDrawD1, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func (a *API) EwalletWithdrawQuery(param *EwalletWithdrawQueryReq) (*EwalletWith
|
||||
"ver": "1.0.0",
|
||||
"timestamp": time.Now().Unix(),
|
||||
}
|
||||
result, err := a.AccessAPISign(BillTestUrl, BillDrawD1Query, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(BillProdUrl, BillDrawD1Query, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -97,7 +97,7 @@ func (a *API) SettleDrawPattern(param *SettleDrawPatternReq) error {
|
||||
"ver": "1.0.0",
|
||||
"timestamp": time.Now().Unix(),
|
||||
}
|
||||
result, err := a.AccessAPISign(BillTestUrl, BillSettleProfile, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(BillProdUrl, BillSettleProfile, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -117,7 +117,7 @@ func (a *API) EwalletSettleQuery(bmcpNo, mercId string) (*EwalletSettleQueryResp
|
||||
"ver": "1.0.0",
|
||||
"timestamp": time.Now().Unix(),
|
||||
}
|
||||
result, err := a.AccessAPISign(BillTestUrl, BillSettleQuery, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(BillProdUrl, BillSettleQuery, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
// MerchantIncoming 商户进件接口
|
||||
func (a *API) MerchantIncoming(incoming *MerchantIncomingReq) (string, string, error) {
|
||||
data := utils.Struct2Map(incoming, "", false)
|
||||
result, err := a.AccessAPI2(BaseTestUrl, IncomingAction, http.MethodPost, "", data)
|
||||
result, err := a.AccessAPI2(BaseProdUrl, IncomingAction, http.MethodPost, "", data)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
@@ -21,7 +21,7 @@ func (a *API) MerchantIncoming(incoming *MerchantIncomingReq) (string, string, e
|
||||
// GetMerchantInfo 获取商户详细信息
|
||||
func (a *API) GetMerchantInfo(customerNo string) (*MerchantObj, error) {
|
||||
data := map[string]interface{}{"customerNo": customerNo}
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, GetMerchantInfo, http.MethodPost, "", data)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, GetMerchantInfo, http.MethodPost, "", data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -39,7 +39,7 @@ func (a *API) GetMerchantInfo(customerNo string) (*MerchantObj, error) {
|
||||
|
||||
// GetOrganizationCode 获取城市组织代码 parentCode = 1 查所有,城市code看看和我们系统一致不
|
||||
func (a *API) GetOrganizationCode(parentCode string) ([]*OrganizationList, error) {
|
||||
result, err := a.AccessAPI(BaseTestUrl, OrganizationAction, http.MethodGet, parentCode, nil)
|
||||
result, err := a.AccessAPI(BaseProdUrl, OrganizationAction, http.MethodGet, parentCode, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func (a *API) GetBankList(areaCode, bankName string) ([]*BankListResult, error)
|
||||
if bankName != "" {
|
||||
param["bankName"] = bankName
|
||||
}
|
||||
result, err := a.AccessAPI(BaseTestUrl, BankList, http.MethodGet, "", param)
|
||||
result, err := a.AccessAPI(BaseProdUrl, BankList, http.MethodGet, "", param)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -92,12 +92,12 @@ func (a *API) GetMerchantMcc(businessScene string, parentCode string) (data []*B
|
||||
retVal := map[string]interface{}{}
|
||||
|
||||
if parentCode != "" { // 获取小类
|
||||
retVal, err = a.AccessAPI(BaseTestUrl, MerchantMcc, http.MethodGet, parentCode, nil)
|
||||
retVal, err = a.AccessAPI(BaseProdUrl, MerchantMcc, http.MethodGet, parentCode, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
retVal, err = a.AccessAPI(BaseTestUrl, MerchantMcc, http.MethodGet, "", map[string]interface{}{"businessScene": businessScene})
|
||||
retVal, err = a.AccessAPI(BaseProdUrl, MerchantMcc, http.MethodGet, "", map[string]interface{}{"businessScene": businessScene})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -126,7 +126,7 @@ func (a *API) MerchantFeeQuery(customerNo string, productCode string) (*Merchant
|
||||
if productCode != "" {
|
||||
param["productCode"] = productCode
|
||||
}
|
||||
result, err := a.AccessAPI(BaseTestChangeUrl, UpdateFeeQuery, http.MethodGet, customerNo, param)
|
||||
result, err := a.AccessAPI(BaseProdChangeUrl, UpdateFeeQuery, http.MethodGet, customerNo, param)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -145,7 +145,7 @@ func (a *API) MerchantFeeChange(param *FeeChangeReq, customerNo string) (int, st
|
||||
}
|
||||
mapParam := utils.Struct2Map(param, "", false)
|
||||
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, UpdateFeeQuery, http.MethodPost, customerNo, mapParam)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, UpdateFeeQuery, http.MethodPost, customerNo, mapParam)
|
||||
|
||||
if err != nil {
|
||||
return 0, "", err
|
||||
@@ -168,7 +168,7 @@ func (a *API) UpdateSettleInfo(customerNo string, param *UpdateSettleInfoReq) (*
|
||||
}
|
||||
mapParam := utils.Struct2Map(param, "", false)
|
||||
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, UpdateSettleChange, http.MethodPost, customerNo, mapParam)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, UpdateSettleChange, http.MethodPost, customerNo, mapParam)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@@ -196,7 +196,7 @@ func (a *API) UpdateBaseInfo(customerNo string, changeBaseMap *UpdateBaseInfoReq
|
||||
newMap := utils.Struct2Map(changeBaseMap, "'", false)
|
||||
base := utils.MergeMaps(newMap, map[string]interface{}{"customerNo": customerNo})
|
||||
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, UpdateBaseChange, http.MethodPost, "", base)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, UpdateBaseChange, http.MethodPost, "", base)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -209,7 +209,7 @@ func (a *API) UpdateBaseInfo(customerNo string, changeBaseMap *UpdateBaseInfoReq
|
||||
|
||||
// QueryMerchantReviewStatus 查询变更门店审核状态
|
||||
func (a *API) QueryMerchantReviewStatus(reviewRelatedId string) (string, string, error) {
|
||||
result, err := a.AccessAPI(BaseTestQueryReviewStatus, QueryChangeReviewStatus, http.MethodGet, "", map[string]interface{}{"reviewRelatedId": reviewRelatedId})
|
||||
result, err := a.AccessAPI(BaseProdQueryReviewStatus, QueryChangeReviewStatus, http.MethodGet, "", map[string]interface{}{"reviewRelatedId": reviewRelatedId})
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
@@ -227,7 +227,7 @@ func (a *API) QueryMerchantReviewStatus(reviewRelatedId string) (string, string,
|
||||
|
||||
// CheckImgIsSupplement 查看是否补充照片
|
||||
func (a *API) CheckImgIsSupplement(externalCustomerNo string) (*OpenCustomerExtImgVo, error) {
|
||||
result, err := a.AccessAPI(BaseTestChangeUrl, CheckImgIsSupplement, http.MethodGet, externalCustomerNo, nil)
|
||||
result, err := a.AccessAPI(BaseProdChangeUrl, CheckImgIsSupplement, http.MethodGet, externalCustomerNo, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func (a *API) CheckImgIsSupplement(externalCustomerNo string) (*OpenCustomerExtI
|
||||
|
||||
// ImgSupplement 照片补充
|
||||
func (a *API) ImgSupplement(param *ImgSupplementReq) error {
|
||||
result, err := a.AccessAPI(BaseTestChangeUrl, ImgIsSupplement, http.MethodPost, "", utils.Struct2Map(param, "", false))
|
||||
result, err := a.AccessAPI(BaseProdChangeUrl, ImgIsSupplement, http.MethodPost, "", utils.Struct2Map(param, "", false))
|
||||
imgSupplementResp := &ImgSupplementResp{}
|
||||
if err = utils.Map2StructByJson(result, imgSupplementResp, false); err != nil {
|
||||
return err
|
||||
@@ -270,7 +270,7 @@ func (a *API) GetMerchantReportStatus(orgCode, agentNo, externalCustomerNo strin
|
||||
"agentNo": agentNo,
|
||||
"externalCustomerNo": externalCustomerNo,
|
||||
}
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, ImgIsSupplement, http.MethodPost, "", param)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, ImgIsSupplement, http.MethodPost, "", param)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -299,7 +299,7 @@ func (a *API) GetMerchantTerminal(orgCode, agentNo, externalCustomerNo, posSn st
|
||||
"externalCustomerNo": externalCustomerNo,
|
||||
"posSn": posSn,
|
||||
}
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, TerminalStatus, http.MethodPost, "", param)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, TerminalStatus, http.MethodPost, "", param)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -323,7 +323,7 @@ func (a *API) GetMerchantTerminal(orgCode, agentNo, externalCustomerNo, posSn st
|
||||
// SupplementBusinessLicense 变更营业执照
|
||||
func (a *API) SupplementBusinessLicense(param *BusinessLicenseReq) (string, string, error) {
|
||||
req := utils.Struct2Map(param, "", false)
|
||||
result, err := a.AccessAPI2(BaseTestChangeUrl, SupplementBusinessLicense, http.MethodPost, "", req)
|
||||
result, err := a.AccessAPI2(BaseProdChangeUrl, SupplementBusinessLicense, http.MethodPost, "", req)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
@@ -341,7 +341,7 @@ func (a *API) SupplementBusinessLicense(param *BusinessLicenseReq) (string, stri
|
||||
|
||||
// UnionPayMerInfo 银联商户信息共享联防机制查询
|
||||
func (a *API) UnionPayMerInfo(larName, larIdcard string) (*DishonestPerson, error) {
|
||||
result, err := a.AccessAPI(BaseTestChangeUrl, UnionPayMerInfo, http.MethodPost, "", map[string]interface{}{
|
||||
result, err := a.AccessAPI(BaseProdChangeUrl, UnionPayMerInfo, http.MethodPost, "", map[string]interface{}{
|
||||
"larName": larName,
|
||||
"larIdcard": larIdcard,
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ func (a *API) CreateOrder(param *CreateOrderReq) (*CreateOrderResp, error) {
|
||||
"version": Version2,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(OrderTestUrl, CrateOrderActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(OrderProdUrl, CrateOrderActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func (a *API) CloseOrder(param *CloseOrderReq) (string, error) {
|
||||
"version": Version2,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(OrderTestUrl, CloseOrderActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(OrderProdUrl, CloseOrderActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func (a *API) QueryOrder(outOrderNo string, merchantNo string) (*QueryOrderResp,
|
||||
"version": Version2,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(OrderTestUrl, QueryOrderActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(OrderProdUrl, QueryOrderActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -96,7 +96,7 @@ func (a *API) RefundOrder(param *RefundOrderReq) (*RefundOrderResp, error) {
|
||||
"version": Version2,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(OrderTestUrl, OrderRefundActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(OrderProdUrl, OrderRefundActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -128,7 +128,7 @@ func (a *API) RefundOrderQuery(param *RefundOrderQueryReq) ([]*RefundOrderQueryR
|
||||
"version": Version2,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(OrderTestUrl, OrderRefundQueryActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(OrderProdUrl, OrderRefundQueryActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func (a *API) AggregatePay(param *AggregatePayReq) (*AggregatePayResp, error) {
|
||||
"version": Version3,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(PayTestUrl, PayActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(PayProdUrl, PayActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -44,7 +44,7 @@ func (a *API) AggregateRefund(param *AggregateRefundReq) (*AggregateRefundResp,
|
||||
"version": Version3,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(PayTestUrl, RefundActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(PayProdUrl, RefundActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -74,7 +74,7 @@ func (a *API) PayStatusQuery(param *PayStatusQueryReq) (*PayStatusQueryResp, err
|
||||
"version": Version3,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(PayTestUrl, PayQueryActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(PayProdUrl, PayQueryActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -103,7 +103,7 @@ func (a *API) ScannerPayMicroPay(param *PayMicroPayReq) (string, string, string,
|
||||
"version": Version3,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(PayTestUrl, PayMicropayActive, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(PayProdUrl, PayMicropayActive, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", "", "", err
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ func (a *API) CreateSeparate(param *CreateSeparateReq) (string, error) {
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateAccountApplyAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateAccountApplyAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -51,7 +51,7 @@ func (a *API) SeparateModify(modify *SeparateModifyReq) (string, error) {
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateAccountModifyAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateAccountModifyAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -83,7 +83,7 @@ func (a *API) SeparateQuery(query *SeparateQueryReq) (*SeparateQueryResp, error)
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateAccountQueryAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateAccountQueryAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func (a *API) CreateSeparateRecipient(recipient *CreateSeparateRecipientReq) (st
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateReceiverApplyAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateReceiverApplyAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -166,7 +166,7 @@ func (a *API) UpdateSeparateRecipient(param *UpdateSeparateRecipientReq) (string
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateReceiverModifyAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateReceiverModifyAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func (a *API) QuerySeparateRecipient(orderNo, receiverNo string) (*QuerySeparate
|
||||
"receiverNo": receiverNo,
|
||||
},
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateReceiverQueryAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateReceiverQueryAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -224,7 +224,7 @@ func (a *API) ApplyBind(param *SeparateApplyBindReq) (*SeparateApplyBindResp, er
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateBindAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateBindAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -253,7 +253,7 @@ func (a *API) SeparateUnBind(param *SeparateUnBindReq) (string, error) {
|
||||
"version": Version,
|
||||
"reqTime": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateUnBindAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateUnBindAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -282,7 +282,7 @@ func (a *API) Separate(param *OrderSeparateReq) (string, string, error) {
|
||||
"version": Version,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateTest, SeparateOrder, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateProd, SeparateOrder, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
@@ -311,7 +311,7 @@ func (a *API) SeparateCancel(param *SeparateCancelReq) (*SeparateCancelResp, err
|
||||
"version": Version,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateTest, SeparateCancel, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateProd, SeparateCancel, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -339,7 +339,7 @@ func (a *API) SeparateFallBack(param *SeparateFallReq) (*SeparateFallResp, error
|
||||
"version": Version,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateTest, SeparateFallBack, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateProd, SeparateFallBack, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -371,7 +371,7 @@ func (a *API) SeparateResultQuery(merchantNo, separateNo string) (*SeparateResul
|
||||
"version": Version,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateTest, SeparateQuery, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateProd, SeparateQuery, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -404,7 +404,7 @@ func (a *API) SeparateQueryAmt(merchantNo, logNo, logDate string) (*SeparateQuer
|
||||
"version": Version,
|
||||
"req_time": utils.Time2TimeStrByFormat(time.Now(), TimeFormat),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateTest, SeparateQueryAmt, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateProd, SeparateQueryAmt, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -439,7 +439,7 @@ func (a *API) QueryCarBin(orderNo, orgCode, cardNo string) (*BinInfo, error) {
|
||||
"timestamp": utils.Int64ToStr(time.Now().Unix()),
|
||||
"reqId": utils.GetUUID(),
|
||||
}
|
||||
result, err := a.AccessAPISign(SeparateAccountTestUrl, SeparateCardBinAction, http.MethodPost, "", reqParameter)
|
||||
result, err := a.AccessAPISign(SeparateAccountProdUrl, SeparateCardBinAction, http.MethodPost, "", reqParameter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
// IncomingToken 进件api,token获取
|
||||
func (a *API) IncomingToken() (comingToken string, expiresIn int64, err error) {
|
||||
result, err := a.AccessAPI(IncomingUrlTest, TokenActive, http.MethodPost, "", map[string]interface{}{
|
||||
result, err := a.AccessAPI(IncomingUrlProd, TokenActive, http.MethodPost, "", map[string]interface{}{
|
||||
"grant_type": "client_credentials",
|
||||
"client_id": a.clientId,
|
||||
"client_secret": a.clientSecret,
|
||||
@@ -43,7 +43,7 @@ func (a *API) IncomingToken() (comingToken string, expiresIn int64, err error) {
|
||||
|
||||
// ModifiedToken 更新token获取
|
||||
func (a *API) ModifiedToken(userName string, password string) (modifiedToken string, modifiedExpire int64, err error) {
|
||||
result, err := a.AccessAPI(IncomingUrlTest, TokenActive, http.MethodPost, "", map[string]interface{}{
|
||||
result, err := a.AccessAPI(ModifiedUrlProd, TokenActive, http.MethodPost, "", map[string]interface{}{
|
||||
"grant_type": "password",
|
||||
"username": userName,
|
||||
"password": password,
|
||||
@@ -98,7 +98,7 @@ func (a *API) FileUpload(filePath, imgType, sourcechnl, isOcr string) (*UploadIm
|
||||
}
|
||||
|
||||
// 创建 HTTP 请求
|
||||
req, err := http.NewRequest("POST", fmt.Sprintf("%s/%s", BaseTestUrl, FileUpload), body)
|
||||
req, err := http.NewRequest("POST", fmt.Sprintf("%s/%s", BaseProdUrl, FileUpload), body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -66,15 +66,17 @@ const (
|
||||
|
||||
// 测试参数
|
||||
const (
|
||||
ClientID = "testsit"
|
||||
ClientSecret = "EguwEckByf2I6u6z"
|
||||
UserName = "13200000001"
|
||||
Password = `klik13!@`
|
||||
BusiCode = "ZPOS4G"
|
||||
ActivityId = 4
|
||||
UserNo = "20000101"
|
||||
PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB"
|
||||
PrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw=="
|
||||
ClientID = "cdrx"
|
||||
ClientSecret = "LBQhKelGi8223ovH"
|
||||
//UserName = "13200000001"
|
||||
//Password = `klik13!@`
|
||||
UserName = "rhwlcs"
|
||||
Password = `Cs123789`
|
||||
BusiCode = "ZPOS4G"
|
||||
ActivityId = 4
|
||||
UserNo = "24354409"
|
||||
PublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSCWRQiVePGvXp7gUK3GLieXKwSCk80uuI0JbmLE5QCZJU9e+fYNMRPC5xAeGudrxMRuwKCADyWwcsOzqjVwZHP2RqBN8JmoxOhKbDAa/xDJlhCySt33At+dVIy0n7k9SgA5qXom3FN29OQL2gOMQUVhlj/ZHYpmSXsoqnmgkohwIDAQAB"
|
||||
PrivateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAJIJZFCJV48a9enuBQrcYuJ5crBIKTzS64jQluYsTlAJklT1759g0xE8LnEB4a52vExG7AoIAPJbByw7OqNXBkc/ZGoE3wmajE6EpsMBr/EMmWELJK3fcC351UjLSfuT1KADmpeibcU3b05AvaA4xBRWGWP9kdimZJeyiqeaCSiHAgMBAAECgYBenAsLSg8ZvSO4C+XkZWcCxh+RKQ7eQt8o4coBEI8jty/ALxywqm/TaKPFvqxQ9MeEuyXMUecbG/IHq8+PZp+/qj831bIt+v2Or5mZ/grkr/ZPt96sHJwY5GtIGyHrDfiEmAmHazo6clEf8+qC4z7AhqwWmjjRF3Zl404BkeiKUQJBAMJx7UuwpepryKyeHSOWf44nLwAM9Ejmeg6zPPVjQyI02btqWcgVhpwhers7ikyV37eE1WX2gtEM3DSb38o2xVUCQQDARGQqcGPftuygq1aIodBbUwZjhM+A5yBvISaUceqGg0mvb8icaXRmAYPzOt9ehp+S8I8uZU2bgsyFX671cfZrAkA43VSGVCzRd6ACS2M+Kx82lWL7Ys52G2EKt4RWRyc087vRQXLsPs9VDb100B7L8vCwHNrDrOno9RfZEtTJsGbZAkA+2hykgvkjOPlBzMENCVjDgfCkt9XdnbDMo1mpTVQNhP2hjDlYaGDUt8oayTQcAoZH0rv7vsIQBEI3l3/qXMbhAkAnwX9+BfhkN+4e68051kAOcjxJEDd+p9B6oyvv4ln+YswWcNuqjbrgZM1K7WUksBtgV0Zpp5aX/RN6CCVWsb9v"
|
||||
)
|
||||
|
||||
// token访问路由
|
||||
|
||||
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_lfakvRM4GLSa_VLMUIZDHA")
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_lfakvRM4GLSa_VLMUIZDHA")
|
||||
//cookieStr := `
|
||||
// acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
//`
|
||||
|
||||
@@ -409,22 +409,43 @@ func TestRetailSkuStock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRetailSellStatus(t *testing.T) {
|
||||
result, err := api.RetailSellStatus(utils.GetUUID(), "17088914", []*BareStoreFoodInfo{
|
||||
&BareStoreFoodInfo{
|
||||
AppFoodCode: "2429611",
|
||||
Skus: []*BareStoreSkuInfo{
|
||||
&BareStoreSkuInfo{
|
||||
//SkuID: "22781",
|
||||
//Price: "18.7",
|
||||
//Stock: "0",
|
||||
},
|
||||
},
|
||||
},
|
||||
}, SellStatusOffline)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
i := 0
|
||||
for {
|
||||
// 同步商品
|
||||
fromFoodList, err1 := api.RetailListAll("21792195", i)
|
||||
if len(fromFoodList) == 0 || fromFoodList == nil {
|
||||
fmt.Println(fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i))
|
||||
return
|
||||
}
|
||||
if len(fromFoodList) != 0 {
|
||||
for _, food := range fromFoodList {
|
||||
if strings.Contains(food.Name, "烤鸡") || strings.Contains(food.Name, "烤鸭") || strings.Contains(food.Name, "啤酒") || strings.Contains(food.Name, "雪糕") {
|
||||
_, err := api.RetailSellStatus(utils.GetUUID(), "21792195", []*BareStoreFoodInfo{
|
||||
&BareStoreFoodInfo{
|
||||
AppFoodCode: food.AppFoodCode,
|
||||
Skus: []*BareStoreSkuInfo{
|
||||
//&BareStoreSkuInfo{
|
||||
// // SkuID: "",
|
||||
// // Price: "18.7",
|
||||
// // Stock: "0",
|
||||
// //},
|
||||
},
|
||||
},
|
||||
}, SellStatusOffline)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
|
||||
//
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestRetailSellStatus2(t *testing.T) {
|
||||
@@ -505,7 +526,3 @@ func TestSplit(t *testing.T) {
|
||||
fmt.Println("len-======", len(cc))
|
||||
globals.SugarLogger.Debugf("cc %s", utils.Format4Output(cc, false))
|
||||
}
|
||||
|
||||
func Test22222(t *testing.T) {
|
||||
fmt.Println(32&(2|32) != 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user