上传竞技场api代码

This commit is contained in:
liwei1dao 2022-10-21 15:26:43 +08:00
parent 04b0c315ab
commit b4882bfca7
4 changed files with 89 additions and 0 deletions

29
modules/arena/api.go Normal file
View File

@ -0,0 +1,29 @@
package arena
import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
/*
API
*/
type apiComp struct {
modules.MCompGate
service base.IRPCXService
module *Arena
}
//组件初始化接口
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.(*Arena)
this.service = service.(base.IRPCXService)
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}

View File

@ -0,0 +1,20 @@
package arena
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.ArenaChallengeReq) (code pb.ErrorCode) {
return
}
///挑战
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallengeReq) (code pb.ErrorCode, data proto.Message) {
return
}

20
modules/arena/api_info.go Normal file
View File

@ -0,0 +1,20 @@
package arena
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.ArenaInfoReq) (code pb.ErrorCode) {
return
}
///匹配
func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (code pb.ErrorCode, data proto.Message) {
return
}

View File

@ -0,0 +1,20 @@
package arena
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) MatcheCheck(session comm.IUserSession, req *pb.ArenaMatcheReq) (code pb.ErrorCode) {
return
}
///匹配
func (this *apiComp) Matche(session comm.IUserSession, req *pb.ArenaMatcheReq) (code pb.ErrorCode, data proto.Message) {
return
}