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

34 lines
757 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 DoneFollowUpLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewDoneFollowUpLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DoneFollowUpLogic {
return &DoneFollowUpLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
}
func (l *DoneFollowUpLogic) DoneFollowUp(req *types.FollowUpIdReq) (*types.FollowUpPublic, error) {
uid, err := ownerUID(l.ctx)
if err != nil {
return nil, err
}
f, err := l.svcCtx.Crm.DoneFollowUp(l.ctx, uid, req.Id)
if err != nil {
return nil, err
}
return crmmap.FollowUp(f), nil
}