54 lines
1.1 KiB
Go
54 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/instance"
|
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
var appId = "23329"
|
|
var appKey = "8db16e8cc8363ed4eb4c14f9520bcc32"
|
|
var baseUri = "http://test.openapi.1688sup.cn"
|
|
var notifyUrl = "http://test.openapi.1688sup.cn"
|
|
|
|
// main 这只是一个演示
|
|
func main() {
|
|
conf := &instance.PkgConf{
|
|
Cmd: "pkg/zltx",
|
|
Tag: "zltx",
|
|
Version: 1,
|
|
CookieKey: "zltx",
|
|
CookieValue: "zltx",
|
|
}
|
|
err := instance.Load([]*instance.PkgConf{conf})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
res, err := instance.Get("zltx").Order(context.Background(), getRequest())
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
log.Printf("Order res:%+v", res)
|
|
}
|
|
|
|
func getRequest() *proto.OrderRequest {
|
|
return &proto.OrderRequest{
|
|
Config: &proto.Config{
|
|
AppId: appId,
|
|
AppKey: appKey,
|
|
BaseUri: baseUri,
|
|
NotifyUrl: notifyUrl,
|
|
},
|
|
Order: &proto.OrderRequest_Order{
|
|
OrderNo: "test_main_zltx_6",
|
|
Account: "18666666666",
|
|
Extra: nil,
|
|
},
|
|
Product: &proto.OrderRequest_Product{
|
|
ProductNo: "106",
|
|
Extra: []byte(`{}`),
|
|
},
|
|
}
|
|
}
|