1
This commit is contained in:
parent
ac0e4feac3
commit
37b54f1636
@ -2,6 +2,7 @@ package spec_transfer721
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"q5"
|
"q5"
|
||||||
|
"f5"
|
||||||
"main/service"
|
"main/service"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
"mt"
|
"mt"
|
||||||
@ -52,13 +53,25 @@ func (this* hero) internalSendMail(dbIdx int64, accountAddress string, mailName
|
|||||||
if mailCfg == nil {
|
if mailCfg == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
nowTime := f5.GetApp().GetRealSeconds()
|
||||||
|
subject := mailMeta.GetTitle()
|
||||||
|
content := ""
|
||||||
uniKey := fmt.Sprintf("%d_%s_%s", dbIdx, mailName, tokenId)
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *hero) t(content string) string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (this *hero) getMailConfig(mailName string) *jccommon.MailConfig {
|
func (this *hero) getMailConfig(mailName string) *jccommon.MailConfig {
|
||||||
if v, ok := this.mailCfgHash.Load(mailName); ok {
|
if v, ok := this.mailCfgHash.Load(mailName); ok {
|
||||||
return *v
|
return *v
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package asset
|
package asset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"q5"
|
"q5"
|
||||||
|
@ -275,3 +275,61 @@ WHERE net_id = %d AND status="%s" AND item_id <> 0 GROUP BY item_id
|
|||||||
c.JSON(200, rspObj)
|
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)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user