-
Notifications
You must be signed in to change notification settings - Fork 15
/
respsonse_test.go
81 lines (78 loc) · 2.4 KB
/
respsonse_test.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package tiktok
import (
"encoding/json"
"fmt"
"testing"
)
func TestProductData(t *testing.T) {
img01 := Image{
ID: "ACC", Height: 1, Width: 2, ThumbUrlList: []string{"01.JPG", "02.JPG"}, UrlList: []string{"www.google.com", "twitter.com"},
}
data := &ProductData{
ProductID: "A",
ProductStatus: 1,
ProductName: "A",
CategoryList: []Category{
{
ID: "C1", ParentID: "003", LocalDisplayName: "LAKE-NIKE", IsLeaf: false,
},
},
Brand: Brand{
ID: "P", Name: "Nike",
},
Images: []Image{
{
ID: "ACC", Height: 1, Width: 2, ThumbUrlList: []string{"01.JPG", "02.JPG"}, UrlList: []string{"www.google.com", "twitter.com"},
},
},
Video: Video{
ID: "tokyo", Duration: 12.5, MediaType: "mkv", PostUrl: "www.yyets.com", VideoInfos: []VideoInfo{
{Height: 1, Width: 2, FileHash: "29393ns9s23=", Format: "mpv", MainUrl: "shipping.com", Size: 1, UrlExpire: 3600, BackupUrl: "www.g.com", Bitrate: 1024},
},
},
Description: "nike sb series",
WarrantyPeriod: struct {
WarrantyID int `json:"warranty_id"`
WarrantyDescription string `json:"warranty_description"`
}(struct {
WarrantyID int
WarrantyDescription string
}{WarrantyID: 996, WarrantyDescription: "996 day"}),
WarrantyPolicy: "free return",
PackageHeight: 100,
PackageLength: 99,
PackageWidth: 7,
PackageWeight: "100kg",
Skus: []SKUData{
{
Price: Price{OriginalPrice: "100", PriceIncludeVat: "1", Currency: "IDR"},
SellerSku: "ship-id-iphone13",
ID: "zh-fz-01",
StockInfos: []StockInfo{{WarehouseID: "001", AvailableStock: 10}},
SalesAttributes: []SalesAttr{
{ID: "001", Name: "ABC", ValueID: "9", ValueName: "COLOR", SkuImg: img01},
},
},
},
ProductCertifications: []Certification{
{ID: "1a", Title: "disney", Files: []File{
{ID: "1", List: []string{"P", "Q"}, Name: "QQ", Type: "PDF"},
}},
},
SizeChart: img01,
IsCodOpen: false,
ProductAttributes: []ProductAttribute{{ID: "12", Name: "pptv", Values: []Value{{ID: "LL", Name: "waka"}}}},
QcReasons: []QCReason{{Reason: "Illegal", SubReasons: []string{"R18", "AV"}}},
UpdateTime: 1652684619,
CreateTime: 1652684619,
DeliveryServices: []DeliveryService{
{
DeliveryServiceStatus: false,
DeliveryServiceID: 12,
DeliveryOptionName: "J&T Express",
},
},
}
d, _ := json.Marshal(data)
fmt.Println(string(d))
}