go_dreamfactory/modules/enchant/api_buy.go
2023-06-06 09:56:12 +08:00

26 lines
602 B
Go

package enchant
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.EnchantBuyReq) (errdata *pb.ErrorData) {
if req.Count <= 0 {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
return
}
return
}
// 协议废除 走通用购买逻辑
func (this *apiComp) Buy(session comm.IUserSession, req *pb.EnchantBuyReq) (errdata *pb.ErrorData) {
session.SendMsg(string(this.module.GetType()), EnchantBuyResp, &pb.EnchantBuyResp{})
return
}