This commit is contained in:
2026-10-04 13:23:26 +07:00
parent 88307ed402
commit c663fbb504
20 changed files with 2125 additions and 502 deletions
+39
View File
@@ -0,0 +1,39 @@
package app
import (
"evening_detective_server/internal/services/screen_plan_service"
proto "evening_detective_server/proto"
)
func mapScreenPlanSteps(steps []*proto.ScreenPlanStep) []screen_plan_service.Step {
mapped := make([]screen_plan_service.Step, 0, len(steps))
for _, step := range steps {
if step == nil {
mapped = append(mapped, screen_plan_service.Step{})
continue
}
mapped = append(mapped, screen_plan_service.Step{
Mode: int32(step.Mode),
Text: step.Text,
TimerLabel: step.TimerLabel,
TimerDurationSeconds: step.TimerDurationSeconds,
})
}
return mapped
}
func mapScreenPlan(plan *screen_plan_service.Plan) *proto.ScreenPlan {
if plan == nil {
return nil
}
steps := make([]*proto.ScreenPlanStep, 0, len(plan.Steps))
for _, step := range plan.Steps {
steps = append(steps, &proto.ScreenPlanStep{
Mode: proto.ScreenMode(step.Mode),
Text: step.Text,
TimerLabel: step.TimerLabel,
TimerDurationSeconds: step.TimerDurationSeconds,
})
}
return &proto.ScreenPlan{Steps: steps, CurrentStep: int32(plan.CurrentStep)}
}