This commit is contained in:
Martin Pander
2023-12-09 19:34:45 +01:00
parent 32346e0aa9
commit 8addda35ea
144 changed files with 7247 additions and 3268 deletions

View File

@ -45,8 +45,8 @@ func (s *PlanApiService) GetPlanDayForDate(ctx context.Context, date string) (da
}
dbEntry, _ := s.ds.GetPlanDayForDate(d)
planDay := s.mapper.PlanDayDsToApi(dbEntry)
return dashapi.Response(200, planDay), nil
plan := s.mapper.PlanDayDsToApi(dbEntry)
return dashapi.Response(200, plan), nil
}
// GetPlanMonthForDate -
@ -62,13 +62,14 @@ func (s *PlanApiService) GetPlanMonthForDate(ctx context.Context, date string) (
// GetPlanWeekForDate -
func (s *PlanApiService) GetPlanWeekForDate(ctx context.Context, date string) (dashapi.ImplResponse, error) {
// TODO - update GetPlanWeekForDate with the required logic for this service method.
// Add api_plan_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
d, err := s.mapper.StringToDate(date)
if err != nil {
log.Fatal(err)
}
//TODO: Uncomment the next line to return response Response(200, PlanWeek{}) or use other options such as http.Ok ...
//return Response(200, PlanWeek{}), nil
return dashapi.Response(http.StatusNotImplemented, nil), errors.New("GetPlanWeekForDate method not implemented")
dbEntry, _ := s.ds.GetPlanWeekForDate(d)
plan := s.mapper.PlanWeekDsToApi(dbEntry)
return dashapi.Response(200, plan), nil
}
// SavePlanForDay -
@ -92,11 +93,8 @@ func (s *PlanApiService) SavePlanForMonth(ctx context.Context, planMonth dashapi
// SavePlanForWeek -
func (s *PlanApiService) SavePlanForWeek(ctx context.Context, planWeek dashapi.PlanWeek) (dashapi.ImplResponse, error) {
// TODO - update SavePlanForWeek with the required logic for this service method.
// Add api_plan_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation.
plan := s.mapper.PlanWeekApiToDs(planWeek)
s.ds.WritePlanWeek(plan)
//TODO: Uncomment the next line to return response Response(200, {}) or use other options such as http.Ok ...
//return Response(200, nil),nil
return dashapi.Response(http.StatusNotImplemented, nil), errors.New("SavePlanForWeek method not implemented")
return dashapi.Response(200, nil), nil
}