2bbf42b741
Remove Agent Desk users, roles, login sessions, tokens, and local permission persistence. Expose the backend as an embeddable ai-agent module with host-provided subject lookup and operation authorization callbacks, and complete the frontend/backend repository split.
40 lines
1.3 KiB
Go
40 lines
1.3 KiB
Go
package builders
|
|
|
|
import (
|
|
"code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
|
|
"code.tczkiot.com/wlw/ai-agent/internal/services"
|
|
"time"
|
|
)
|
|
|
|
func BuildAgentTeamScheduleBatchPreviewResponse(result *services.AgentTeamScheduleBatchPreviewResult) *response.AgentTeamScheduleBatchPreviewResponse {
|
|
if result == nil {
|
|
return nil
|
|
}
|
|
items := make([]response.AgentTeamScheduleBatchPreviewItem, 0, len(result.Items))
|
|
for _, item := range result.Items {
|
|
items = append(items, response.AgentTeamScheduleBatchPreviewItem{
|
|
TeamID: item.TeamID,
|
|
TeamName: item.TeamName,
|
|
Date: item.Date.Format(time.DateOnly),
|
|
Weekday: item.Weekday,
|
|
StartAt: item.StartAt.Format(time.DateTime),
|
|
EndAt: item.EndAt.Format(time.DateTime),
|
|
Remark: item.Remark,
|
|
Conflict: item.Conflict,
|
|
ConflictReason: item.ConflictReason,
|
|
})
|
|
}
|
|
return &response.AgentTeamScheduleBatchPreviewResponse{
|
|
Total: result.Total,
|
|
Conflict: result.Conflict,
|
|
Items: items,
|
|
}
|
|
}
|
|
|
|
func BuildAgentTeamScheduleBatchGenerateResponse(result *services.AgentTeamScheduleBatchGenerateResult) *response.AgentTeamScheduleBatchGenerateResponse {
|
|
if result == nil {
|
|
return nil
|
|
}
|
|
return &response.AgentTeamScheduleBatchGenerateResponse{Created: result.Created}
|
|
}
|