package logic import ( "context" "fmt" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/public/entity" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/rpc/internal/svc" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/rpc/pb" "github.com/zeromicro/go-zero/core/logx" ) type IsAppointmentLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewIsAppointmentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IsAppointmentLogic { return &IsAppointmentLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 用户是否预约 func (l *IsAppointmentLogic) IsAppointment(in *pb.AppointmentAddReq) (*pb.Resp, error) { // todo: add your logic here and delete this line resp := &pb.Resp{} appointment := &entity.AppointmentStruct{ Appid: in.AppId, UserId: in.UserId, ProductId: in.ProductId, UseProductType: in.UseProductType, } status, err := appointment.IsAppointment() if err != nil { l.Error(fmt.Sprintf("%+v", in), err.Error()) resp.ErrorMsg = err.Error() resp.ErrorCode = -1 } resp.Status = status return resp, nil }