35 lines
899 B
Go
35 lines
899 B
Go
package mail
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MailGetListReq) (errdata *pb.ErrorData) {
|
|
return
|
|
}
|
|
|
|
// 查看所有邮件信息
|
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.MailGetListReq) (errdata *pb.ErrorData) {
|
|
|
|
var err error
|
|
mailinfo := make([]*pb.DBMailData, 0)
|
|
defer func() {
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.MailGetListResp{Mails: mailinfo})
|
|
}()
|
|
if errdata = this.GetListCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
if mailinfo, err = this.module.modelMail.MailQueryUserMail(session.GetUserId()); err != nil {
|
|
this.module.Errorf("Mail_GetList_Resp err:%v", err)
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_CacheReadError,
|
|
Title: pb.ErrorCode_CacheReadError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|