diff --git a/server/mailserver/mail/mail.go b/server/mailserver/mail/mail.go index e4e50ee4..ff379935 100644 --- a/server/mailserver/mail/mail.go +++ b/server/mailserver/mail/mail.go @@ -44,6 +44,10 @@ func (this *mail) isValid(hum common.Player) bool { return true } +func (this *mail) fillMailDto(mailDto *common.MailDto) bool { + return true +} + func newMail() *mail { p := new(mail) p.init() diff --git a/server/mailserver/mail/mailmgr.go b/server/mailserver/mail/mailmgr.go index b1a2e186..e1f26fee 100644 --- a/server/mailserver/mail/mailmgr.go +++ b/server/mailserver/mail/mailmgr.go @@ -95,20 +95,33 @@ func (this *mailMgr) loadGroupMembers() { } func (this *mailMgr) caGetMailList(hum common.Player, c *gin.Context) { - this.traversePlayerMail( - hum, - func (m *mail) bool { - return true - }) rspObj := struct { ErrCode int32 `json:"errcode"` 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) } 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) { @@ -176,3 +189,11 @@ func (this *mailMgr) getGroup(groupId int64) *userGroup { return nil } } + +func (this *mailMgr) getMail(mailId string) *mail { + if p, ok := this.idHash.Load(mailId); ok { + return p.(*mail) + } else { + return nil + } +}