Files
moteva/server/internal/logic/canda_thread_status_logic.go
T

45 lines
1002 B
Go
Raw Normal View History

// 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 CandaThreadStatusLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewCandaThreadStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CandaThreadStatusLogic {
return &CandaThreadStatusLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *CandaThreadStatusLogic) CandaThreadStatus(req *types.CandaThreadStatusRequest) (resp *types.CandaThreadStatusResponse, err error) {
status := "done"
if req.ProjectId != "" {
thread, err := l.svcCtx.DesignService.AgentThreadStatus(l.ctx, req.ProjectId)
if err != nil {
return nil, err
}
status = thread.Status
}
return &types.CandaThreadStatusResponse{
Code: 0,
Msg: "success",
Data: types.CandaThreadStatusData{Status: status},
}, nil
}