thread-master/backend/internal/logic/job/disable_job_schedule_logic.go

27 lines
639 B
Go
Raw Normal View History

2026-06-26 08:37:04 +00:00
package job
import (
"context"
"haixun-backend/internal/svc"
"haixun-backend/internal/types"
)
type DisableJobScheduleLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewDisableJobScheduleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DisableJobScheduleLogic {
return &DisableJobScheduleLogic{ctx: ctx, svcCtx: svcCtx}
}
func (l *DisableJobScheduleLogic) DisableJobSchedule(req *types.JobScheduleIDPath) (*types.JobScheduleData, error) {
schedule, err := l.svcCtx.Job.DisableSchedule(l.ctx, req.ID)
if err != nil {
return nil, err
}
data := toJobScheduleData(schedule)
return &data, nil
}