Files
ai-agent/internal/builders/agent_revision_builder.go
T
mlogclub 847f688398 Refactor AI Agent configuration and workflow handling
- Removed runtime mode handling from AIAgentConfigWorkbench and related components.
- Updated tests to reflect changes in AI Agent policy copy and configuration.
- Changed terminology from "workflow" to "revision" in various components and API responses.
- Simplified agent binding logic in channel editing.
- Cleaned up unused variables and types related to runtime modes.
- Updated localization files for consistency with new terminology.
2026-07-27 23:29:02 +08:00

30 lines
881 B
Go

package builders
import (
"agent-desk/internal/models"
"agent-desk/internal/pkg/dto/response"
)
func BuildAgentRevision(item *models.AgentRevision) response.AgentRevisionResponse {
if item == nil {
return response.AgentRevisionResponse{}
}
publishedAt := ""
if item.PublishedAt != nil {
publishedAt = item.PublishedAt.Format("2006-01-02 15:04:05")
}
return response.AgentRevisionResponse{
ID: item.ID, AgentID: item.AgentID, Revision: item.Revision,
Status: item.Status, DefinitionHash: item.DefinitionHash, PublishedAt: publishedAt,
PublishedByID: item.PublishedByID, PublishedByName: item.PublishedByName,
}
}
func BuildAgentRevisionList(items []models.AgentRevision) []response.AgentRevisionResponse {
ret := make([]response.AgentRevisionResponse, 0, len(items))
for i := range items {
ret = append(ret, BuildAgentRevision(&items[i]))
}
return ret
}