1234567891011121314151617181920 |
- package client
- import (
- "fmt"
- "time"
- )
- func QueryProducts(client *FhoClient, lastUpdatedTime time.Time) ([]*Product, error) {
- data, err := client.query("products", lastUpdatedTime)
- if err != nil {
- fmt.Println("query error:", err.Error())
- return nil, err
- }
- var products []*Product
- for _, rec := range data {
- _product := ProductFromMap(rec)
- products = append(products, _product)
- }
- return products, nil
- }
|