model.go
667 Bytes
package models
import (
"../yoho"
"github.com/antonholmquist/jason"
)
var api *yoho.Http
func init() {
api = yoho.Api("http://api.yoho.cn")
}
func GetDetailInfo(pid int64, ch string, gender string) *jason.Object {
product, _ := getProduct(pid)
//smallSortId, _ := product.GetInt64("data", "smallSortId")
//maxSortId, _ := product.GetInt64("data", "maxSortId")
//productId, _ := product.GetInt64("data", "product_id")
//productSkn, _ := product.GetInt64("data", "product_skn")
return product
}
func getProduct(pid int64) (*jason.Object, error) {
return api.Get("", map[string]interface{} {
"method" : "app.product.data",
"product_id": pid,
})
}