1
This commit is contained in:
parent
38dd0e3b36
commit
8e487c9898
@ -44,6 +44,10 @@ func (this *mail) isValid(hum common.Player) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *mail) fillMailDto(mailDto *common.MailDto) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func newMail() *mail {
|
func newMail() *mail {
|
||||||
p := new(mail)
|
p := new(mail)
|
||||||
p.init()
|
p.init()
|
||||||
|
@ -95,20 +95,33 @@ func (this *mailMgr) loadGroupMembers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *mailMgr) caGetMailList(hum common.Player, c *gin.Context) {
|
func (this *mailMgr) caGetMailList(hum common.Player, c *gin.Context) {
|
||||||
this.traversePlayerMail(
|
|
||||||
hum,
|
|
||||||
func (m *mail) bool {
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
rspObj := struct {
|
rspObj := struct {
|
||||||
ErrCode int32 `json:"errcode"`
|
ErrCode int32 `json:"errcode"`
|
||||||
ErrMsg string `json:"errmsg"`
|
ErrMsg string `json:"errmsg"`
|
||||||
MailList []common.MailDto `json:"maillis"`
|
MailList []*common.MailDto `json:"maillis"`
|
||||||
}{}
|
}{}
|
||||||
|
this.traversePlayerMail(
|
||||||
|
hum,
|
||||||
|
func (m *mail) bool {
|
||||||
|
if m.isValid(hum) {
|
||||||
|
mailDto := new(common.MailDto)
|
||||||
|
if m.fillMailDto(mailDto) {
|
||||||
|
q5.AppendSlice(&rspObj.MailList, mailDto)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
c.JSON(200, rspObj)
|
c.JSON(200, rspObj)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *mailMgr) caMarkMail(hum common.Player, c *gin.Context) {
|
func (this *mailMgr) caMarkMail(hum common.Player, c *gin.Context) {
|
||||||
|
mailIds := q5.StrSplit(c.DefaultQuery("mail_ids", ""), ",")
|
||||||
|
for _, str := range(mailIds) {
|
||||||
|
m := this.getMail(str)
|
||||||
|
if m != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *mailMgr) caGetUnreadMailCnt(hum common.Player, c *gin.Context) {
|
func (this *mailMgr) caGetUnreadMailCnt(hum common.Player, c *gin.Context) {
|
||||||
@ -176,3 +189,11 @@ func (this *mailMgr) getGroup(groupId int64) *userGroup {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *mailMgr) getMail(mailId string) *mail {
|
||||||
|
if p, ok := this.idHash.Load(mailId); ok {
|
||||||
|
return p.(*mail)
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user