|
12345678910111213141516171819202122232425262728 |
- package svc
-
- import (
- "applet/app/db"
- "applet/app/e"
- "applet/app/utils"
- "github.com/gin-gonic/gin"
- )
-
- func Cate(c *gin.Context) {
- storeId := c.GetHeader("store_id")
- if storeId == "" {
- storeId = "0"
- }
- cate := db.GetCate(MasterDb(c), storeId)
- cateList := make([]map[string]string, 0)
- if cate != nil {
- for _, v := range *cate {
- tmp := map[string]string{
- "id": utils.IntToStr(v.Id),
- "name": v.Title,
- }
- cateList = append(cateList, tmp)
- }
- }
- e.OutSuc(c, cateList, nil)
- return
- }
|