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