Open kolkov opened 5 years ago
Hi! How can I get json from MySql to my model struct? Is this possible?
type Cargo struct { Id int64 `json:"id"` CompanyId int64 `json:"companyId"` ShipperId int64 `json:"shipperId"` ConsigneeId int64 `json:"consigneeId"` ConsigneeContacts ConsigneeContacts `json:"consigneeContacts"` Type int ShippingName string `json:"shippingName"` ReceiptNumber int `json:"receiptNumber"` IncomingDate null.Time `json:"incomingDate"` PackagesNumber int `json:"packagesNumber"` Volume float64 `json:"volume"` Weight float32 `json:"weight"` Status string `json:"status"` WaggonObservedId int `json:"waggonObservedId"` Note string `json:"'note'"` CreatorId int `json:"creatorId"` CreatedAt null.Time `json:"createdAt"` } type ConsigneeContacts struct { Phones []string `json:"phones"` Emails []string `json:"emails"` }
{"emails": ["a.aaa@aaa.com"], "phones": ["9161234567"]}
Thanks!
Hi! How can I get json from MySql to my model struct? Is this possible?
{"emails": ["a.aaa@aaa.com"], "phones": ["9161234567"]}
Thanks!