1
This commit is contained in:
parent
233a5e3ea6
commit
f32960e808
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -4,3 +4,6 @@
|
|||||||
[submodule "third_party/f5"]
|
[submodule "third_party/f5"]
|
||||||
path = third_party/f5
|
path = third_party/f5
|
||||||
url = git@git.kingsome.cn:server_common/f5.git
|
url = git@git.kingsome.cn:server_common/f5.git
|
||||||
|
[submodule "third_party/contracts-imtbl"]
|
||||||
|
path = third_party/contracts-imtbl
|
||||||
|
url = git@git.kingsome.cn:crypto/contracts-imtbl.git
|
||||||
|
1
bin/backtask/config/mail/gold_bullion/mint.content.txt
Normal file
1
bin/backtask/config/mail/gold_bullion/mint.content.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
[${item.name}] has been synthesized successfully. Please go to the personal assets page on the web to view it. The web address : XXXXX
|
1
bin/backtask/config/mail/gold_bullion/unlock.content.txt
Normal file
1
bin/backtask/config/mail/gold_bullion/unlock.content.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
[${item.name}] has been used successfully, you have received ${gold} gold
|
1
bin/backtask/config/mail/hero/lock.content.txt
Normal file
1
bin/backtask/config/mail/hero/lock.content.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
[{$hero.name} ${hero.quality}] has been off-chained successfully. Please check in the hero backpack.
|
0
bin/backtask/config/mail/hero/lock.title.txt
Normal file
0
bin/backtask/config/mail/hero/lock.title.txt
Normal file
1
bin/backtask/config/mail/hero/mint.content.txt
Normal file
1
bin/backtask/config/mail/hero/mint.content.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
[{$hero.name} ${hero.quality}] has been on-chain successfully. Please go to the personal assets page on the web to view it. The web market address is XXXXX
|
0
bin/backtask/config/mail/hero/mint.title.txt
Normal file
0
bin/backtask/config/mail/hero/mint.title.txt
Normal file
1
bin/backtask/config/mail/hero/unlock.content.txt
Normal file
1
bin/backtask/config/mail/hero/unlock.content.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
[{$hero.name} ${hero.quality}] has been on-chain successfully. Please go to the personal assets page on the web to view it. The web market address is XXXXX
|
0
bin/backtask/config/mail/hero/unlock.title.txt
Normal file
0
bin/backtask/config/mail/hero/unlock.title.txt
Normal file
@ -1,14 +1,29 @@
|
|||||||
package mt
|
package mt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"f5"
|
|
||||||
"mtb"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mail struct {
|
type Mail struct {
|
||||||
mtb.Mail
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MailTable struct {
|
type MailTable struct {
|
||||||
f5.NameMetaTable[Mail]
|
}
|
||||||
|
|
||||||
|
func (this *MailTable) IsNoLoad() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MailTable) Load() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MailTable) PreInit1() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MailTable) ElementsInit(int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MailTable) PostInit1() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,7 @@ var Table = f5.New(func(this *table) {
|
|||||||
this.PrimKey = "id"
|
this.PrimKey = "id"
|
||||||
})
|
})
|
||||||
|
|
||||||
this.Mail = f5.New(func(this *MailTable) {
|
this.Mail = new(MailTable)
|
||||||
this.FileName = "../config/mail.json"
|
|
||||||
this.PrimKey = "name"
|
|
||||||
})
|
|
||||||
|
|
||||||
this.Language = f5.New(func(this *LanguageTable) {
|
this.Language = f5.New(func(this *LanguageTable) {
|
||||||
this.FileName = "../res/language@language.json"
|
this.FileName = "../res/language@language.json"
|
||||||
|
@ -56,13 +56,6 @@ message Language
|
|||||||
optional string en = 2;
|
optional string en = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Mail
|
|
||||||
{
|
|
||||||
optional string name = 1;
|
|
||||||
optional string subject = 2;
|
|
||||||
optional string content = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RankSeason
|
message RankSeason
|
||||||
{
|
{
|
||||||
optional int32 id = 1;
|
optional int32 id = 1;
|
||||||
|
@ -44,10 +44,11 @@ func (this* hero) internalSendMail(dbIdx int64, accountAddress string, mailName
|
|||||||
if accountId == "" {
|
if accountId == "" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
mailMeta := mt.Table.Mail.GetByName(mailName)
|
mailMeta := mt.Table.Mail.GetByName(mailName)
|
||||||
if mailMeta == nil {
|
if mailMeta == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}*/
|
||||||
mailCfg := this.getMailConfig(mailName)
|
mailCfg := this.getMailConfig(mailName)
|
||||||
if mailCfg == nil {
|
if mailCfg == nil {
|
||||||
return true
|
return true
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"f5"
|
"f5"
|
||||||
"time"
|
"time"
|
||||||
"fmt"
|
"fmt"
|
||||||
"mt"
|
//"mt"
|
||||||
"jccommon"
|
"jccommon"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
)
|
)
|
||||||
@ -49,6 +49,7 @@ SELECT * FROM t_721nft_spec_transfer WHERE idx > %d AND status = 0 AND createtim
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this* SpecTransfer721) dispatch(ds *f5.DataSet) bool {
|
func (this* SpecTransfer721) dispatch(ds *f5.DataSet) bool {
|
||||||
|
/*
|
||||||
idx := q5.ToInt64(ds.GetByName("idx"))
|
idx := q5.ToInt64(ds.GetByName("idx"))
|
||||||
netId := q5.ToInt32(ds.GetByName("net_id"))
|
netId := q5.ToInt32(ds.GetByName("net_id"))
|
||||||
contractAddress := ds.GetByName("contract_address")
|
contractAddress := ds.GetByName("contract_address")
|
||||||
@ -69,6 +70,6 @@ func (this* SpecTransfer721) dispatch(ds *f5.DataSet) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -53,12 +53,13 @@ func (this *MarketApi) ProductList(c *gin.Context) {
|
|||||||
SELECT * FROM t_order A WHERE idx > %d AND net_id = %d AND status="%s"
|
SELECT * FROM t_order A WHERE idx > %d AND net_id = %d AND status="%s"
|
||||||
`,
|
`,
|
||||||
cursor, netId, jccommon.ORDER_STATUS_ACTIVE)
|
cursor, netId, jccommon.ORDER_STATUS_ACTIVE)
|
||||||
|
/*
|
||||||
if f5.IsTestEnv() {
|
if f5.IsTestEnv() {
|
||||||
sql = fmt.Sprintf(`
|
sql = fmt.Sprintf(`
|
||||||
SELECT * FROM t_order A WHERE idx > %d AND net_id = %d
|
SELECT * FROM t_order A WHERE idx > %d AND net_id = %d
|
||||||
`,
|
`,
|
||||||
cursor, netId)
|
cursor, netId)
|
||||||
}
|
}*/
|
||||||
|
|
||||||
orderBy := ""
|
orderBy := ""
|
||||||
/*
|
/*
|
||||||
|
@ -144,65 +144,63 @@ func (this *ShopCartApi) Add(c *gin.Context) {
|
|||||||
c.JSON(200, rspObj)
|
c.JSON(200, rspObj)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
cartDb := common.NewShopCart()
|
||||||
|
dirty := false
|
||||||
if ds.Next() {
|
if ds.Next() {
|
||||||
cartDb := common.NewShopCart()
|
|
||||||
dirty := false
|
|
||||||
if q5.DecodeJson(ds.GetByName("data"), cartDb) == nil {
|
if q5.DecodeJson(ds.GetByName("data"), cartDb) == nil {
|
||||||
for _, val := range reqJson.Tokens {
|
|
||||||
netId := q5.SafeToInt32(reqJson.NetId)
|
|
||||||
contractAddress := val.ContractAddress
|
|
||||||
tokenId := q5.SafeToString(val.TokenId)
|
|
||||||
p := cartDb.GetGoods(netId, contractAddress, tokenId)
|
|
||||||
if p != nil {
|
|
||||||
cartDb.CurrSortIdx += 1
|
|
||||||
p.SortIdx = cartDb.CurrSortIdx
|
|
||||||
p.AddTime = q5.ToInt32(f5.GetApp().GetRealSeconds())
|
|
||||||
dirty = true;
|
|
||||||
} else {
|
|
||||||
var err1 error
|
|
||||||
f5.GetGoStyleDb().OrmSelectOne(
|
|
||||||
constant.BCNFT_DB,
|
|
||||||
"t_order",
|
|
||||||
[][]string{
|
|
||||||
{"net_id", q5.ToString(netId)},
|
|
||||||
{"contract_address", contractAddress},
|
|
||||||
{"token_id", tokenId},
|
|
||||||
{"status", jccommon.ORDER_STATUS_ACTIVE},
|
|
||||||
},
|
|
||||||
func (err error, ds* f5.DataSet) {
|
|
||||||
err1 = err
|
|
||||||
if err == nil {
|
|
||||||
if ds.Next() {
|
|
||||||
cartDb.CurrSortIdx += 1
|
|
||||||
g := common.NewShopCartGoods()
|
|
||||||
g.NetId = netId
|
|
||||||
g.ContractAddress = contractAddress
|
|
||||||
g.TokenId = tokenId
|
|
||||||
g.SortIdx = cartDb.CurrSortIdx
|
|
||||||
g.AddTime = q5.ToInt32(f5.GetApp().GetRealSeconds())
|
|
||||||
q5.AppendSlice(&cartDb.Goods, g)
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if err1 != nil {
|
|
||||||
rspObj.ErrCode = 500
|
|
||||||
rspObj.ErrMsg = "server internal error"
|
|
||||||
c.JSON(200, rspObj)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if dirty {
|
|
||||||
cartDb.DeleteExcessData()
|
|
||||||
this.save(openId, cartDb)
|
|
||||||
}
|
|
||||||
c.JSON(200, rspObj)
|
|
||||||
} else {
|
|
||||||
c.JSON(200, rspObj)
|
|
||||||
}
|
}
|
||||||
|
for _, val := range reqJson.Tokens {
|
||||||
|
netId := q5.SafeToInt32(reqJson.NetId)
|
||||||
|
contractAddress := val.ContractAddress
|
||||||
|
tokenId := q5.SafeToString(val.TokenId)
|
||||||
|
p := cartDb.GetGoods(netId, contractAddress, tokenId)
|
||||||
|
if p != nil {
|
||||||
|
cartDb.CurrSortIdx += 1
|
||||||
|
p.SortIdx = cartDb.CurrSortIdx
|
||||||
|
p.AddTime = q5.ToInt32(f5.GetApp().GetRealSeconds())
|
||||||
|
dirty = true;
|
||||||
|
} else {
|
||||||
|
var err1 error
|
||||||
|
f5.GetGoStyleDb().OrmSelectOne(
|
||||||
|
constant.BCNFT_DB,
|
||||||
|
"t_order",
|
||||||
|
[][]string{
|
||||||
|
{"net_id", q5.ToString(netId)},
|
||||||
|
{"contract_address", contractAddress},
|
||||||
|
{"token_id", tokenId},
|
||||||
|
{"status", jccommon.ORDER_STATUS_ACTIVE},
|
||||||
|
},
|
||||||
|
func (err error, ds* f5.DataSet) {
|
||||||
|
err1 = err
|
||||||
|
if err == nil {
|
||||||
|
if ds.Next() {
|
||||||
|
cartDb.CurrSortIdx += 1
|
||||||
|
g := common.NewShopCartGoods()
|
||||||
|
g.NetId = netId
|
||||||
|
g.ContractAddress = contractAddress
|
||||||
|
g.TokenId = tokenId
|
||||||
|
g.SortIdx = cartDb.CurrSortIdx
|
||||||
|
g.AddTime = q5.ToInt32(f5.GetApp().GetRealSeconds())
|
||||||
|
q5.AppendSlice(&cartDb.Goods, g)
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if err1 != nil {
|
||||||
|
rspObj.ErrCode = 500
|
||||||
|
rspObj.ErrMsg = "server internal error"
|
||||||
|
c.JSON(200, rspObj)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if dirty {
|
||||||
|
cartDb.DeleteExcessData()
|
||||||
|
this.save(openId, cartDb)
|
||||||
|
}
|
||||||
|
c.JSON(200, rspObj)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,34 +239,32 @@ func (this *ShopCartApi) Del(c *gin.Context) {
|
|||||||
c.JSON(200, rspObj)
|
c.JSON(200, rspObj)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
cartDb := common.NewShopCart()
|
||||||
|
dirty := false
|
||||||
if ds.Next() {
|
if ds.Next() {
|
||||||
cartDb := common.NewShopCart()
|
|
||||||
dirty := false
|
|
||||||
if q5.DecodeJson(ds.GetByName("data"), cartDb) == nil {
|
if q5.DecodeJson(ds.GetByName("data"), cartDb) == nil {
|
||||||
newGoods := []*common.ShopCartGoods{}
|
}
|
||||||
for _, val := range cartDb.Goods {
|
}
|
||||||
found := false
|
newGoods := []*common.ShopCartGoods{}
|
||||||
for _, val2 := range reqJson.Tokens {
|
for _, val := range cartDb.Goods {
|
||||||
if val.NetId == q5.SafeToInt32(reqJson.NetId) &&
|
found := false
|
||||||
q5.ToString(val.TokenId) == q5.SafeToString(val2.TokenId) &&
|
for _, val2 := range reqJson.Tokens {
|
||||||
strings.ToLower(val.ContractAddress) == strings.ToLower(val2.ContractAddress) {
|
if val.NetId == q5.SafeToInt32(reqJson.NetId) &&
|
||||||
found = true
|
q5.ToString(val.TokenId) == q5.SafeToString(val2.TokenId) &&
|
||||||
}
|
strings.ToLower(val.ContractAddress) == strings.ToLower(val2.ContractAddress) {
|
||||||
}
|
found = true
|
||||||
if !found {
|
|
||||||
q5.AppendSlice(&newGoods, val)
|
|
||||||
} else {
|
|
||||||
dirty = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dirty {
|
if !found {
|
||||||
this.save(openId, cartDb)
|
q5.AppendSlice(&newGoods, val)
|
||||||
|
} else {
|
||||||
|
dirty = true
|
||||||
}
|
}
|
||||||
c.JSON(200, rspObj)
|
|
||||||
} else {
|
|
||||||
c.JSON(200, rspObj)
|
|
||||||
}
|
}
|
||||||
|
if dirty {
|
||||||
|
this.save(openId, cartDb)
|
||||||
|
}
|
||||||
|
c.JSON(200, rspObj)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
third_party/contracts-imtbl
vendored
Submodule
1
third_party/contracts-imtbl
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 6621b926b460d820e6c01d69c13053259a80e5f3
|
Loading…
x
Reference in New Issue
Block a user