购买月卡

This commit is contained in:
meixiongfeng 2022-11-23 18:15:17 +08:00
parent 83114052fa
commit 58b6327973
5 changed files with 42 additions and 30 deletions

View File

@ -191,8 +191,6 @@ func (this *Pagoda) CheckPoint6(uid string) bool {
func (this *Pagoda) Rpc_ModuleSeasonPagodaReward(ctx context.Context, args *pb.EmptyReq, reply *pb.EmptyResp) { func (this *Pagoda) Rpc_ModuleSeasonPagodaReward(ctx context.Context, args *pb.EmptyReq, reply *pb.EmptyResp) {
this.Debug("Rpc_ModuleSeasonPagodaReward", log.Fields{"args": args.String()}) this.Debug("Rpc_ModuleSeasonPagodaReward", log.Fields{"args": args.String()})
this.modulerank.seasonSettlement() this.modulerank.seasonSettlement()
// 清除战令信息
this.CleanPassCheck()
} }
func (this *Pagoda) CheckPoint7(uid string) bool { func (this *Pagoda) CheckPoint7(uid string) bool {
@ -226,16 +224,3 @@ func (this *Pagoda) CheckPagodaMaxFloor(uid string, pagodaType int32) int32 {
} }
return 0 return 0
} }
func (this *Pagoda) CleanPassCheck() (code pb.ErrorCode) {
list, _ := this.modelSeasonPagoda.getSeasonPagodaList("")
if list.Id == "" {
code = pb.ErrorCode_PagodaConditionErr // 领取条件没达到
return
}
if list.PagodaId <= list.PassCheckID { // 层数校验
code = pb.ErrorCode_PagodaConditionErr // 领取条件没达到
return
}
return
}

View File

@ -8,6 +8,7 @@ import (
const ( const (
PrivilegeGetListResp = "getlist" PrivilegeGetListResp = "getlist"
PrivilegeBuyYuekaResp = "buyyueka"
) )
type apiComp struct { type apiComp struct {

View File

@ -0,0 +1,26 @@
package privilege
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) BuyYuekaCheck(session comm.IUserSession, req *pb.PrivilegeBuyYuekaReq) (code pb.ErrorCode) {
if req.CID == "" {
code = pb.ErrorCode_ReqParameterError
}
return
}
///获取特权列表
func (this *apiComp) BuyYueka(session comm.IUserSession, req *pb.PrivilegeBuyYuekaReq) (code pb.ErrorCode, data proto.Message) {
if code = this.BuyYuekaCheck(session, req); code != pb.ErrorCode_Success {
return
}
_, code = this.module.CreatePrivilegeCard(session, req.CID)
return
}

View File

@ -143,7 +143,7 @@ func (this *Privilege) CreatePrivilegeCard(session comm.IUserSession, cId string
} }
// 推送 // 推送
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeGetListResp{Data: []*pb.DBPrivilege{data}}) session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list})
return return
} }
@ -176,7 +176,7 @@ func (this *Privilege) RenewPrivilegeCard(session comm.IUserSession, cId string)
break break
} }
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeGetListResp{Data: []*pb.DBPrivilege{v}}) session.SendMsg(string(this.GetType()), PrivilegeBuyYuekaResp, &pb.PrivilegeGetListResp{Data: list})
atn.T = conf.Id atn.T = conf.Id
res = append(res, atn) // 加资源 res = append(res, atn) // 加资源
for _, v := range conf.DisposableReward { for _, v := range conf.DisposableReward {

View File

@ -113,7 +113,7 @@ type PrivilegeBuyYuekaReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
PType int32 `protobuf:"varint,1,opt,name=pType,proto3" json:"pType"` CID string `protobuf:"bytes,1,opt,name=cID,proto3" json:"cID"`
} }
func (x *PrivilegeBuyYuekaReq) Reset() { func (x *PrivilegeBuyYuekaReq) Reset() {
@ -148,11 +148,11 @@ func (*PrivilegeBuyYuekaReq) Descriptor() ([]byte, []int) {
return file_privilege_privilege_msg_proto_rawDescGZIP(), []int{2} return file_privilege_privilege_msg_proto_rawDescGZIP(), []int{2}
} }
func (x *PrivilegeBuyYuekaReq) GetPType() int32 { func (x *PrivilegeBuyYuekaReq) GetCID() string {
if x != nil { if x != nil {
return x.PType return x.CID
} }
return 0 return ""
} }
type PrivilegeBuyYuekaResp struct { type PrivilegeBuyYuekaResp struct {
@ -213,15 +213,15 @@ var file_privilege_privilege_msg_proto_rawDesc = []byte{
0x74, 0x52, 0x65, 0x71, 0x22, 0x38, 0x0a, 0x14, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x74, 0x52, 0x65, 0x71, 0x22, 0x38, 0x0a, 0x14, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67,
0x65, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x65, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x50, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x50,
0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2c, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x28,
0x0a, 0x14, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x42, 0x75, 0x79, 0x59, 0x75, 0x0a, 0x14, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x42, 0x75, 0x79, 0x59, 0x75,
0x65, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x65, 0x6b, 0x61, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x49, 0x44, 0x18, 0x01, 0x20,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0x39, 0x0a, 0x15, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x49, 0x44, 0x22, 0x39, 0x0a, 0x15, 0x50, 0x72, 0x69, 0x76,
0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x42, 0x75, 0x79, 0x59, 0x75, 0x65, 0x6b, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x42, 0x75, 0x79, 0x59, 0x75, 0x65, 0x6b, 0x61, 0x52, 0x65, 0x73,
0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x70, 0x12, 0x20, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x0c, 0x2e, 0x44, 0x42, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x52, 0x04, 0x64,
0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x74, 0x6f, 0x33,
} }
var ( var (