101577f163
- Updated import paths in multiple service files to reflect the new agent-desk module. - Added a new configuration file for agent-desk in the Docker setup.
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package builders
|
|
|
|
import (
|
|
"agent-desk/internal/pkg/dto/response"
|
|
"agent-desk/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}
|
|
}
|