53 lines
1.1 KiB
Go
53 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/instance"
|
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
|
"context"
|
|
"log"
|
|
)
|
|
|
|
// main 这只是一个演示
|
|
func main() {
|
|
zltx()
|
|
}
|
|
|
|
func zltx() {
|
|
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(conf.Tag).Order(context.Background(), getOrderRequest())
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
log.Printf("Order res:%+v", res)
|
|
}
|
|
|
|
func getOrderRequest() *proto.OrderRequest {
|
|
return &proto.OrderRequest{
|
|
Config: &proto.Config{
|
|
AppId: "23329",
|
|
AppKey: "8db16e8cc8363ed4eb4c14f9520bcc32",
|
|
BaseUri: "http://test.openapi.1688sup.cn",
|
|
NotifyUrl: "http://test.openapi.1688sup.cn",
|
|
},
|
|
Order: &proto.OrderRequest_Order{
|
|
OrderNo: "test_main_zltx_6",
|
|
Account: "18666666666",
|
|
Extra: nil,
|
|
},
|
|
Product: &proto.OrderRequest_Product{
|
|
ProductNo: "106",
|
|
Extra: []byte(`{}`),
|
|
},
|
|
}
|
|
}
|