V2
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user