This commit is contained in:
aozhiwei 2024-06-15 14:43:46 +08:00
parent 9776811b88
commit a1f460818e
3 changed files with 15 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import (
"main/common"
"fmt"
"strings"
. "main/global"
"github.com/gin-gonic/gin"
)
@ -38,6 +39,12 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? LIMIT %d`,
} else if filterType == 2 {
sql += "B.status <> '" + constant.ORDER_STATUS_ACTIVE + "'"
}
rspObj := struct {
ErrCode int32 `json:"errcode"`
ErrMsg string `json:"errmsg"`
Page common.StreamPagination `json:"page"`
Rows []interface{} `json:"rows"`
}{}
nfts := []common.NftDto{}
f5.GetGoStyleDb().StreamPageQuery(
constant.BCNFT_DB,
@ -51,7 +58,7 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? LIMIT %d`,
),
"",
func (err error, pagination *f5.StreamPagination) {
rspObj.Page.FillPage(pagination)
},
func (ds *f5.DataSet) {
p := q5.NewSliceElement(&nfts)
@ -59,9 +66,6 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? LIMIT %d`,
p.ContractAddress = ds.GetByName("contract_address")
p.TokenId = ds.GetByName("token_id")
})
rspObj := struct {
Page *common.StreamPagination `json:"page"`
Rows []interface{} `json:"rows"`
}{}
GetCacheMgr().GetNfts(nfts)
c.JSON(200, rspObj)
}

View File

@ -2,6 +2,7 @@ package cache
import (
"sync"
"main/common"
)
type cacheMgr struct {
@ -16,6 +17,10 @@ func (this *cacheMgr) UnInit() {
}
func (this *cacheMgr) GetNfts(nfts []common.NftDto) {
}
func (this *cacheMgr) internalGetNft(netId int32, contractAddress string, tokenId string) *nft {
return nil
}

View File

@ -64,6 +64,7 @@ type TaskMgr interface{
}
type CacheMgr interface{
GetNfts([]NftDto)
}