log delete

This commit is contained in:
richboo111
2022-10-22 16:09:20 +08:00
parent 277b8a8271
commit 6ae7a3f179
3 changed files with 49 additions and 54 deletions

View File

@@ -1,50 +1,51 @@
package q_bida
import (
"fmt"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/jx-callback/globals"
"go.uber.org/zap"
"testing"
)
var (
api *Api
sugarLogger *zap.SugaredLogger
)
func init() {
logger, _ := zap.NewDevelopment()
sugarLogger = logger.Sugar()
baseapi.Init(sugarLogger)
}
// 获取登录
func TestLogin(t *testing.T) {
api := NewQBiDa("18048531223", "18080188338")
fmt.Println("api=========", api.expirationTime)
fmt.Println("api=========", api.password)
fmt.Println("api=========", api.account)
fmt.Println("api=========", api.token)
}
// 获取所有的快递费接口
func TestGatAllFee(t *testing.T) {
api := NewQBiDa("18048531223", "18080188338")
result, err := api.GetExpressPrice(&GetExpressPriceReq{
PromiseTimeType: 0,
DeliveryType: 0,
GoodsValue: 1000,
SendAddress: "四川省成都市金牛区二环北路一段10号万科加州湾V派616",
ReceiveAddress: "北京市北京市朝阳区容达路7号太极产业园",
Type: 0,
Weight: 1,
Length: 100,
Height: 100,
Width: 100,
SendPhone: "18981810340",
})
globals.SugarLogger.Debug("err===", err)
globals.SugarLogger.Debug("data===", &result)
}
//
//import (
// "fmt"
// "git.rosy.net.cn/baseapi"
// "git.rosy.net.cn/jx-callback/globals"
// "go.uber.org/zap"
// "testing"
//)
//
//var (
// api *Api
// sugarLogger *zap.SugaredLogger
//)
//
//func init() {
// logger, _ := zap.NewDevelopment()
// sugarLogger = logger.Sugar()
// baseapi.Init(sugarLogger)
//}
//
//// 获取登录
//func TestLogin(t *testing.T) {
// api := NewQBiDa("18048531223", "18080188338")
// fmt.Println("api=========", api.expirationTime)
// fmt.Println("api=========", api.password)
// fmt.Println("api=========", api.account)
// fmt.Println("api=========", api.token)
//}
//
//// 获取所有的快递费接口
//func TestGatAllFee(t *testing.T) {
// api := NewQBiDa("18048531223", "18080188338")
// result, err := api.GetExpressPrice(&GetExpressPriceReq{
// PromiseTimeType: 0,
// DeliveryType: 0,
// GoodsValue: 1000,
// SendAddress: "四川省成都市金牛区二环北路一段10号万科加州湾V派616",
// ReceiveAddress: "北京市北京市朝阳区容达路7号太极产业园",
// Type: 0,
// Weight: 1,
// Length: 100,
// Height: 100,
// Width: 100,
// SendPhone: "18981810340",
// })
// globals.SugarLogger.Debug("err===", err)
// globals.SugarLogger.Debug("data===", &result)
//
//}

View File

@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"git.rosy.net.cn/baseapi/platformapi"
"git.rosy.net.cn/jx-callback/globals"
"net/http"
"strings"
)
@@ -49,6 +48,5 @@ func (a *API) AccessAPI2(url string, params map[string]interface{}) (retVal map[
retVal = jsonResult1
return platformapi.ErrLevelSuccess, nil
})
globals.SugarLogger.Debug("我也不知道哪里出错返回一下retVal", retVal)
return retVal, err
}

View File

@@ -3,18 +3,15 @@ package tiktok
import (
"errors"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
)
// 获取抖音登录授权2
func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
globals.SugarLogger.Debug("初始code=============", code)
tokenReq := make(map[string]interface{}, 3)
tokenReq["appid"] = a.GetAppID()
tokenReq["code"] = code
tokenReq["secret"] = a.GetSecret()
tokenReq["anonymous_code"] = ""
globals.SugarLogger.Debug("输出tokenReq", tokenReq)
result, err := a.AccessAPI2(GetTiktokOauth, tokenReq)
if err != nil {
return nil, err
@@ -28,7 +25,6 @@ func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
if oauthAccessToken.ErrNo != 0 {
return nil, errors.New(oauthAccessToken.ErrTips)
}
globals.SugarLogger.Debug("再来输出一下oauthAccessToken", oauthAccessToken)
return oauthAccessToken, nil
}