Browse Source

新快递

master
huangjiajun 6 months ago
parent
commit
6a81e9e965
5 changed files with 159 additions and 0 deletions
  1. +24
    -0
      third_tikTok_team_goods/goods_test.go
  2. +10
    -0
      third_tikTok_team_goods/novajo.go
  3. +25
    -0
      yunyangwl_express/api.go
  4. +51
    -0
      yunyangwl_express/channel.go
  5. +49
    -0
      yunyangwl_express/md.go

+ 24
- 0
third_tikTok_team_goods/goods_test.go View File

@@ -0,0 +1,24 @@
package third_tikTok_team_goods

import (
"testing"
)

func TestExpressSelect(t *testing.T) {
//mustParam := []int64{
// 6930397798538548962,6930397753046668476,6930382149381461150,6930390899859854984,6930402262656096103,6930408884577637463,6930406561283446552,6930413342276916649,6930413372764853296,6930384028040566535,6930402573128570851,6930415620191819405,6930415758530713009,6930402656258561457,6930415752639813041,6930387104429119451,6930400787719657243,6930415870484420060,6930388993629362104,6930407052091987139,6930413986048447496,6930400874061567679,6930405241407083851,
//}
//GetTeamOrder("61", "e7b60b27-c326-41c6-b77e-f7503c54e88f", mustParam)

mustParam := []int64{
6930487077000451886,
}
GetOrder("61", "e7b60b27-c326-41c6-b77e-f7503c54e88f", mustParam)

//mustParam := map[string]interface{}{
// "productId": 3373032197115217915,
//}
//send := GetGoodsDetail("61", "e7b60b27-c326-41c6-b77e-f7503c54e88f", mustParam)
//fmt.Println(send)

}

+ 10
- 0
third_tikTok_team_goods/novajo.go View File

@@ -36,6 +36,16 @@ func GetOrder(id, secret string, param []int64) {
fmt.Println(send)
return
}
func GetTeamOrder(id, secret string, param []int64) {
send, _ := SendPost("/kol/order", id, secret, param)
fmt.Println(send)
for _, v := range param {
if strings.Contains(send, zhios_third_party_utils.Int64ToStr(v)) == false {
fmt.Println(v)
}
}
return
}

//https://dyb.novajo.cn/open/kol-api
func Send(method string, id, secret string, param map[string]interface{}) (string, error) {


+ 25
- 0
yunyangwl_express/api.go View File

@@ -0,0 +1,25 @@
package yunyangwl_express

import (
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"fmt"
"github.com/syyongx/php2go"
"time"
)

//https://open.yunyangwl.com/#/developmentDocumentation
func Send(method, appid, secretKey string, params map[string]interface{}) (string, error) {
timeStamp := zhios_third_party_utils.Int64ToStr(time.Now().Unix() * 1000)
requestId := zhios_third_party_utils.UUIDString()
params["timeStamp"] = timeStamp
params["requestId"] = requestId
params["appid"] = appid
params["sign"] = php2go.Md5(appid + requestId + timeStamp + secretKey)
params["serviceCode"] = method
//url := "https://api.yunyangwl.com/api/sandbox/openService"
url := "https://api.yunyangwl.com/api/wuliu/openService"
post, err := zhios_third_party_utils.CurlPost(url, zhios_third_party_utils.SerializeStr(params), nil)
fmt.Println(string(post))
fmt.Println(err)
return string(post), err
}

+ 51
- 0
yunyangwl_express/channel.go View File

@@ -0,0 +1,51 @@
package yunyangwl_express

//检测渠道接口
func GetChannel(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("CHECK_CHANNEL_INTELLECT", appid, secretKey, params)
}

//查询账户余额接口
func GetBalance(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("QUERY_BALANCE", appid, secretKey, params)
}

//查询黑名单
func GetBLack(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("QUERY_BLACK", appid, secretKey, params)
}

//查询原价
func GetOriginalPrice(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("QUERY_ORIGINAL_PRICE", appid, secretKey, params)
}

//下单接口
func CreateOrder(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("ADD_BILL_INTELLECT", appid, secretKey, params)
}

//取消订单接口
func CancelOrder(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("CANCEL", appid, secretKey, params)
}

//查询运单轨迹接口
func GetTrance(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("QUERY_TRANCE", appid, secretKey, params)
}

//查询订单详情
func GetOrderDetail(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("QUERY_BILL_INFO", appid, secretKey, params)
}

//获取得物收件地址
func GetDewuAddress(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("QUERY_DEWU_ADDRESS", appid, secretKey, params)
}

//德邦筛单接口
func GetDebangCheck(appid, secretKey string, params map[string]interface{}) (string, error) {
return Send("CHECK_EXPRESS", appid, secretKey, params)
}

+ 49
- 0
yunyangwl_express/md.go View File

@@ -0,0 +1,49 @@
package yunyangwl_express

type YunyangwlExpressChannel struct {
Id string `json:"id"`
Code string `json:"code"`
Message string `json:"message"`
Result []struct {
OriginalPrice float64 `json:"originalPrice"`
DisPrice float64 `json:"disPrice"`
Freight float64 `json:"freight"`
FreightInsured int `json:"freightInsured"`
FreightHaocai int `json:"freightHaocai"`
TotalFreight float64 `json:"totalFreight"`
Channel string `json:"channel"`
ChannelId string `json:"channelId"`
ChannelExplain string `json:"channelExplain"`
ChannelLogoUrl string `json:"channelLogoUrl"`
AllowInsured int `json:"allowInsured"`
InsuredRate float64 `json:"insuredRate"`
Paozhong int `json:"paozhong"`
PayType int `json:"payType"`
ChargeType int `json:"chargeType"`
ChannelType int `json:"channelType"`
Comments string `json:"comments"`
PriceComments string `json:"priceComments"`
TagType string `json:"tagType"`
TagCode int `json:"tagCode"`
ExtFreightFlag bool `json:"extFreightFlag"`
ExtFreight int `json:"extFreight"`
Volume int `json:"volume"`
ParseWeight float64 `json:"parseWeight"`
LowWeight int `json:"lowWeight"`
LimitWeight int `json:"limitWeight"`
AppointTimes interface{} `json:"appointTimes"`
PriceOne float64 `json:"priceOne"`
PriceTwo interface{} `json:"priceTwo"`
PriceThree interface{} `json:"priceThree"`
PriceMore float64 `json:"priceMore"`
Price struct {
Id interface{} `json:"id"`
User interface{} `json:"user"`
PriceOne float64 `json:"priceOne"`
PriceMore float64 `json:"priceMore"`
PriceLevel interface{} `json:"priceLevel"`
Allow interface{} `json:"allow"`
} `json:"price"`
} `json:"result"`
Error interface{} `json:"error"`
}

Loading…
Cancel
Save