From b83c442f0c7d69f3c596de6ab5e4020ce017e4a3 Mon Sep 17 00:00:00 2001 From: furu04 Date: Tue, 17 Jun 2025 05:41:45 +0900 Subject: [PATCH 1/4] =?UTF-8?q?import=E6=96=87=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/workout.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/workout.py b/app/models/workout.py index 8768e87..887daae 100644 --- a/app/models/workout.py +++ b/app/models/workout.py @@ -1,3 +1,6 @@ +from . import db +from datetime import datetime + class User(db.Model): __tablename__ = 'users' From 8baa5ce2f7bc2a5534774a271bb785322e8f5eb3 Mon Sep 17 00:00:00 2001 From: furu04 Date: Tue, 17 Jun 2025 05:51:33 +0900 Subject: [PATCH 2/4] =?UTF-8?q?services/=5F=5Finit=5F=5F.py=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/__init__.py b/app/services/__init__.py index e69de29..72bc00e 100644 --- a/app/services/__init__.py +++ b/app/services/__init__.py @@ -0,0 +1,2 @@ +from app.repositories.workout_repository import WorkoutRepository +from app.models.workout import Workout From 04b59d5b80583d7ffc2b654615b297294032f66b Mon Sep 17 00:00:00 2001 From: furu04 Date: Tue, 17 Jun 2025 11:02:16 +0900 Subject: [PATCH 3/4] =?UTF-8?q?tmp=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80?= =?UTF-8?q?=E3=82=82Git=E3=81=AE=E7=AE=A1=E7=90=86=E3=81=AE=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E5=A4=96=E3=81=A8=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4d186f6..688e039 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ develop.md -.env \ No newline at end of file +.env +/tmp \ No newline at end of file From 54d5164b730ba1d9819001c35e9a7ea713db746d Mon Sep 17 00:00:00 2001 From: furu04 Date: Tue, 17 Jun 2025 11:03:25 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E3=83=93=E3=82=B8=E3=83=8D=E3=82=B9?= =?UTF-8?q?=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/workout_service.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/services/workout_service.py b/app/services/workout_service.py index e69de29..226e50d 100644 --- a/app/services/workout_service.py +++ b/app/services/workout_service.py @@ -0,0 +1,15 @@ +from app.repositories.workout_repository import WorkoutRepository +from app.models.workout import Workout + +class WorkoutService: + def __init__(self): + self.workout_repository = WorkoutRepository() + + def get_all_workouts(self): + return self.workout_repository.get_all() + + def get_workout_by_id(self, workout_id): + workout = self.workout_repository.get_by_id(workout_id) + if not workout: + return None + return workout \ No newline at end of file