40 lines
939 B
Go
40 lines
939 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 ExtractNodeTextAsyncLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewExtractNodeTextAsyncLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExtractNodeTextAsyncLogic {
|
||
|
|
return &ExtractNodeTextAsyncLogic{
|
||
|
|
Logger: logx.WithContext(ctx),
|
||
|
|
ctx: ctx,
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *ExtractNodeTextAsyncLogic) ExtractNodeTextAsync(req *types.ExtractNodeTextAsyncRequest) (resp *types.AgentThreadResponse, err error) {
|
||
|
|
feature := req.Feature
|
||
|
|
if req.Eitdortxt != "" {
|
||
|
|
feature = "eitdortxt"
|
||
|
|
}
|
||
|
|
thread, err := l.svcCtx.DesignService.ExtractNodeTextAsync(l.ctx, req.Id, req.NodeId, feature)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return toAPIAgentThread(thread), nil
|
||
|
|
}
|