1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 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.IsAppointmentReq) (*pb.Resp, error) {
- // todo: add your logic here and delete this line
- resp := &pb.Resp{}
- appointment := &entity.AppointmentStruct{
- Appid: in.AppId,
- UserId: in.UserId,
- ActivityId: in.ActivityId,
- }
- 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
- }
|