sitemap.go 373 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "context"
  4. "errors"
  5. "go-common/app/interface/openplatform/seo/conf"
  6. )
  7. // Sitemap 生成站点地图
  8. func (d *Dao) Sitemap(c context.Context, host string) (res []byte, err error) {
  9. s := conf.GetSitemap(host)
  10. if s == nil || s.Url == "" {
  11. err = errors.New(host + " sitemap config not exist")
  12. return
  13. }
  14. res, err = d.GetUrl(c, s.Url)
  15. return
  16. }