部分函数subType 修改
This commit is contained in:
parent
e40621b335
commit
8b8595a7de
@ -6,14 +6,6 @@ import (
|
||||
"go_dreamfactory/lego/core"
|
||||
)
|
||||
|
||||
const (
|
||||
QueryUserMailResp = "queryusermailresp"
|
||||
ReadUserMailResp = "readusermailresp"
|
||||
GetUserMailAttachmentResp = "getusermailattachmentresp"
|
||||
DelUserMailResp = "delusermailresp"
|
||||
GetNewEMailResp = "getnewEmailresp"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
|
@ -23,7 +23,7 @@ func (this *apiComp) DelMail(session comm.IUserSession, req *pb.MailDelMailReq)
|
||||
var err error
|
||||
mailinfo := make([]*pb.DBMailData, 0)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), DelUserMailResp, &pb.MailDelMailResp{Mail: mailinfo})
|
||||
session.SendMsg(string(this.module.GetType()), "delmail", &pb.MailDelMailResp{Mail: mailinfo})
|
||||
}()
|
||||
code = this.DelMailCheck(session, req) // check
|
||||
if code != pb.ErrorCode_Success {
|
||||
|
@ -22,7 +22,7 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma
|
||||
mail *pb.DBMailData
|
||||
)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), GetUserMailAttachmentResp, &pb.MailGetUserMailAttachmentResp{Mail: mail})
|
||||
session.SendMsg(string(this.module.GetType()), "getusermailattachment", &pb.MailGetUserMailAttachmentResp{Mail: mail})
|
||||
}()
|
||||
|
||||
code = this.GetUserMailAttachmentCheck(session, req) // check
|
||||
|
@ -18,7 +18,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.MailGetListReq)
|
||||
var err error
|
||||
mailinfo := make([]*pb.DBMailData, 0)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), QueryUserMailResp, &pb.MailGetListResp{Mails: mailinfo})
|
||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.MailGetListResp{Mails: mailinfo})
|
||||
}()
|
||||
code = this.GetListCheck(session, req) // check
|
||||
if code != pb.ErrorCode_Success {
|
||||
|
@ -22,7 +22,7 @@ func (this *apiComp) ReadMail(session comm.IUserSession, req *pb.MailReadMailReq
|
||||
mail *pb.DBMailData
|
||||
)
|
||||
defer func() {
|
||||
session.SendMsg(string(this.module.GetType()), ReadUserMailResp, &pb.MailReadMailResp{Mail: mail})
|
||||
session.SendMsg(string(this.module.GetType()), "readmail", &pb.MailReadMailResp{Mail: mail})
|
||||
}()
|
||||
code = this.ReadMailCheck(session, req) // check
|
||||
if code != pb.ErrorCode_Success {
|
||||
|
@ -62,6 +62,6 @@ func (this *Mail) CreateNewMail(uId string, mail *pb.DBMailData) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
this.SendMsgToUser(string(this.GetType()), GetNewEMailResp, mail, _cache)
|
||||
this.SendMsgToUser(string(this.GetType()), "newmail", mail, _cache)
|
||||
return true
|
||||
}
|
||||
|
@ -59,9 +59,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.StoryChallenge
|
||||
_data := &pb.DBStory{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = int32(req.ChapterId)
|
||||
_map := make(map[string]*pb.DBStory)
|
||||
_map[_data.Id] = _data
|
||||
//this.module.modelStory.addNewChapter(session.GetUserId(), _map)
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_mData[_data.Id] = _data
|
||||
this.module.modelStory.addNewChapter(session.GetUserId(), _mData)
|
||||
curChapter = _data
|
||||
//curChapter.StoryId = chaptConfig.Fubendata[0] // 第一次挑战
|
||||
}
|
||||
@ -89,8 +89,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.StoryChallenge
|
||||
}
|
||||
if curChapter.ChapterId == int32(req.ChapterId) && curChapter.StoryId == int32(req.StoryId) {
|
||||
update := map[string]interface{}{
|
||||
"storyId": req.StoryId,
|
||||
"branchID": curChapter.BranchID,
|
||||
"storyId": req.StoryId,
|
||||
"ChapterId": req.ChapterId,
|
||||
"branchID": curChapter.BranchID,
|
||||
}
|
||||
err = this.module.modelStory.modifyStoryData(session.GetUserId(), curChapter.Id, update)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user