thread-master/apps/backend/internal/logic/crm/snooze_follow_up_logic.go

34 lines
785 B
Go
Raw Normal View History

2026-08-03 05:52:02 +00:00
package crm
import (
"context"
"apps/backend/internal/logic/crmmap"
"apps/backend/internal/svc"
"apps/backend/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type SnoozeFollowUpLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewSnoozeFollowUpLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SnoozeFollowUpLogic {
return &SnoozeFollowUpLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
}
func (l *SnoozeFollowUpLogic) SnoozeFollowUp(req *types.SnoozeFollowUpReq) (*types.FollowUpPublic, error) {
uid, err := ownerUID(l.ctx)
if err != nil {
return nil, err
}
f, err := l.svcCtx.Crm.SnoozeFollowUp(l.ctx, uid, req.Id, req.Days)
if err != nil {
return nil, err
}
return crmmap.FollowUp(f), nil
}