diff --git a/BackEnd/src/app.controller.ts b/BackEnd/src/app.controller.ts index d8153f01..07896e40 100755 --- a/BackEnd/src/app.controller.ts +++ b/BackEnd/src/app.controller.ts @@ -1,7 +1,7 @@ import { Controller, Get, Res } from '@nestjs/common'; import { Response } from 'express'; import { join } from 'path'; -import {ApiProperty, ApiTags} from "@nestjs/swagger"; +import { ApiProperty, ApiTags } from '@nestjs/swagger'; @ApiTags('메인 페이지') @Controller() diff --git a/BackEnd/src/app.module.ts b/BackEnd/src/app.module.ts index abc1fa1d..b9d929bd 100755 --- a/BackEnd/src/app.module.ts +++ b/BackEnd/src/app.module.ts @@ -6,9 +6,10 @@ import { LoggerMiddleware } from './middlewares/logger.middleware'; import { AuthModule } from './auth/auth.module'; import { UsersModule } from './users/users.module'; import { ProfilesModule } from './profiles/profiles.module'; -import { LiveModule } from './lives/lives.module'; import { RecordsModule } from './records/records.module'; import { WorkoutsModule } from './workouts/workouts.module'; +import { EventsModule } from './live-workouts/events/events.module'; +import { MatchesModule } from './live-workouts/matches/matches.module'; @Module({ imports: [ @@ -16,9 +17,10 @@ import { WorkoutsModule } from './workouts/workouts.module'; AuthModule, UsersModule, ProfilesModule, - LiveModule, RecordsModule, WorkoutsModule, + MatchesModule, + EventsModule, ], controllers: [AppController], }) diff --git a/BackEnd/src/live-workouts/events/dto/create-event.dto.ts b/BackEnd/src/live-workouts/events/dto/create-event.dto.ts new file mode 100644 index 00000000..f23a4088 --- /dev/null +++ b/BackEnd/src/live-workouts/events/dto/create-event.dto.ts @@ -0,0 +1 @@ +export class CreateEventDto {} diff --git a/BackEnd/src/live-workouts/events/dto/update-event.dto.ts b/BackEnd/src/live-workouts/events/dto/update-event.dto.ts new file mode 100644 index 00000000..704a53a1 --- /dev/null +++ b/BackEnd/src/live-workouts/events/dto/update-event.dto.ts @@ -0,0 +1,6 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateEventDto } from './create-event.dto'; + +export class UpdateEventDto extends PartialType(CreateEventDto) { + id: number; +} diff --git a/BackEnd/src/live-workouts/events/entities/event.entity.ts b/BackEnd/src/live-workouts/events/entities/event.entity.ts new file mode 100644 index 00000000..8c34a9ab --- /dev/null +++ b/BackEnd/src/live-workouts/events/entities/event.entity.ts @@ -0,0 +1 @@ +export class Event {} diff --git a/BackEnd/src/live-workouts/events/events.gateway.spec.ts b/BackEnd/src/live-workouts/events/events.gateway.spec.ts new file mode 100644 index 00000000..c69474c4 --- /dev/null +++ b/BackEnd/src/live-workouts/events/events.gateway.spec.ts @@ -0,0 +1,19 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { EventsGateway } from './events.gateway'; +import { EventsService } from './events.service'; + +describe('EventsGateway', () => { + let gateway: EventsGateway; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [EventsGateway, EventsService], + }).compile(); + + gateway = module.get(EventsGateway); + }); + + it('should be defined', () => { + expect(gateway).toBeDefined(); + }); +}); diff --git a/BackEnd/src/live-workouts/events/events.gateway.ts b/BackEnd/src/live-workouts/events/events.gateway.ts new file mode 100644 index 00000000..07a71939 --- /dev/null +++ b/BackEnd/src/live-workouts/events/events.gateway.ts @@ -0,0 +1,61 @@ +import { + WebSocketGateway, + SubscribeMessage, + MessageBody, + WebSocketServer, + OnGatewayConnection, + OnGatewayDisconnect, +} from '@nestjs/websockets'; +import { Server, WebSocket } from 'ws'; +import { EventsService } from './events.service'; +import { CreateEventDto } from './dto/create-event.dto'; +import { UpdateEventDto } from './dto/update-event.dto'; + +@WebSocketGateway(3003) +export class EventsGateway { + @WebSocketServer() server: Server; + constructor(private readonly eventsService: EventsService) {} + + @SubscribeMessage('events') + onEvent(client: WebSocket, data: any): void { + console.log(`전송받은 데이터: ${data}`); + this.server.clients.forEach((others: WebSocket) => { + if (others.readyState === WebSocket.OPEN) { + others.send(data); + } + }); + } + + handleConnection(client: WebSocket): void { + console.log(`클라이언트 연결`); + } + + handleDisconnect(client: WebSocket): void { + console.log(`클라이언트 연결 종료`); + } + + @SubscribeMessage('createEvent') + create(@MessageBody() createEventDto: CreateEventDto) { + return this.eventsService.create(createEventDto); + } + + @SubscribeMessage('findAllEvents') + findAll() { + return this.eventsService.findAll(); + } + + @SubscribeMessage('findOneEvent') + findOne(@MessageBody() id: number) { + return this.eventsService.findOne(id); + } + + @SubscribeMessage('updateEvent') + update(@MessageBody() updateEventDto: UpdateEventDto) { + return this.eventsService.update(updateEventDto.id, updateEventDto); + } + + @SubscribeMessage('removeEvent') + remove(@MessageBody() id: number) { + return this.eventsService.remove(id); + } +} diff --git a/BackEnd/src/live-workouts/events/events.module.ts b/BackEnd/src/live-workouts/events/events.module.ts new file mode 100644 index 00000000..22ebeacd --- /dev/null +++ b/BackEnd/src/live-workouts/events/events.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; +import { EventsService } from './events.service'; +import { EventsGateway } from './events.gateway'; + +@Module({ + providers: [EventsGateway, EventsService], +}) +export class EventsModule {} diff --git a/BackEnd/src/live-workouts/events/events.service.spec.ts b/BackEnd/src/live-workouts/events/events.service.spec.ts new file mode 100644 index 00000000..f26bdfe3 --- /dev/null +++ b/BackEnd/src/live-workouts/events/events.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { EventsService } from './events.service'; + +describe('EventsService', () => { + let service: EventsService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [EventsService], + }).compile(); + + service = module.get(EventsService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/BackEnd/src/live-workouts/events/events.service.ts b/BackEnd/src/live-workouts/events/events.service.ts new file mode 100644 index 00000000..d6d07acf --- /dev/null +++ b/BackEnd/src/live-workouts/events/events.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateEventDto } from './dto/create-event.dto'; +import { UpdateEventDto } from './dto/update-event.dto'; + +@Injectable() +export class EventsService { + create(createEventDto: CreateEventDto) { + return 'This action adds a new event'; + } + + findAll() { + return `This action returns all events`; + } + + findOne(id: number) { + return `This action returns a #${id} event`; + } + + update(id: number, updateEventDto: UpdateEventDto) { + return `This action updates a #${id} event`; + } + + remove(id: number) { + return `This action removes a #${id} event`; + } +} diff --git a/BackEnd/src/live-workouts/matches/dto/create-match.dto.ts b/BackEnd/src/live-workouts/matches/dto/create-match.dto.ts new file mode 100644 index 00000000..61e4967c --- /dev/null +++ b/BackEnd/src/live-workouts/matches/dto/create-match.dto.ts @@ -0,0 +1 @@ +export class CreateMatchDto {} diff --git a/BackEnd/src/live-workouts/matches/dto/update-match.dto.ts b/BackEnd/src/live-workouts/matches/dto/update-match.dto.ts new file mode 100644 index 00000000..415f9e2c --- /dev/null +++ b/BackEnd/src/live-workouts/matches/dto/update-match.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateMatchDto } from './create-match.dto'; + +export class UpdateMatchDto extends PartialType(CreateMatchDto) {} diff --git a/BackEnd/src/live-workouts/matches/entities/match.entity.ts b/BackEnd/src/live-workouts/matches/entities/match.entity.ts new file mode 100644 index 00000000..553154f2 --- /dev/null +++ b/BackEnd/src/live-workouts/matches/entities/match.entity.ts @@ -0,0 +1 @@ +export class Match {} diff --git a/BackEnd/src/live-workouts/matches/matches.controller.spec.ts b/BackEnd/src/live-workouts/matches/matches.controller.spec.ts new file mode 100644 index 00000000..7ada3479 --- /dev/null +++ b/BackEnd/src/live-workouts/matches/matches.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { MatchesController } from './matches.controller'; +import { MatchesService } from './matches.service'; + +describe('MatchesController', () => { + let controller: MatchesController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [MatchesController], + providers: [MatchesService], + }).compile(); + + controller = module.get(MatchesController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/BackEnd/src/live-workouts/matches/matches.controller.ts b/BackEnd/src/live-workouts/matches/matches.controller.ts new file mode 100644 index 00000000..c1ba732a --- /dev/null +++ b/BackEnd/src/live-workouts/matches/matches.controller.ts @@ -0,0 +1,42 @@ +import { + Controller, + Get, + Post, + Body, + Patch, + Param, + Delete, +} from '@nestjs/common'; +import { MatchesService } from './matches.service'; +import { CreateMatchDto } from './dto/create-match.dto'; +import { UpdateMatchDto } from './dto/update-match.dto'; + +@Controller('matches') +export class MatchesController { + constructor(private readonly matchesService: MatchesService) {} + + @Post() + create(@Body() createMatchDto: CreateMatchDto) { + return this.matchesService.create(createMatchDto); + } + + @Get() + findAll() { + return this.matchesService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.matchesService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateMatchDto: UpdateMatchDto) { + return this.matchesService.update(+id, updateMatchDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.matchesService.remove(+id); + } +} diff --git a/BackEnd/src/live-workouts/matches/matches.module.ts b/BackEnd/src/live-workouts/matches/matches.module.ts new file mode 100644 index 00000000..4c757e79 --- /dev/null +++ b/BackEnd/src/live-workouts/matches/matches.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { MatchesService } from './matches.service'; +import { MatchesController } from './matches.controller'; + +@Module({ + controllers: [MatchesController], + providers: [MatchesService], +}) +export class MatchesModule {} diff --git a/BackEnd/src/live-workouts/matches/matches.service.spec.ts b/BackEnd/src/live-workouts/matches/matches.service.spec.ts new file mode 100644 index 00000000..f78f3cae --- /dev/null +++ b/BackEnd/src/live-workouts/matches/matches.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { MatchesService } from './matches.service'; + +describe('MatchesService', () => { + let service: MatchesService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [MatchesService], + }).compile(); + + service = module.get(MatchesService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/BackEnd/src/live-workouts/matches/matches.service.ts b/BackEnd/src/live-workouts/matches/matches.service.ts new file mode 100644 index 00000000..4310be31 --- /dev/null +++ b/BackEnd/src/live-workouts/matches/matches.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateMatchDto } from './dto/create-match.dto'; +import { UpdateMatchDto } from './dto/update-match.dto'; + +@Injectable() +export class MatchesService { + create(createMatchDto: CreateMatchDto) { + return 'This action adds a new match'; + } + + findAll() { + return `This action returns all matches`; + } + + findOne(id: number) { + return `This action returns a #${id} match`; + } + + update(id: number, updateMatchDto: UpdateMatchDto) { + return `This action updates a #${id} match`; + } + + remove(id: number) { + return `This action removes a #${id} match`; + } +} diff --git a/BackEnd/src/lives/lives.gateway.ts b/BackEnd/src/lives/lives.gateway.ts deleted file mode 100644 index 65ae1fdb..00000000 --- a/BackEnd/src/lives/lives.gateway.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - SubscribeMessage, - WebSocketGateway, - WebSocketServer, - OnGatewayConnection, - OnGatewayDisconnect, -} from '@nestjs/websockets'; -import * as WebSocket from 'ws'; - -@WebSocketGateway(3003) -export class LiveGateway implements OnGatewayConnection, OnGatewayDisconnect { - @WebSocketServer() server: WebSocket.Server; - - @SubscribeMessage('events') - onEvent(client: WebSocket, data: any): void { - console.log(`전송받은 데이터: ${data}`); - this.server.clients.forEach((others: WebSocket) => { - if (others.readyState === WebSocket.OPEN) { - others.send(data); - } - }); - } - - handleConnection(client: WebSocket): void { - console.log(`클라이언트 연결`); - } - - handleDisconnect(client: WebSocket): void { - console.log(`클라이언트 연결 종료`); - } -} diff --git a/BackEnd/src/lives/lives.module.ts b/BackEnd/src/lives/lives.module.ts deleted file mode 100644 index 76e326d5..00000000 --- a/BackEnd/src/lives/lives.module.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Module } from '@nestjs/common'; -import { LiveGateway } from './lives.gateway'; - -@Module({ - providers: [LiveGateway], -}) -export class LiveModule {} diff --git a/BackEnd/src/records/entities/records.entity.ts b/BackEnd/src/records/entities/records.entity.ts index 7717513d..84f6664a 100644 --- a/BackEnd/src/records/entities/records.entity.ts +++ b/BackEnd/src/records/entities/records.entity.ts @@ -4,13 +4,14 @@ import { Column, CreateDateColumn, ManyToOne, - OneToOne, JoinColumn, + OneToOne, + JoinColumn, } from 'typeorm'; import { Post } from '../../posts/entities/posts.entity'; import { Profile } from '../../profiles/entities/profiles.entity'; import { IsNumber, IsString } from 'class-validator'; import { ApiProperty } from '@nestjs/swagger'; -import {Workout} from "../../workouts/entities/workout.entity"; +import { Workout } from '../../workouts/entities/workout.entity'; @Entity() export class Record { @@ -83,6 +84,6 @@ export class Record { @ApiProperty({ example: '달리기', description: '선택한 운동 종료' }) @ManyToOne(() => Workout, (workout) => workout.records) - @JoinColumn({ name: "id" }) + @JoinColumn({ name: 'id' }) workout: Workout; } diff --git a/BackEnd/src/records/records.controller.ts b/BackEnd/src/records/records.controller.ts index b9c43b92..bc8c93e1 100644 --- a/BackEnd/src/records/records.controller.ts +++ b/BackEnd/src/records/records.controller.ts @@ -1,4 +1,12 @@ -import {Body, Controller, Get, Param, Post, Query, UseGuards} from '@nestjs/common'; +import { + Body, + Controller, + Get, + Param, + Post, + Query, + UseGuards, +} from '@nestjs/common'; import { RecordsService } from './records.service'; import { CreateExerciseLogDto } from './dto/create-exerciseLog.dto'; import { AccessTokenGuard } from 'src/auth/guard/bearerToken.guard'; @@ -41,10 +49,10 @@ export class RecordsController { @ApiCreatedResponse({ type: GetUsersRecordsResDto }) @UseGuards(AccessTokenGuard) async getUserRecords( - @ProfileDeco() profile: Profile, - @Query('year') year: number, - @Query('month') month: number, - @Query('day') day: number + @ProfileDeco() profile: Profile, + @Query('year') year: number, + @Query('month') month: number, + @Query('day') day: number, ) { return this.recordsService.findByDate(profile.id, year, month, day); } diff --git a/BackEnd/src/records/records.module.ts b/BackEnd/src/records/records.module.ts index 5582a89d..8a71ae74 100644 --- a/BackEnd/src/records/records.module.ts +++ b/BackEnd/src/records/records.module.ts @@ -7,11 +7,7 @@ import { TypeOrmModule } from '@nestjs/typeorm'; import { Record } from './entities/records.entity'; @Module({ - imports: [ - TypeOrmModule.forFeature([Record]), - AuthModule, - ProfilesModule, - ], + imports: [TypeOrmModule.forFeature([Record]), AuthModule, ProfilesModule], controllers: [RecordsController], providers: [RecordsService], }) diff --git a/BackEnd/src/records/records.service.ts b/BackEnd/src/records/records.service.ts index a8f62700..ffe0c308 100644 --- a/BackEnd/src/records/records.service.ts +++ b/BackEnd/src/records/records.service.ts @@ -13,10 +13,7 @@ export class RecordsService { private readonly recordsRepository: Repository, ) {} - async createWorkOutLog( - exerciseLog: CreateExerciseLogDto, - profile: Profile, - ) { + async createWorkOutLog(exerciseLog: CreateExerciseLogDto, profile: Profile) { return await this.recordsRepository.save({ ...exerciseLog, profile, @@ -24,11 +21,15 @@ export class RecordsService { } findByDate(profileId: number, year: number, month: number, day: number) { - return this.recordsRepository.createQueryBuilder("record") - .leftJoinAndSelect("record.workout", "workout") - .where("record.profileId = :profileId", { profileId }) - .andWhere(`YEAR(record.createdAt) = :year AND MONTH(record.createdAt) = :month AND DAY(record.createdAt) = :day`, { year, month, day }) - .getMany(); + return this.recordsRepository + .createQueryBuilder('record') + .leftJoinAndSelect('record.workout', 'workout') + .where('record.profileId = :profileId', { profileId }) + .andWhere( + `YEAR(record.createdAt) = :year AND MONTH(record.createdAt) = :month AND DAY(record.createdAt) = :day`, + { year, month, day }, + ) + .getMany(); } async findById(recordId: number) { diff --git a/BackEnd/src/users/users.service.ts b/BackEnd/src/users/users.service.ts index 0345ed63..09978eed 100644 --- a/BackEnd/src/users/users.service.ts +++ b/BackEnd/src/users/users.service.ts @@ -28,9 +28,7 @@ export class UsersService { return newUesr; } - async getUserByUserIdAndProvider( - user: Pick, - ) { + async getUserByUserIdAndProvider(user: Pick) { return this.usersRepository.findOne({ where: { userId: user.userId, diff --git a/BackEnd/src/workouts/dto/workout-response.dto.ts b/BackEnd/src/workouts/dto/workout-response.dto.ts index da8fca0d..64947b7c 100644 --- a/BackEnd/src/workouts/dto/workout-response.dto.ts +++ b/BackEnd/src/workouts/dto/workout-response.dto.ts @@ -1,8 +1,8 @@ import { ApiProperty, PickType } from '@nestjs/swagger'; -import {SuccessResDto} from "../../common/dto/SuccessRes.dto"; -import {Workout} from "../entities/workout.entity"; +import { SuccessResDto } from '../../common/dto/SuccessRes.dto'; +import { Workout } from '../entities/workout.entity'; export class WorkoutResDto extends SuccessResDto { - @ApiProperty({ type: () => PickType(Workout, ['name']) }) - data: Pick; + @ApiProperty({ type: () => PickType(Workout, ['name']) }) + data: Pick; } diff --git a/BackEnd/src/workouts/entities/workout.entity.ts b/BackEnd/src/workouts/entities/workout.entity.ts index 18e845de..3a32e267 100644 --- a/BackEnd/src/workouts/entities/workout.entity.ts +++ b/BackEnd/src/workouts/entities/workout.entity.ts @@ -1,26 +1,25 @@ -import {ApiProperty} from "@nestjs/swagger"; -import {Column, Entity, OneToMany, PrimaryGeneratedColumn} from "typeorm"; -import {Record} from "../../records/entities/records.entity"; -import {IsString} from "class-validator"; +import { ApiProperty } from '@nestjs/swagger'; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; +import { Record } from '../../records/entities/records.entity'; +import { IsString } from 'class-validator'; @Entity() export class Workout { + @ApiProperty({ + example: 1, + description: '운동 종류 ID', + }) + @PrimaryGeneratedColumn() + id: number; - @ApiProperty({ - example: 1, - description: '운동 종류 ID', - }) - @PrimaryGeneratedColumn() - id: number; + @ApiProperty({ + example: '달리기', + description: '운동 종류 이름', + }) + @Column() + @IsString() + name: string; - @ApiProperty({ - example: '달리기', - description: '운동 종류 이름', - }) - @Column() - @IsString() - name: string; - - @OneToMany(() => Record, (record) => record.workout) - records: Record[]; + @OneToMany(() => Record, (record) => record.workout) + records: Record[]; } diff --git a/BackEnd/src/workouts/workouts.controller.ts b/BackEnd/src/workouts/workouts.controller.ts index a619e1f3..401253fa 100644 --- a/BackEnd/src/workouts/workouts.controller.ts +++ b/BackEnd/src/workouts/workouts.controller.ts @@ -1,15 +1,15 @@ -import {Controller, Get, UseGuards} from '@nestjs/common'; +import { Controller, Get, UseGuards } from '@nestjs/common'; import { WorkoutsService } from './workouts.service'; -import {ApiOperation, ApiResponse, ApiTags} from "@nestjs/swagger"; -import {WorkoutResDto} from "./dto/workout-response.dto"; -import {AccessTokenGuard} from "../auth/guard/bearerToken.guard"; +import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; +import { WorkoutResDto } from './dto/workout-response.dto'; +import { AccessTokenGuard } from '../auth/guard/bearerToken.guard'; @ApiTags('운동 종류 API') @Controller('api/v1/workouts') export class WorkoutsController { constructor(private readonly workoutsService: WorkoutsService) {} @Get() - @ApiOperation({summary: '모든 운동 종류 조회'}) + @ApiOperation({ summary: '모든 운동 종류 조회' }) @ApiResponse({ status: 200, description: '성공', diff --git a/BackEnd/src/workouts/workouts.module.ts b/BackEnd/src/workouts/workouts.module.ts index ed84353b..44c55726 100644 --- a/BackEnd/src/workouts/workouts.module.ts +++ b/BackEnd/src/workouts/workouts.module.ts @@ -1,8 +1,8 @@ import { Module } from '@nestjs/common'; import { WorkoutsService } from './workouts.service'; import { WorkoutsController } from './workouts.controller'; -import {TypeOrmModule} from "@nestjs/typeorm"; -import {Workout} from "./entities/workout.entity"; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { Workout } from './entities/workout.entity'; @Module({ imports: [TypeOrmModule.forFeature([Workout])], diff --git a/BackEnd/src/workouts/workouts.service.ts b/BackEnd/src/workouts/workouts.service.ts index cb4204ca..652434c6 100644 --- a/BackEnd/src/workouts/workouts.service.ts +++ b/BackEnd/src/workouts/workouts.service.ts @@ -1,14 +1,13 @@ import { Injectable } from '@nestjs/common'; -import {InjectRepository} from "@nestjs/typeorm"; -import {Repository} from "typeorm"; -import {Workout} from "./entities/workout.entity"; +import { InjectRepository } from '@nestjs/typeorm'; +import { Repository } from 'typeorm'; +import { Workout } from './entities/workout.entity'; @Injectable() export class WorkoutsService { - constructor( - @InjectRepository(Workout) - private readonly workoutModelRepository: Repository, + @InjectRepository(Workout) + private readonly workoutModelRepository: Repository, ) {} findAllWorkouts() { return this.workoutModelRepository.find({