报错修改
This commit is contained in:
parent
616198cf8e
commit
f7725db74b
@ -11,6 +11,6 @@ type (
|
||||
}
|
||||
//背包模块对外接口定义 提供给其他模块使用的
|
||||
IPack interface {
|
||||
GetRewaredItems(uId string, itmes map[uint32]uint32) bool
|
||||
//GetRewaredItems(uId string, itmes map[uint32]uint32) bool
|
||||
}
|
||||
)
|
||||
|
@ -13,15 +13,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
QueryUserMailReq = "mail.queryusermailreq"
|
||||
QueryUserMailResp = "mail.queryusermailresp"
|
||||
ReadUserMailReq = "mail.readusermailreq"
|
||||
ReadUserMailResp = "mail.readusermailresp"
|
||||
GetUserMailAttachmentReq = "mail.getusermailattachmentreq"
|
||||
GetUserMailAttachmentResp = "mail.getusermailattachmentresp"
|
||||
DelUserMailReq = "mail.delusermailreq"
|
||||
DelUserMailResp = "mail.delusermailresp"
|
||||
GetNewEMailResp = "mail.getnewEmailresp"
|
||||
QueryUserMailResp = "queryusermailresp"
|
||||
ReadUserMailResp = "readusermailresp"
|
||||
GetUserMailAttachmentResp = "getusermailattachmentresp"
|
||||
DelUserMailResp = "delusermailresp"
|
||||
GetNewEMailResp = "getnewEmailresp"
|
||||
)
|
||||
|
||||
type Api_Comp struct {
|
||||
@ -56,7 +52,7 @@ func (this *Api_Comp) QueryUserMailReq(ctx context.Context, session comm.IUserSe
|
||||
code := pb.ErrorCode_Success
|
||||
mailinfo := make([]*pb.DB_MailData, 0)
|
||||
defer func() {
|
||||
session.SendMsg("mail", "queryusermailresp", code, &pb.QueryUserMailResp{Mails: mailinfo})
|
||||
session.SendMsg(string(this.module.GetType()), QueryUserMailResp, code, &pb.QueryUserMailResp{Mails: mailinfo})
|
||||
}()
|
||||
if session.GetUserId() == "" {
|
||||
code = pb.ErrorCode_NoLogin
|
||||
@ -78,7 +74,7 @@ func (this *Api_Comp) ReadUserMailReq(ctx context.Context, session comm.IUserSes
|
||||
mail *pb.DB_MailData
|
||||
)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), "readusermailresp", code, &pb.ReadUserMailResp{Mail: mail})
|
||||
session.SendMsg(string(this.module.GetType()), ReadUserMailResp, code, &pb.ReadUserMailResp{Mail: mail})
|
||||
}()
|
||||
if session.GetUserId() == "" {
|
||||
code = pb.ErrorCode_NoLogin
|
||||
@ -101,7 +97,7 @@ func (this *Api_Comp) GetUserMailAttachmentReq(ctx context.Context, session comm
|
||||
mail *pb.DB_MailData
|
||||
)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), "getusermailattachmentresp", code, &pb.GetUserMailAttachmentResp{Mail: mail})
|
||||
session.SendMsg(string(this.module.GetType()), GetUserMailAttachmentResp, code, &pb.GetUserMailAttachmentResp{Mail: mail})
|
||||
}()
|
||||
if session.GetUserId() == "" {
|
||||
code = pb.ErrorCode_NoLogin
|
||||
@ -120,13 +116,13 @@ func (this *Api_Comp) GetUserMailAttachmentReq(ctx context.Context, session comm
|
||||
for _, v := range _data {
|
||||
_items[v.ItemId] += v.ItemCount
|
||||
}
|
||||
bRet := this.pack.GetRewaredItems(mail.UserId, _items)
|
||||
if bRet {
|
||||
// 修改状态
|
||||
db.Defsys.Mail_UpdateMailAttachmentState(req.ObjID)
|
||||
mail.Reward = true
|
||||
return
|
||||
}
|
||||
// bRet := this.pack.GetRewaredItems(mail.UserId, _items)
|
||||
// if bRet {
|
||||
// // 修改状态
|
||||
// db.Defsys.Mail_UpdateMailAttachmentState(req.ObjID)
|
||||
// mail.Reward = true
|
||||
// return
|
||||
// }
|
||||
}
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
@ -140,7 +136,7 @@ func (this *Api_Comp) DelUserMailReq(ctx context.Context, session comm.IUserSess
|
||||
code := pb.ErrorCode_Success
|
||||
mailinfo := make([]*pb.DB_MailData, 0)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), "delusermailresp", code, &pb.DelUserMailResp{Mail: mailinfo})
|
||||
session.SendMsg(string(this.module.GetType()), DelUserMailResp, code, &pb.DelUserMailResp{Mail: mailinfo})
|
||||
}()
|
||||
if session.GetUserId() == "" {
|
||||
code = pb.ErrorCode_NoLogin
|
||||
|
@ -47,7 +47,7 @@ func (this *Mail) CreateNewMail(uId string) {
|
||||
Title: "系统邮件",
|
||||
Contex: "恭喜获得专属礼包一份",
|
||||
CreateTime: uint64(time.Now().Unix()),
|
||||
DueTime: uint64(time.Now().Unix()) + 30*24*3600,
|
||||
DueTime: uint64(time.Now().Unix()) + 30*24*3600, // 30天需要走配置文件
|
||||
Check: false,
|
||||
Reward: false,
|
||||
}
|
||||
@ -60,5 +60,6 @@ func (this *Mail) CreateNewMail(uId string) {
|
||||
if _cache == nil {
|
||||
return
|
||||
}
|
||||
this.SendMsgToUser("mail", "getnewEmailresp", mail, _cache)
|
||||
|
||||
this.SendMsgToUser(string(this.GetType()), GetNewEMailResp, mail, _cache)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user