32 lines
874 B
Go
32 lines
874 B
Go
package smithy
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetStoveInfoCheck(session comm.IUserSession, req *pb.SmithyGetStoveInfoReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
// 获取铁匠铺信息
|
|
func (this *apiComp) GetStoveInfo(session comm.IUserSession, req *pb.SmithyGetStoveInfoReq) (code pb.ErrorCode, data proto.Message) {
|
|
|
|
code = this.GetStoveInfoCheck(session, req)
|
|
if code != pb.ErrorCode_Success {
|
|
return // 参数校验失败直接返回
|
|
}
|
|
_smithy, err := this.module.modelStove.getSmithyStoveList(session.GetUserId())
|
|
if err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
this.module.modelStove.calculationRecoveryT(session.GetUserId(), _smithy)
|
|
session.SendMsg(string(this.module.GetType()), "getstoveinfo", &pb.SmithyGetStoveInfoResp{Data: _smithy})
|
|
return
|
|
}
|