save
This commit is contained in:
parent
74d6888f96
commit
1e49bc8869
@ -85,7 +85,7 @@ func (m *Mail) IsReadableMail(accountObj common.Player) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
nowUnixSec := int32(time.Now().Unix())
|
nowUnixSec := int32(time.Now().Unix())
|
||||||
if m.ExpireTime > nowUnixSec && m.SendTime <= nowUnixSec && accountObj.IsUnreadMail(m.MailId) && !accountObj.IsDeletedMail(m.MailId) {
|
if m.ExpireTime > nowUnixSec && m.SendTime <= nowUnixSec && !accountObj.IsDeletedMail(m.MailId) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,6 +224,7 @@ func (p *Player) SaveToDB() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Player) MarkDirty() {
|
func (p *Player) MarkDirty() {
|
||||||
|
// f5.GetApp().RegisterMainThreadCb(func() {})
|
||||||
timer := f5.GetTimer()
|
timer := f5.GetTimer()
|
||||||
timer.SetTimeout(
|
timer.SetTimeout(
|
||||||
1000*10,
|
1000*10,
|
||||||
@ -240,6 +241,6 @@ func NewPlayer(accountId string) *Player {
|
|||||||
AccountId: accountId,
|
AccountId: accountId,
|
||||||
ReadMailHash: make(map[int64]*ReadMail),
|
ReadMailHash: make(map[int64]*ReadMail),
|
||||||
DeletedMailHash: make(map[int64]*DeletedMail),
|
DeletedMailHash: make(map[int64]*DeletedMail),
|
||||||
CacheExpiration: time.Now().Add(10 * time.Second),
|
CacheExpiration: time.Now().Add(20 * time.Second),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"f5"
|
"f5"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"main/middleware"
|
"main/middleware"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type routerMgr struct {
|
type routerMgr struct {
|
||||||
@ -12,6 +13,12 @@ type routerMgr struct {
|
|||||||
|
|
||||||
func (rm *routerMgr) Init() {
|
func (rm *routerMgr) Init() {
|
||||||
router := f5.GetApp().GetGinEngine()
|
router := f5.GetApp().GetGinEngine()
|
||||||
|
router.NoRoute(func(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusNotFound, gin.H{
|
||||||
|
"errcode": http.StatusNotFound,
|
||||||
|
"errmsg": "Not Found",
|
||||||
|
})
|
||||||
|
})
|
||||||
router.Use(gin.Logger())
|
router.Use(gin.Logger())
|
||||||
|
|
||||||
authRouterGroup := router.Group("api")
|
authRouterGroup := router.Group("api")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user