1
This commit is contained in:
parent
6394c36be0
commit
9ab51b1f24
@ -18,6 +18,7 @@ import (
|
||||
type goodsDto struct {
|
||||
Event interface{} `json:"event"`
|
||||
Nft interface{} `json:"nft"`
|
||||
InShopCart int32 `json:"in_shopcart"`
|
||||
}
|
||||
|
||||
type MarketApi struct {
|
||||
@ -410,6 +411,9 @@ WHERE idx in (%s)
|
||||
}
|
||||
|
||||
func (this *MarketApi) Goods(c *gin.Context) {
|
||||
openId := c.MustGet("open_id").(string)
|
||||
cartDb := service.GetShopCartByOpenId(openId)
|
||||
|
||||
netId := q5.ToInt64(c.Param("net_id"))
|
||||
contractAddress := c.Param("contract_address")
|
||||
tokenId := c.Param("token_id")
|
||||
@ -473,6 +477,9 @@ WHERE net_id=? AND contract_address=? AND token_id=? AND status=?
|
||||
p = new(goodsDto)
|
||||
p.Event = val.Payload
|
||||
p.Nft = val.NftCache.GetJsonData()
|
||||
if cartDb != nil && cartDb.GetGoods(val.NetId, val.ContractAddress, val.TokenId) != nil{
|
||||
p.InShopCart = 1
|
||||
}
|
||||
rspObj.Data = p
|
||||
}
|
||||
}
|
||||
|
@ -17,5 +17,7 @@ func (this *MarketRouter) InitRouter() {
|
||||
api.MarketApi.TransactionHistory)
|
||||
f5.GetApp().GetGinEngine().GET("/api/market/product/category/:net_id", api.MarketApi.CategoryGoodsNum)
|
||||
f5.GetApp().GetGinEngine().GET("/api/market/product/query_price", api.MarketApi.QueryPrice)
|
||||
f5.GetApp().GetGinEngine().GET("/api/market/product/goods/:net_id/:contract_address/:token_id", api.MarketApi.Goods)
|
||||
f5.GetApp().GetGinEngine().GET("/api/market/product/goods/:net_id/:contract_address/:token_id",
|
||||
middleware.MaybeJwtAuth,
|
||||
api.MarketApi.Goods)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user