go-common/app/interface/openplatform/seo/dao/item.go
2019-04-22 18:49:16 +08:00

22 lines
368 B
Go

package dao
import (
"context"
)
// GetItem get item page
func (d *Dao) GetItem(c context.Context, id int, bot bool) (res []byte, err error) {
key := getKey(id, _item, bot)
res, err = d.GetCache(c, key)
if err == nil && res != nil {
return
}
url := getUrl(id, _item, bot)
res, err = d.GetUrl(c, url)
if err == nil {
d.AddCache(c, key, res)
}
return
}