36 lines
846 B
Go
36 lines
846 B
Go
package mail
|
|
|
|
import (
|
|
"context"
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
"go_dreamfactory/sys/db"
|
|
)
|
|
|
|
// 删除邮件
|
|
func (this *Api_Comp) DelUserMailReq(ctx context.Context, session comm.IUserSession, req *pb.DelUserMailReq) (err error) {
|
|
|
|
code := pb.ErrorCode_Success
|
|
mailinfo := make([]*pb.DB_MailData, 0)
|
|
defer func() {
|
|
session.SendMsg(string(this.module.GetType()), DelUserMailResp, code, &pb.DelUserMailResp{Mail: mailinfo})
|
|
}()
|
|
if session.GetUserId() == "" {
|
|
code = pb.ErrorCode_NoLogin
|
|
return
|
|
}
|
|
bRet := db.Defsys.Mail_DelUserMail(req.ObjID)
|
|
if !bRet {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
if mailinfo, err = db.Defsys.Mail_QueryUserMail(session.GetUserId()); err != nil {
|
|
log.Errorf("QueryUserMailResp err:%v", err)
|
|
code = pb.ErrorCode_CacheReadError
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|