部分函数subType 修改

This commit is contained in:
meixiongfeng 2022-07-13 14:32:01 +08:00
parent e40621b335
commit 8b8595a7de
7 changed files with 11 additions and 18 deletions

View File

@ -6,14 +6,6 @@ import (
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
) )
const (
QueryUserMailResp = "queryusermailresp"
ReadUserMailResp = "readusermailresp"
GetUserMailAttachmentResp = "getusermailattachmentresp"
DelUserMailResp = "delusermailresp"
GetNewEMailResp = "getnewEmailresp"
)
type apiComp struct { type apiComp struct {
modules.MCompGate modules.MCompGate
service core.IService service core.IService

View File

@ -23,7 +23,7 @@ func (this *apiComp) DelMail(session comm.IUserSession, req *pb.MailDelMailReq)
var err error var err error
mailinfo := make([]*pb.DBMailData, 0) mailinfo := make([]*pb.DBMailData, 0)
defer func() { 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 code = this.DelMailCheck(session, req) // check
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {

View File

@ -22,7 +22,7 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma
mail *pb.DBMailData mail *pb.DBMailData
) )
defer func() { 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 code = this.GetUserMailAttachmentCheck(session, req) // check

View File

@ -18,7 +18,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.MailGetListReq)
var err error var err error
mailinfo := make([]*pb.DBMailData, 0) mailinfo := make([]*pb.DBMailData, 0)
defer func() { 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 code = this.GetListCheck(session, req) // check
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {

View File

@ -22,7 +22,7 @@ func (this *apiComp) ReadMail(session comm.IUserSession, req *pb.MailReadMailReq
mail *pb.DBMailData mail *pb.DBMailData
) )
defer func() { 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 code = this.ReadMailCheck(session, req) // check
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {

View File

@ -62,6 +62,6 @@ func (this *Mail) CreateNewMail(uId string, mail *pb.DBMailData) bool {
return false return false
} }
this.SendMsgToUser(string(this.GetType()), GetNewEMailResp, mail, _cache) this.SendMsgToUser(string(this.GetType()), "newmail", mail, _cache)
return true return true
} }

View File

@ -59,9 +59,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.StoryChallenge
_data := &pb.DBStory{} _data := &pb.DBStory{}
_data.Id = primitive.NewObjectID().Hex() _data.Id = primitive.NewObjectID().Hex()
_data.ChapterId = int32(req.ChapterId) _data.ChapterId = int32(req.ChapterId)
_map := make(map[string]*pb.DBStory) _mData := make(map[string]interface{}, 0)
_map[_data.Id] = _data _mData[_data.Id] = _data
//this.module.modelStory.addNewChapter(session.GetUserId(), _map) this.module.modelStory.addNewChapter(session.GetUserId(), _mData)
curChapter = _data curChapter = _data
//curChapter.StoryId = chaptConfig.Fubendata[0] // 第一次挑战 //curChapter.StoryId = chaptConfig.Fubendata[0] // 第一次挑战
} }
@ -90,6 +90,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.StoryChallenge
if curChapter.ChapterId == int32(req.ChapterId) && curChapter.StoryId == int32(req.StoryId) { if curChapter.ChapterId == int32(req.ChapterId) && curChapter.StoryId == int32(req.StoryId) {
update := map[string]interface{}{ update := map[string]interface{}{
"storyId": req.StoryId, "storyId": req.StoryId,
"ChapterId": req.ChapterId,
"branchID": curChapter.BranchID, "branchID": curChapter.BranchID,
} }
err = this.module.modelStory.modifyStoryData(session.GetUserId(), curChapter.Id, update) err = this.module.modelStory.modifyStoryData(session.GetUserId(), curChapter.Id, update)