go_dreamfactory/modules/smithy/api_getlist.go
2023-02-23 15:03:27 +08:00

37 lines
1.1 KiB
Go

package smithy
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.SmithyGetListReq) (code pb.ErrorCode) {
return
}
///获取美食城基本信息
func (this *apiComp) GetList(session comm.IUserSession, req *pb.SmithyGetListReq) (code pb.ErrorCode, data proto.Message) {
this.module.modelAtlas.CheckActivateAtlas(session.GetUserId(), "10110", 1, 1, 1)
this.AtlasList(session, &pb.SmithyAtlasListReq{})
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
_smithy, err := this.module.modelSmithy.getSmithyList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 计算订单信息
this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _smithy)
session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _smithy})
this.module.ModuleRtask.SendToRtask(session, comm.Rtype137, _smithy.TotalTime)
return
}