prop.go 680 Bytes
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
}