37 lines
799 B
Go
37 lines
799 B
Go
|
|
// Code scaffolded by goctl. Safe to edit.
|
||
|
|
// goctl 1.10.1
|
||
|
|
|
||
|
|
package logic
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"img_infinite_canvas/internal/svc"
|
||
|
|
"img_infinite_canvas/internal/types"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
|
)
|
||
|
|
|
||
|
|
type StopAgentTaskLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewStopAgentTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StopAgentTaskLogic {
|
||
|
|
return &StopAgentTaskLogic{
|
||
|
|
Logger: logx.WithContext(ctx),
|
||
|
|
ctx: ctx,
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *StopAgentTaskLogic) StopAgentTask(req *types.StopAgentTaskRequest) (resp *types.ProjectResponse, err error) {
|
||
|
|
project, err := l.svcCtx.DesignService.StopAgentTask(l.ctx, req.Id, req.ThreadId)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
|
||
|
|
return toProjectResponse(project), nil
|
||
|
|
}
|