diff --git a/server/marketserver/api/v1/asset/asset.go b/server/marketserver/api/v1/asset/asset.go index a576191a..c9d924e5 100644 --- a/server/marketserver/api/v1/asset/asset.go +++ b/server/marketserver/api/v1/asset/asset.go @@ -45,7 +45,7 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? LIMIT %d`, Page common.StreamPagination `json:"page"` Rows []interface{} `json:"rows"` }{} - nfts := []common.NftDto{} + nfts := []*common.NftDto{} f5.GetGoStyleDb().StreamPageQuery( constant.BCNFT_DB, pageSize, @@ -61,10 +61,11 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? LIMIT %d`, rspObj.Page.FillPage(pagination) }, func (ds *f5.DataSet) { - p := q5.NewSliceElement(&nfts) + p := new(common.NftDto) p.NetId = q5.ToInt32(ds.GetByName("net_id")) p.ContractAddress = ds.GetByName("contract_address") p.TokenId = ds.GetByName("token_id") + q5.AppendSlice(&nfts, p) }) GetCacheMgr().GetNfts(nfts) c.JSON(200, rspObj) diff --git a/server/marketserver/cache/cachemgr.go b/server/marketserver/cache/cachemgr.go index b78dff6c..eaf848b4 100644 --- a/server/marketserver/cache/cachemgr.go +++ b/server/marketserver/cache/cachemgr.go @@ -17,8 +17,11 @@ func (this *cacheMgr) UnInit() { } -func (this *cacheMgr) GetNfts(nfts []common.NftDto) { +func (this *cacheMgr) GetNfts(nfts []*common.NftDto) { + /* + for _, val := range nfts { + }*/ } func (this *cacheMgr) internalGetNft(netId int32, contractAddress string, tokenId string) *nft { diff --git a/server/marketserver/common/types.go b/server/marketserver/common/types.go index dfa62051..44f91589 100644 --- a/server/marketserver/common/types.go +++ b/server/marketserver/common/types.go @@ -64,7 +64,7 @@ type TaskMgr interface{ } type CacheMgr interface{ - GetNfts([]NftDto) + GetNfts([]*NftDto) }