go_dreamfactory/modules/enchant/api_buy.go
2023-01-09 19:39:17 +08:00

25 lines
565 B
Go

package enchant
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.EnchantBuyReq) (code pb.ErrorCode) {
if req.Count <= 0 {
code = pb.ErrorCode_ReqParameterError
return
}
return
}
// 协议废除 走通用购买逻辑
func (this *apiComp) Buy(session comm.IUserSession, req *pb.EnchantBuyReq) (code pb.ErrorCode, data proto.Message) {
session.SendMsg(string(this.module.GetType()), EnchantBuyResp, &pb.EnchantBuyResp{})
return
}