diff --git a/server/mailserver/mail/mail.go b/server/mailserver/mail/mail.go index 8dec394a..55c9a917 100644 --- a/server/mailserver/mail/mail.go +++ b/server/mailserver/mail/mail.go @@ -8,11 +8,6 @@ import ( "main/constant" ) -type attachment struct { - itemId int32 `json:"itemid"` - itemNum int32 `json:"itemnum"` -} - type mail struct { mailId int64 mailType int32 @@ -22,13 +17,13 @@ type mail struct { expireTime int32 userRegStartTime int32 userRegEndTime int32 - attachments []*attachment + attachments []*common.AttachmentDto recipients *sync.Map //account_id, int userGroups *sync.Map //group_id, *userGroup } func (this *mail) init() { - this.attachments = []*attachment{} + this.attachments = []*common.AttachmentDto{} } func (this *mail) loadFromDb(ds *f5.DataSet) { @@ -107,12 +102,7 @@ func (this *mail) fillMailDto(hum common.Player, p *common.MailDto) bool { p.MailType = this.mailType p.MailSubType = 0 p.Ext = "" - p.Attachments = make([]*common.AttachmentDto, 0) - for _, ele := range(this.attachments) { - attachment := new(common.AttachmentDto) - attachment.ItemId = ele.itemId - attachment.ItemNum = ele.itemNum - } + p.Attachments = this.attachments return true } diff --git a/server/mailserver/mail/mailmgr.go b/server/mailserver/mail/mailmgr.go index 1f69d655..9401a4a0 100644 --- a/server/mailserver/mail/mailmgr.go +++ b/server/mailserver/mail/mailmgr.go @@ -127,7 +127,7 @@ func (this *mailMgr) CaGetMailList(c *gin.Context) { rspObj := struct { ErrCode int32 `json:"errcode"` ErrMsg string `json:"errmsg"` - MailList []*common.MailDto `json:"mail_list"` + MailList []*common.MailDto `json:"maillist"` }{ MailList: []*common.MailDto{}, }