This commit is contained in:
aozhiwei 2024-06-24 19:59:57 +08:00
parent ac0e4feac3
commit 37b54f1636
3 changed files with 75 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package spec_transfer721
import (
"q5"
"f5"
"main/service"
"main/constant"
"mt"
@ -52,13 +53,25 @@ func (this* hero) internalSendMail(dbIdx int64, accountAddress string, mailName
if mailCfg == nil {
return true
}
nowTime := f5.GetApp().GetRealSeconds()
subject := mailMeta.GetTitle()
content := ""
uniKey := fmt.Sprintf("%d_%s_%s", dbIdx, mailName, tokenId)
if uniKey != "" {
}
service.SendSysMail(
uniKey,
accountId,
subject,
content,
q5.ToInt32(nowTime),
mailCfg.Tag1,
mailCfg.Tag2)
return true
}
func (this *hero) t(content string) string {
return ""
}
func (this *hero) getMailConfig(mailName string) *jccommon.MailConfig {
if v, ok := this.mailCfgHash.Load(mailName); ok {
return *v

View File

@ -1,4 +1,4 @@
package asset
package asset
import (
"q5"

View File

@ -275,3 +275,61 @@ WHERE net_id = %d AND status="%s" AND item_id <> 0 GROUP BY item_id
c.JSON(200, rspObj)
})
}
func (this *MarketApi) QueryPrice(c *gin.Context) {
netId := q5.ToInt64(c.DefaultQuery("net_id", ""))
itemId := q5.ToInt64(c.DefaultQuery("item_id", ""))
rspObj := &struct {
ErrCode int32 `json:"errcode"`
ErrMsg string `json:"errmsg"`
LowestPriceGoods *struct{
Event interface{} `json:"event"`
Nft interface{} `json:"nft"`
} `json:"lowest_price_goods"`
HighestPriceGoods *struct{
Event interface{} `json:"event"`
Nft interface{} `json:"nft"`
} `json:"highest_price_goods"`
}{}
sql := fmt.Sprintf(`
SELECT idx, price FROM t_order
WHERE net_id = %d AND status="%s" AND item_id = %d
`,
netId,
jccommon.ORDER_STATUS_ACTIVE,
itemId)
params := []string{}
lowestPriceGoodsIdx := int64(0)
highestPriceGoodsIdx := int64(0)
lowestPrice := ""
highestPrice := ""
f5.GetGoStyleDb().RawQuery(
constant.BCNFT_DB,
sql,
params,
func (err error, ds *f5.DataSet) {
if err != nil {
rspObj.ErrCode = 500
rspObj.ErrMsg = "server internal error"
c.JSON(200, rspObj)
return
}
for ds.Next() {
idx := q5.ToInt64(ds.GetByName("idx"))
price := ds.GetByName("price")
if lowestPriceGoodsIdx == 0 ||
q5.BigIntStrCmp(lowestPrice, price) < 0 {
lowestPriceGoodsIdx = idx
lowestPrice = price
}
if highestPriceGoodsIdx == 0 ||
q5.BigIntStrCmp(highestPrice, price) > 0 {
highestPriceGoodsIdx = idx
highestPrice = price
}
}
c.JSON(200, rspObj)
})
}