sitemap.go 353 B

1234567891011121314151617181920
  1. package http
  2. import (
  3. "net/http"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func sitemap(c *bm.Context) {
  8. logUA(c)
  9. res, err := srv.Sitemap(c, c.Request.Host)
  10. if err != nil {
  11. log.Error(err.Error())
  12. return
  13. }
  14. c.Writer.Header().Set("Content-Type", "text/xml;charset=utf-8")
  15. c.String(http.StatusOK, string(res))
  16. }