上传接口调整
This commit is contained in:
parent
95f071b3bc
commit
51e5536701
@ -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})
|
||||
}
|
||||
}()
|
||||
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)
|
||||
code = pb.ErrorCode_CacheReadError
|
||||
return
|
||||
|
@ -19,7 +19,7 @@ type ModelFriend struct {
|
||||
}
|
||||
|
||||
func (this *ModelFriend) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.Model_Comp.Init(service, module, comp, options)
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.TableName = string(TableFriend)
|
||||
return
|
||||
}
|
||||
|
@ -9,21 +9,21 @@ import (
|
||||
/*
|
||||
API
|
||||
*/
|
||||
type Api_Comp struct {
|
||||
modules.MComp_GateComp
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
module *Game
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *Api_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.MComp_GateComp.Init(service, module, comp, options)
|
||||
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.module = module.(*Game)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Api_Comp) Start() (err error) {
|
||||
err = this.MComp_GateComp.Start()
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
return
|
||||
}
|
||||
|
@ -11,12 +11,12 @@ const (
|
||||
)
|
||||
|
||||
///配置管理组件
|
||||
type Configure_Comp struct {
|
||||
modules.MComp_Configure
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *Configure_Comp) 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)
|
||||
|
||||
return
|
||||
|
@ -18,8 +18,8 @@ func NewModule() core.IModule {
|
||||
|
||||
type Game struct {
|
||||
modules.ModuleBase
|
||||
api *ApiComp
|
||||
configure *ConfigureComp
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
}
|
||||
|
||||
//模块名
|
||||
@ -36,6 +36,6 @@ func (this *Game) Init(service core.IService, module core.IModule, options core.
|
||||
//装备组件
|
||||
func (this *Game) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(ApiComp)).(*ApiComp)
|
||||
this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp)
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
@ -12,19 +12,19 @@ const (
|
||||
)
|
||||
|
||||
///背包配置管理组件
|
||||
type Configure_Comp struct {
|
||||
modules.MComp_Configure
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *Configure_Comp) 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.LoadConfigure(game_msgdistrib, cfg.NewGame_msgDistrib)
|
||||
return
|
||||
}
|
||||
|
||||
//获取消息分发规则读取配置表
|
||||
func (this *Configure_Comp) GetMsgDistribRule(mtype, stype string) (rule string, ok bool) {
|
||||
func (this *configureComp) GetMsgDistribRule(mtype, stype string) (rule string, ok bool) {
|
||||
var (
|
||||
err error
|
||||
v interface{}
|
||||
|
@ -24,7 +24,7 @@ type Gateway struct {
|
||||
service base.IRPCXService
|
||||
wsservice *WSServiceComp //websocket 服务组件 提供websocket服务监听
|
||||
agentmgr *AgentMgrComp //用户代理对象管理组件 管理用户socekt对象
|
||||
configure *ConfigureComp
|
||||
configure *configureComp
|
||||
}
|
||||
|
||||
//模块名
|
||||
@ -72,7 +72,7 @@ func (this *Gateway) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.agentmgr = this.RegisterComp(new(AgentMgrComp)).(*AgentMgrComp)
|
||||
this.wsservice = this.RegisterComp(new(WSServiceComp)).(*WSServiceComp)
|
||||
this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
//有新的连接对象进入
|
||||
|
@ -18,12 +18,12 @@ const (
|
||||
DB_MailTable core.SqlTable = "mail"
|
||||
)
|
||||
|
||||
type ModelMail struct {
|
||||
modules.Model_Comp
|
||||
type modelMail struct {
|
||||
modules.MCompModel
|
||||
}
|
||||
|
||||
func (this *ModelMail) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.Model_Comp.Init(service, module, comp, options)
|
||||
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.TableName = "mail"
|
||||
//创建uid索引
|
||||
this.DB.CreateIndex(core.SqlTable(DB_MailTable), mongo.IndexModel{
|
||||
@ -32,7 +32,7 @@ func (this *ModelMail) Init(service core.IService, module core.IModule, comp cor
|
||||
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 {
|
||||
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.Check = false
|
||||
@ -60,7 +60,7 @@ func (this *ModelMail) Mail_InsertUserMail(mail *pb.DB_MailData) (err error) {
|
||||
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(
|
||||
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})
|
||||
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
|
||||
err := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId}).Decode(nd)
|
||||
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(
|
||||
DB_MailTable,
|
||||
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
|
||||
err := this.DB.FindOne(DB_MailTable, bson.M{"_id": objId}).Decode(obj)
|
||||
if err != nil {
|
||||
|
@ -25,7 +25,7 @@ func NewModule() core.IModule {
|
||||
type Mail struct {
|
||||
modules.ModuleBase
|
||||
api *apiComp
|
||||
modelMail *ModelMail
|
||||
modelMail *modelMail
|
||||
configure_comp *Configure_Comp
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ func (this *Mail) GetType() core.M_Modules {
|
||||
func (this *Mail) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user