go_dreamfactory/modules/mail/api_delmail.go
2022-06-15 14:46:59 +08:00

40 lines
1011 B
Go

package mail
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
)
//参数校验
func (this *Api_Comp) DelUserMailReq_Check(session comm.IUserSession, req *pb.DelUserMailReq) (result map[string]interface{}, code pb.ErrorCode) {
return
}
// 删除邮件
func (this *Api_Comp) DelUserMailReq(session comm.IUserSession, agrs map[string]interface{}, 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 := this.module.db_comp.Mail_DelUserMail(req.ObjID)
if !bRet {
code = pb.ErrorCode_DBError
return
}
if mailinfo, err = this.module.db_comp.Mail_QueryUserMail(session.GetUserId()); err != nil {
log.Errorf("QueryUserMailResp err:%v", err)
code = pb.ErrorCode_CacheReadError
return
}
return
}