35 lines
867 B
Go
35 lines
867 B
Go
package mail
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
|
|
"github.com/golang/protobuf/proto"
|
|
)
|
|
|
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MailGetListReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
// 查看所有邮件信息
|
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.MailGetListReq) (code pb.ErrorCode, data proto.Message) {
|
|
|
|
var err error
|
|
mailinfo := make([]*pb.DBMailData, 0)
|
|
defer func() {
|
|
session.SendMsg(string(this.module.GetType()), QueryUserMailResp, &pb.MailGetListResp{Mails: mailinfo})
|
|
}()
|
|
if session.GetUserId() == "" {
|
|
code = pb.ErrorCode_NoLogin
|
|
return
|
|
}
|
|
if mailinfo, err = this.module.modelMail.Mail_QueryUserMail(session.GetUserId()); err != nil {
|
|
log.Errorf("Mail_GetList_Resp err:%v", err)
|
|
code = pb.ErrorCode_CacheReadError
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|