附近小店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

svc_cate.go 430 B

3 months ago
123456789101112131415161718192021222324
  1. package svc
  2. import (
  3. "applet/app/db"
  4. "applet/app/e"
  5. "applet/app/utils"
  6. "github.com/gin-gonic/gin"
  7. )
  8. func Cate(c *gin.Context) {
  9. cate := db.GetCate(MasterDb(c), "0")
  10. cateList := make([]map[string]string, 0)
  11. if cate != nil {
  12. for _, v := range *cate {
  13. tmp := map[string]string{
  14. "id": utils.IntToStr(v.Id),
  15. "name": v.Title,
  16. }
  17. cateList = append(cateList, tmp)
  18. }
  19. }
  20. e.OutSuc(c, cateList, nil)
  21. return
  22. }