-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
38 lines (28 loc) · 867 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"fmt"
"log"
"os"
"github.com/buroz/gon11/src/n11"
"github.com/joho/godotenv"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
os.Exit(1)
}
var (
appKey = os.Getenv("APP_KEY")
appSecret = os.Getenv("APP_SECRET")
)
var client = n11.Client{}
user := client.Create(appKey, appSecret)
// pagination := protos.PagingDataRequest{}
attr := client.Services.ProductService.GetProductByProductId(user, 369857815)
fmt.Println(attr.Body.GetProductByProductIdResponse.Product.Title)
fmt.Println(attr.Body.GetProductByProductIdResponse.Product.SubTitle)
fmt.Println(attr.Body.GetProductByProductIdResponse.Product.ProductSellerCode)
fmt.Println(attr.Body.GetProductByProductIdResponse.Product.Price)
fmt.Println(attr.Body.GetProductByProductIdResponse.Product.CurrentAmount)
}