package logic import ( "context" "fmt" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/api/internal/svc" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/api/internal/types" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/public/service" "bp.jydev.jianyu360.cn/ApplicationCenter/marketing/rpc/pb" "github.com/zeromicro/go-zero/core/logx" ) type IsAppointmentLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewIsAppointmentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IsAppointmentLogic { return &IsAppointmentLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *IsAppointmentLogic) IsAppointment(req *types.IsAppointmentReq) (resp *types.Reply, err error) { // todo: add your logic here and delete this line resp = &types.Reply{} marketingResp, err := service.MarketingRpc.IsAppointment(l.ctx, &pb.IsAppointmentReq{ AppId: req.AppId, UserId: req.UserId, ActivityId: req.ActivityId, }) if err != nil { l.Error(fmt.Sprintf("%+v", req), resp.Error_msg) resp.Data = map[string]interface{}{ "status": -1, } } if marketingResp.ErrorMsg != "" { resp.Error_msg = marketingResp.ErrorMsg resp.Error_code = -1 l.Error(fmt.Sprintf("%+v", req), resp.Error_msg) } resp.Data = map[string]interface{}{ "status": marketingResp.Status, } return }