39 lines
1003 B
Go
39 lines
1003 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.Mail_DelMail_Req) (result map[string]interface{}, code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
// 删除邮件
|
|
func (this *Api_Comp) DelUserMailReq(session comm.IUserSession, agrs map[string]interface{}, req *pb.Mail_DelMail_Req) (code pb.ErrorCode) {
|
|
var err error
|
|
mailinfo := make([]*pb.DB_MailData, 0)
|
|
defer func() {
|
|
session.SendMsg(string(this.module.GetType()), DelUserMailResp, &pb.Mail_DelMail_Resp{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
|
|
}
|