go-common/app/interface/openplatform/seo/dao/sitemap.go

21 lines
373 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package dao
import (
"context"
"errors"
"go-common/app/interface/openplatform/seo/conf"
)
// Sitemap 生成站点地图
func (d *Dao) Sitemap(c context.Context, host string) (res []byte, err error) {
s := conf.GetSitemap(host)
if s == nil || s.Url == "" {
err = errors.New(host + " sitemap config not exist")
return
}
res, err = d.GetUrl(c, s.Url)
return
}