-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refacotr: dto 리팩토링 * chore: format 적용
- Loading branch information
Showing
7 changed files
with
97 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class SuccessResDto { | ||
@ApiProperty({ | ||
example: null, | ||
description: '에러 코드 성공시 null', | ||
nullable: true, | ||
}) | ||
code: number | null; | ||
|
||
@ApiProperty({ | ||
example: null, | ||
description: '에러 코드 성공시 null', | ||
nullable: true, | ||
}) | ||
errorMessage: string | null; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ApiProperty, PickType } from '@nestjs/swagger'; | ||
import { SuccessResDto } from 'src/common/dto/SuccessRes.dto'; | ||
import { RecordModel } from '../entities/records.entity'; | ||
|
||
class GetRecord extends PickType(RecordModel, [ | ||
'id', | ||
'workout', | ||
'profile', | ||
'workoutTime', | ||
'distance', | ||
'calorie', | ||
'avgHeartRate', | ||
'minHeartRate', | ||
'maxHeartRate', | ||
'createdAt', | ||
]) {} | ||
|
||
export class CreateRecordResDto extends SuccessResDto { | ||
@ApiProperty({ example: 1, description: '운동 기록 레코드 ID' }) | ||
recordId: number; | ||
} | ||
|
||
export class GetUsersRecordsResDto extends SuccessResDto { | ||
@ApiProperty({ type: () => [GetRecord] }) | ||
data: GetRecord[]; | ||
} | ||
|
||
export class GetRecordResDto extends SuccessResDto { | ||
@ApiProperty({ type: () => GetRecord }) | ||
data: GetRecord; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters