Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into liwei
This commit is contained in:
commit
e6029d61bb
@ -23,7 +23,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, agrs map[string]interfac
|
|||||||
session.SendMsg(string(this.module.GetType()), "", &pb.Equipment_GetList_Resp{Equipments: items})
|
session.SendMsg(string(this.module.GetType()), "", &pb.Equipment_GetList_Resp{Equipments: items})
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if items, err = this.module.modelequipment.QueryUserEquipments(session.GetUserId()); err != nil {
|
if items, err = this.module.modelEquipment.QueryUserEquipments(session.GetUserId()); err != nil {
|
||||||
log.Errorf("QueryUserPackReq err:%v", err)
|
log.Errorf("QueryUserPackReq err:%v", err)
|
||||||
code = pb.ErrorCode_CacheReadError
|
code = pb.ErrorCode_CacheReadError
|
||||||
return
|
return
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Addblack_Check(session comm.IUserSession, req *pb.Friend_BlackAdd_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.Friend_BlackAdd_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Agree_Check(session comm.IUserSession, req *pb.Friend_Agree_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.Friend_Agree_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
var err error
|
var err error
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Apply_Check(session comm.IUserSession, req *pb.Friend_Apply_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.Friend_Apply_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
var err error
|
var err error
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) ApplyList_Check(session comm.IUserSession, req *pb.Friend_ApplyList_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.Friend_ApplyList_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Blacklist_Check(session comm.IUserSession, req *pb.Friend_BlackList_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.Friend_BlackList_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Del_Check(session comm.IUserSession, req *pb.Friend_Del_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) DelCheck(session comm.IUserSession, req *pb.Friend_Del_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Delblack_Check(session comm.IUserSession, req *pb.Friend_DelBlack_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) DelblackCheck(session comm.IUserSession, req *pb.Friend_DelBlack_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) List_Check(session comm.IUserSession, req *pb.Friend_List_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.Friend_List_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Refuse_Check(session comm.IUserSession, req *pb.Friend_Refuse_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.Friend_Refuse_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
chk = make(map[string]interface{})
|
chk = make(map[string]interface{})
|
||||||
var err error
|
var err error
|
||||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Search_Check(session comm.IUserSession, req *pb.Friend_Search_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.Friend_Search_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||||
if req.NickName == "" {
|
if req.NickName == "" {
|
||||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSearchNameEmpty}
|
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSearchNameEmpty}
|
||||||
return
|
return
|
||||||
|
@ -9,21 +9,21 @@ import (
|
|||||||
/*
|
/*
|
||||||
API
|
API
|
||||||
*/
|
*/
|
||||||
type ApiComp struct {
|
type apiComp struct {
|
||||||
modules.MCompGate
|
modules.MCompGate
|
||||||
service core.IService
|
service core.IService
|
||||||
module *Game
|
module *Game
|
||||||
}
|
}
|
||||||
|
|
||||||
//组件初始化接口
|
//组件初始化接口
|
||||||
func (this *ApiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
this.MCompGate.Init(service, module, comp, options)
|
this.MCompGate.Init(service, module, comp, options)
|
||||||
this.module = module.(*Game)
|
this.module = module.(*Game)
|
||||||
this.service = service
|
this.service = service
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ApiComp) Start() (err error) {
|
func (this *apiComp) Start() (err error) {
|
||||||
err = this.MCompGate.Start()
|
err = this.MCompGate.Start()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -11,12 +11,12 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
///配置管理组件
|
///配置管理组件
|
||||||
type ConfigureComp struct {
|
type configureComp struct {
|
||||||
modules.MCompConfigure
|
modules.MCompConfigure
|
||||||
}
|
}
|
||||||
|
|
||||||
//组件初始化接口
|
//组件初始化接口
|
||||||
func (this *ConfigureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
this.ModuleCompBase.Init(service, module, comp, options)
|
this.ModuleCompBase.Init(service, module, comp, options)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -18,8 +18,8 @@ func NewModule() core.IModule {
|
|||||||
|
|
||||||
type Game struct {
|
type Game struct {
|
||||||
modules.ModuleBase
|
modules.ModuleBase
|
||||||
api *ApiComp
|
api *apiComp
|
||||||
configure *ConfigureComp
|
configure *configureComp
|
||||||
}
|
}
|
||||||
|
|
||||||
//模块名
|
//模块名
|
||||||
@ -36,6 +36,6 @@ func (this *Game) Init(service core.IService, module core.IModule, options core.
|
|||||||
//装备组件
|
//装备组件
|
||||||
func (this *Game) OnInstallComp() {
|
func (this *Game) OnInstallComp() {
|
||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
this.api = this.RegisterComp(new(ApiComp)).(*ApiComp)
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp)
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||||
}
|
}
|
||||||
|
@ -12,19 +12,19 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
///背包配置管理组件
|
///背包配置管理组件
|
||||||
type ConfigureComp struct {
|
type configureComp struct {
|
||||||
modules.MCompConfigure
|
modules.MCompConfigure
|
||||||
}
|
}
|
||||||
|
|
||||||
//组件初始化接口
|
//组件初始化接口
|
||||||
func (this *ConfigureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
this.ModuleCompBase.Init(service, module, comp, options)
|
this.ModuleCompBase.Init(service, module, comp, options)
|
||||||
this.LoadConfigure(game_msgdistrib, cfg.NewGame_msgDistrib)
|
this.LoadConfigure(game_msgdistrib, cfg.NewGame_msgDistrib)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取消息分发规则读取配置表
|
//获取消息分发规则读取配置表
|
||||||
func (this *ConfigureComp) GetMsgDistribRule(mtype, stype string) (rule string, ok bool) {
|
func (this *configureComp) GetMsgDistribRule(mtype, stype string) (rule string, ok bool) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
v interface{}
|
v interface{}
|
||||||
|
@ -24,7 +24,7 @@ type Gateway struct {
|
|||||||
service base.IRPCXService
|
service base.IRPCXService
|
||||||
wsservice *WSServiceComp //websocket 服务组件 提供websocket服务监听
|
wsservice *WSServiceComp //websocket 服务组件 提供websocket服务监听
|
||||||
agentmgr *AgentMgrComp //用户代理对象管理组件 管理用户socekt对象
|
agentmgr *AgentMgrComp //用户代理对象管理组件 管理用户socekt对象
|
||||||
configure *ConfigureComp
|
configure *configureComp
|
||||||
}
|
}
|
||||||
|
|
||||||
//模块名
|
//模块名
|
||||||
@ -72,7 +72,7 @@ func (this *Gateway) OnInstallComp() {
|
|||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
this.agentmgr = this.RegisterComp(new(AgentMgrComp)).(*AgentMgrComp)
|
this.agentmgr = this.RegisterComp(new(AgentMgrComp)).(*AgentMgrComp)
|
||||||
this.wsservice = this.RegisterComp(new(WSServiceComp)).(*WSServiceComp)
|
this.wsservice = this.RegisterComp(new(WSServiceComp)).(*WSServiceComp)
|
||||||
this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp)
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||||
}
|
}
|
||||||
|
|
||||||
//有新的连接对象进入
|
//有新的连接对象进入
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) StrengthenUpStar_Check(session comm.IUserSession, req *pb.Hero_StrengthenUpStar_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.Hero_StrengthenUpStar_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
if req.HeroObjID == "" {
|
if req.HeroObjID == "" {
|
||||||
code.Code = pb.ErrorCode_ReqParameterError
|
code.Code = pb.ErrorCode_ReqParameterError
|
||||||
return
|
return
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) StrengthenUplv_Check(session comm.IUserSession, req *pb.Hero_StrengthenUplv_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero_StrengthenUplv_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
if req.HeroObjID == "" {
|
if req.HeroObjID == "" {
|
||||||
code.Code = pb.ErrorCode_ReqParameterError
|
code.Code = pb.ErrorCode_ReqParameterError
|
||||||
return
|
return
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) Info_Check(session comm.IUserSession, req *pb.Hero_Info_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.Hero_Info_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
result = map[string]interface{}{}
|
result = map[string]interface{}{}
|
||||||
hero := this.moduleHero.modelHero.getOneHero(session.GetUserId(), req.HeroId)
|
hero := this.moduleHero.modelHero.getOneHero(session.GetUserId(), req.HeroId)
|
||||||
if hero == nil {
|
if hero == nil {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) List_Check(session comm.IUserSession, req *pb.Hero_List_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.Hero_List_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) Getlist_Check(session comm.IUserSession, req *pb.Items_Getlist_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.Items_Getlist_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
result = map[string]interface{}{"ce": 123}
|
result = map[string]interface{}{"ce": 123}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) SellItem_Check(session comm.IUserSession, req *pb.Items_SellItem_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) SellItemCheck(session comm.IUserSession, req *pb.Items_SellItem_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) DelMail_Check(session comm.IUserSession, req *pb.Mail_DelMail_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) DelMailCheck(session comm.IUserSession, req *pb.Mail_DelMail_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) GetUserMailAttachment_Check(session comm.IUserSession, req *pb.Mail_GetUserMailAttachment_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) GetUserMailAttachmentCheck(session comm.IUserSession, req *pb.Mail_GetUserMailAttachment_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) GetList_Check(session comm.IUserSession, req *pb.Mail_GetList_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.Mail_GetList_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) ReadMail_Check(session comm.IUserSession, req *pb.Mail_ReadMail_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) ReadMailCheck(session comm.IUserSession, req *pb.Mail_ReadMail_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,11 @@ const (
|
|||||||
DB_MailTable core.SqlTable = "mail"
|
DB_MailTable core.SqlTable = "mail"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ModelMail struct {
|
type modelMail struct {
|
||||||
modules.MCompModel
|
modules.MCompModel
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ModelMail) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *modelMail) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
this.MCompModel.Init(service, module, comp, options)
|
this.MCompModel.Init(service, module, comp, options)
|
||||||
this.TableName = "mail"
|
this.TableName = "mail"
|
||||||
//创建uid索引
|
//创建uid索引
|
||||||
@ -32,7 +32,7 @@ func (this *ModelMail) Init(service core.IService, module core.IModule, comp cor
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ModelMail) Mail_QueryUserMail(uId string) (mail []*pb.DB_MailData, err error) {
|
func (this *modelMail) Mail_QueryUserMail(uId string) (mail []*pb.DB_MailData, err error) {
|
||||||
|
|
||||||
if _data, err := this.DB.Find(DB_MailTable, bson.M{"userid": uId}); err == nil {
|
if _data, err := this.DB.Find(DB_MailTable, bson.M{"userid": uId}); err == nil {
|
||||||
for _data.Next(context.TODO()) {
|
for _data.Next(context.TODO()) {
|
||||||
@ -46,7 +46,7 @@ func (this *ModelMail) Mail_QueryUserMail(uId string) (mail []*pb.DB_MailData, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 插入一封新的邮件
|
// 插入一封新的邮件
|
||||||
func (this *ModelMail) Mail_InsertUserMail(mail *pb.DB_MailData) (err error) {
|
func (this *modelMail) Mail_InsertUserMail(mail *pb.DB_MailData) (err error) {
|
||||||
|
|
||||||
mail.ObjId = primitive.NewObjectID().Hex()
|
mail.ObjId = primitive.NewObjectID().Hex()
|
||||||
mail.Check = false
|
mail.Check = false
|
||||||
@ -60,7 +60,7 @@ func (this *ModelMail) Mail_InsertUserMail(mail *pb.DB_MailData) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ModelMail) Mail_ReadOneMail(objId string) (mail *pb.DB_MailData, err error) {
|
func (this *modelMail) Mail_ReadOneMail(objId string) (mail *pb.DB_MailData, err error) {
|
||||||
|
|
||||||
err = this.DB.FindOneAndUpdate(
|
err = this.DB.FindOneAndUpdate(
|
||||||
DB_MailTable,
|
DB_MailTable,
|
||||||
@ -75,7 +75,7 @@ func (this *ModelMail) Mail_ReadOneMail(objId string) (mail *pb.DB_MailData, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询附件信息
|
// 查询附件信息
|
||||||
func (this *ModelMail) Mail_GetMailAttachment(objId string) (itmes []*pb.MailAttachment, err error) {
|
func (this *modelMail) Mail_GetMailAttachment(objId string) (itmes []*pb.MailAttachment, err error) {
|
||||||
|
|
||||||
obj := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId})
|
obj := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId})
|
||||||
var nd *pb.DB_MailData
|
var nd *pb.DB_MailData
|
||||||
@ -86,7 +86,7 @@ func (this *ModelMail) Mail_GetMailAttachment(objId string) (itmes []*pb.MailAtt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查看领取附件状态
|
// 查看领取附件状态
|
||||||
func (this *ModelMail) Mail_GetMailAttachmentState(objId string) bool {
|
func (this *modelMail) Mail_GetMailAttachmentState(objId string) bool {
|
||||||
var nd *pb.DB_MailData
|
var nd *pb.DB_MailData
|
||||||
err := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId}).Decode(nd)
|
err := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId}).Decode(nd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -96,7 +96,7 @@ func (this *ModelMail) Mail_GetMailAttachmentState(objId string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新领取附件状态
|
// 更新领取附件状态
|
||||||
func (this *ModelMail) Mail_UpdateMailAttachmentState(objId string) bool {
|
func (this *modelMail) Mail_UpdateMailAttachmentState(objId string) bool {
|
||||||
this.DB.FindOneAndUpdate(
|
this.DB.FindOneAndUpdate(
|
||||||
DB_MailTable,
|
DB_MailTable,
|
||||||
bson.M{"_id": objId},
|
bson.M{"_id": objId},
|
||||||
@ -110,7 +110,7 @@ func (this *ModelMail) Mail_UpdateMailAttachmentState(objId string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除一封邮件
|
// 删除一封邮件
|
||||||
func (this *ModelMail) Mail_DelUserMail(objId string) bool {
|
func (this *modelMail) Mail_DelUserMail(objId string) bool {
|
||||||
var obj *pb.DB_MailData
|
var obj *pb.DB_MailData
|
||||||
err := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId}).Decode(obj)
|
err := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId}).Decode(obj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -25,7 +25,7 @@ func NewModule() core.IModule {
|
|||||||
type Mail struct {
|
type Mail struct {
|
||||||
modules.ModuleBase
|
modules.ModuleBase
|
||||||
api *apiComp
|
api *apiComp
|
||||||
modelMail *ModelMail
|
modelMail *modelMail
|
||||||
configure_comp *Configure_Comp
|
configure_comp *Configure_Comp
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ func (this *Mail) GetType() core.M_Modules {
|
|||||||
func (this *Mail) OnInstallComp() {
|
func (this *Mail) OnInstallComp() {
|
||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
this.modelMail = this.RegisterComp(new(ModelMail)).(*ModelMail)
|
this.modelMail = this.RegisterComp(new(modelMail)).(*modelMail)
|
||||||
this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp)
|
this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Create_Check(session comm.IUserSession, req *pb.UserCreateReq) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.UserCreateReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
result = make(map[string]interface{})
|
result = make(map[string]interface{})
|
||||||
self := &pb.DB_UserData{}
|
self := &pb.DB_UserData{}
|
||||||
err := this.module.modelUser.Get(session.GetUserId(), self)
|
err := this.module.modelUser.Get(session.GetUserId(), self)
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) Login_Check(session comm.IUserSession, req *pb.UserLoginReq) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) LoginCheck(session comm.IUserSession, req *pb.UserLoginReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
result = map[string]interface{}{}
|
result = map[string]interface{}{}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *apiComp) Logout_Check(session comm.IUserSession, req *pb.UserLoginReq) (result map[string]interface{}, code comm.ErrorCode) {
|
func (this *apiComp) LogoutCheck(session comm.IUserSession, req *pb.UserLoginReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user