1
This commit is contained in:
parent
bfea83266a
commit
6526651a65
@ -4,6 +4,7 @@ import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/constant"
|
||||
"main/common"
|
||||
"fmt"
|
||||
"strings"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -26,7 +27,6 @@ func (this *AssetApi) AccountAsset(c *gin.Context) {
|
||||
cursor := q5.ToInt64(c.DefaultQuery("cursor", ""))
|
||||
netId := q5.ToInt64(c.Param("net_id"))
|
||||
accountAddress := strings.ToLower(c.Param("account_address"))
|
||||
//searchName := c.DefaultQuery("search_name", "")
|
||||
filterType := q5.ToInt32(c.DefaultQuery("type", ""))
|
||||
sql := fmt.Sprintf(`
|
||||
SELECT A.idx, A.net_id, A.token_type, A.token_id, A.contract_address, B.status FROM t_nft A LEFT JOIN t_order B
|
||||
@ -38,13 +38,7 @@ 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 + "'"
|
||||
}
|
||||
nfts := []struct{
|
||||
idx int64
|
||||
netId int32
|
||||
tokenType int32
|
||||
tokenId string
|
||||
contractAddress string
|
||||
}{}
|
||||
nfts := []common.NftDto{}
|
||||
f5.GetGoStyleDb().StreamPageQuery(
|
||||
constant.BCNFT_DB,
|
||||
pageSize,
|
||||
@ -60,13 +54,10 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? LIMIT %d`,
|
||||
|
||||
},
|
||||
func (ds *f5.DataSet) {
|
||||
var p = q5.NewSliceElement(&nfts)
|
||||
p.idx = q5.ToInt64(ds.GetByName("idx"))
|
||||
p.netId = q5.ToInt32(ds.GetByName("net_id"))
|
||||
p.tokenType = q5.ToInt32(ds.GetByName("token_type"))
|
||||
p.tokenId = ds.GetByName("token_id")
|
||||
p.contractAddress = ds.GetByName("contract_address")
|
||||
f5.GetSysLog().Info("idx:%s", p.idx)
|
||||
p := q5.NewSliceElement(&nfts)
|
||||
p.NetId = q5.ToInt32(ds.GetByName("net_id"))
|
||||
p.ContractAddress = ds.GetByName("contract_address")
|
||||
p.TokenId = ds.GetByName("token_id")
|
||||
})
|
||||
f5.GetSysLog().Info("dafdf")
|
||||
}
|
||||
|
6
server/marketserver/cache/cachemgr.go
vendored
6
server/marketserver/cache/cachemgr.go
vendored
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type cacheMgr struct {
|
||||
nftHash sync.Map
|
||||
nftHash sync.Map //net_id contract_address token_id -> nft
|
||||
}
|
||||
|
||||
func (this *cacheMgr) Init() {
|
||||
@ -15,3 +15,7 @@ func (this *cacheMgr) Init() {
|
||||
func (this *cacheMgr) UnInit() {
|
||||
|
||||
}
|
||||
|
||||
func (this *cacheMgr) internalGetNft(netId int32, contractAddress string, tokenId string) *nft {
|
||||
return nil
|
||||
}
|
||||
|
7
server/marketserver/cache/nft.go
vendored
7
server/marketserver/cache/nft.go
vendored
@ -1,5 +1,10 @@
|
||||
package cache
|
||||
|
||||
type nft struct {
|
||||
|
||||
refreshTime int32
|
||||
rawData string
|
||||
}
|
||||
|
||||
func (this *nft) GetRawData() string {
|
||||
return this.rawData
|
||||
}
|
||||
|
@ -34,6 +34,17 @@ type OrderUpdatedEvent struct {
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type NftCache interface {
|
||||
|
||||
}
|
||||
|
||||
type NftDto struct {
|
||||
NetId int32
|
||||
ContractAddress string
|
||||
TokenId string
|
||||
NftCache NftCache
|
||||
}
|
||||
|
||||
type App interface {
|
||||
Run(func(), func())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user