Quellcode durchsuchen

test

tags/v1.1.16
huangjiajun vor 1 Jahr
Ursprung
Commit
79f6aa10e1
2 geänderte Dateien mit 31 neuen und 18 gelöschten Zeilen
  1. +27
    -10
      macao_logistics/macao_logistics.go
  2. +4
    -8
      macao_logistics/macao_logistics_test.go

+ 27
- 10
macao_logistics/macao_logistics.go Datei anzeigen

@@ -1,12 +1,16 @@
package macao_logistics

import "github.com/tidwall/gjson"
import (
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"fmt"
"github.com/tidwall/gjson"
)

func GetToken() string {
params := map[string]interface{}{
"phone": "15217160421",
"password": "123456789@",
}
func GetToken(params map[string]interface{}) string {
//params := map[string]interface{}{
// "phone": "15217160421",
// "password": "123456789@",
//}
//7c2f6cbd480a96f1aa69509f9dd65462
send, err := Send("/jyb/admin/login/password", params, "")
if err != nil {
@@ -15,17 +19,30 @@ func GetToken() string {
return gjson.Get(send, "data.token").String()
}

func GetGoods(params map[string]interface{}) string {
send, err := SendGet("/admin/goods/detailed/list", params, "7c2f6cbd480a96f1aa69509f9dd65462")
func GetGoods(params map[string]interface{}, acctoken string) string {
send, err := SendGet("/admin/goods/detailed/list", params, acctoken)
if err != nil {
return ""
}
return gjson.Get(send, "data.data").String()
}
func GetStore(params map[string]interface{}) string {
send, err := SendGet("/jyb/order/delivery/store", params, "7c2f6cbd480a96f1aa69509f9dd65462")
func GetStore(params map[string]interface{}, acctoken string) string {
send, err := SendGet("/jyb/order/delivery/store", params, acctoken)
if err != nil {
return ""
}
return gjson.Get(send, "data.data").String()
}
func GetOrder(params map[string]interface{}, acctoken string) string {
send, err := SendGet("/jyb/order/delivery/list", params, acctoken)
if err != nil {
return ""
}
return gjson.Get(send, "data.data").String()
}
func RegUser(params map[string]interface{}) string {
header := make(map[string]string, 0)
data, _ := zhios_third_party_utils.CurlPost("https://mx.aoyunltd.com/wxnewshibaouser.php", params, header)
fmt.Println(string(data))
return string(data)
}

+ 4
- 8
macao_logistics/macao_logistics_test.go Datei anzeigen

@@ -4,14 +4,10 @@ import "testing"

func TestLogin(t *testing.T) {
params := map[string]interface{}{
"order_number": "test12311", //單號,長度不可以超過30
"phone": "15217160421", // 电话号码長度為8 or 11
"arrive": "60", // 門店個點ID,可以用ID 也可以用AYG001的參數
"type": "1", // 是指的是快件是否預付,1代表是用戶支付2是商家餘額支付,3是商家月結
"weight": "20", // 重量,必須是int,沒有小數點
"order_type": "1",
"city": "珠海",
"phoneno": "15217160421", //
"nickname": "黄", //
"cainiao_match": "AYD001",
}
//7c2f6cbd480a96f1aa69509f9dd65462
Send("/jyb/order/delivery/add", params, "7c2f6cbd480a96f1aa69509f9dd65462")
RegUser(params)
}

Laden…
Abbrechen
Speichern