37 lines
922 B
Go
37 lines
922 B
Go
package pagoda
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) ActivateCheck(session comm.IUserSession, req *pb.PagodaActivateReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///获取主线关卡信息
|
|
func (this *apiComp) Activate(session comm.IUserSession, req *pb.PagodaActivateReq) (code pb.ErrorCode, data proto.Message) {
|
|
var (
|
|
list *pb.DBPagoda
|
|
)
|
|
list, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
|
|
if err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
Nomalcfg := this.module.configure.GetPagodaConfigData(list.PagodaId + 1)
|
|
if Nomalcfg == nil && !list.Complete {
|
|
list.Complete = true
|
|
this.module.ModifyPagodaData(session.GetUserId(), map[string]interface{}{
|
|
"complete": true,
|
|
})
|
|
}
|
|
|
|
session.SendMsg(string(this.module.GetType()), PagodaActivateResp, &pb.PagodaActivateResp{Data: list})
|
|
return
|
|
}
|