29 lines
629 B
Go
29 lines
629 B
Go
package gourmet
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) CreateOrderCheck(session comm.IUserSession, req *pb.GourmetCreateOrderReq) (code pb.ErrorCode) {
|
|
if len(req.Order) == 0 {
|
|
code = pb.ErrorCode_ReqParameterError
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
///美食城创建订单
|
|
func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreateOrderReq) (code pb.ErrorCode, data proto.Message) {
|
|
|
|
code = this.CreateOrderCheck(session, req)
|
|
if code != pb.ErrorCode_Success {
|
|
return // 参数校验失败直接返回
|
|
}
|
|
|
|
return
|
|
}
|