categories.go 396 B

12345678910111213141516171819
  1. package http
  2. import (
  3. artmdl "go-common/app/interface/openplatform/article/model"
  4. bm "go-common/library/net/http/blademaster"
  5. "go-common/library/net/metadata"
  6. )
  7. func categories(c *bm.Context) {
  8. data, err := artSrv.ListCategories(c, metadata.String(c, metadata.RemoteIP))
  9. if err != nil {
  10. c.JSON(nil, err)
  11. return
  12. }
  13. if data == nil {
  14. data = artmdl.Categories{}
  15. }
  16. c.JSON(data, nil)
  17. }