prop.go
680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package apis
import (
"net/http"
. "client/icesimba.mall/models"
"github.com/gin-gonic/gin"
)
func QueryPropsOfGoodsApi(c *gin.Context) {
goodsId := c.Request.FormValue("goods_id")
gameId := c.Request.FormValue("game_id")
if goodsId == "" || gameId == "" {
code = "1003"
c.JSON(http.StatusOK, gin.H{
"code": code,
"msg": "参数错误",
})
return
}
goodsProp := GoodsProp{}
goodsProp, err := goodsProp.QueryProsByGoodsId(goodsId, gameId)
if err != nil {
code = "1000"
c.JSON(http.StatusOK, gin.H{
"code": code,
"msg": err.Error(),
})
return
}
code = "0"
c.JSON(http.StatusOK, gin.H{
"code": code,
"obj": goodsProp,
})
return
}