-
Notifications
You must be signed in to change notification settings - Fork 0
feat(rest): file dto type #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| import { ApiProperty } from '@nestjs/swagger'; | ||
|
|
||
| export class DeleteFileEntity { | ||
| @ApiProperty({ type: String, example: 'path/to/file.jpg' }) | ||
| path: string; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,18 @@ | ||
| import { ApiProperty } from '@nestjs/swagger'; | ||
|
|
||
| export class DetailFileEntity { | ||
| @ApiProperty({ type: String, example: 'images' }) | ||
| path: string; | ||
| /** 재귀적으로 탐색한 파일 수 */ | ||
|
|
||
| @ApiProperty({ type: Number, example: 42 }) | ||
| fileCount: number; | ||
| /** 재귀적으로 탐색한 하위 디렉토리 수 (루트 제외) */ | ||
|
|
||
| @ApiProperty({ type: Number, example: 5 }) | ||
| directoryCount: number; | ||
|
Comment on lines
+10
to
11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| /** 자식이 없는 leaf 노드 수 (파일 + 빈 디렉토리) */ | ||
|
|
||
| @ApiProperty({ type: Number, example: 44 }) | ||
| leafCount: number; | ||
|
Comment on lines
+13
to
14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| /** 모든 파일 크기의 합계 (byte) */ | ||
|
|
||
| @ApiProperty({ type: Number, example: 10485760 }) | ||
| totalSize: number; | ||
|
Comment on lines
+16
to
17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,20 +1,51 @@ | ||||||||||
| import { ApiProperty } from '@nestjs/swagger'; | ||||||||||
|
|
||||||||||
| export class ReadFileEntity { | ||||||||||
| @ApiProperty({ type: String, example: 'example.jpg' }) | ||||||||||
| name: string; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: String, example: 'test' }) | ||||||||||
| parentPath: string; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: String, example: 'test/example.jpg' }) | ||||||||||
| path: string; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: true }) | ||||||||||
| isFile: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: false }) | ||||||||||
| isDirectory: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: false }) | ||||||||||
| isBlockDevice: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: false }) | ||||||||||
| isCharacterDevice: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: false }) | ||||||||||
| isSymbolicLink: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: false }) | ||||||||||
| isFIFO: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Boolean, example: false }) | ||||||||||
| isSocket: boolean; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Number, example: 1741684171704 }) | ||||||||||
| birthtimeMs: number; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Number, example: 1741684171704 }) | ||||||||||
| ctimeMs: number; | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Number, example: 1741684171704 }) | ||||||||||
| mtimeMs: number; | ||||||||||
| /** byte */ | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Number, nullable: true, example: 123 }) | ||||||||||
| size: number | null; | ||||||||||
|
Comment on lines
+43
to
44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 기존에 존재하던 JSDoc 설명이 삭제되었습니다. Swagger UI에서도 해당 설명이 노출될 수 있도록
Suggested change
|
||||||||||
|
|
||||||||||
| @ApiProperty({ type: Number, example: 33188 }) | ||||||||||
| mode: number; | ||||||||||
| /** 디렉토리인 경우 직속 자식 수, 파일인 경우 null */ | ||||||||||
|
|
||||||||||
| @ApiProperty({ type: Number, nullable: true, example: 3 }) | ||||||||||
| childCount: number | null; | ||||||||||
|
Comment on lines
+49
to
50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 기존에 존재하던 JSDoc 설명이 삭제되었습니다. Swagger UI에서도 해당 설명이 노출될 수 있도록
Suggested change
|
||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| import { ApiProperty } from '@nestjs/swagger'; | ||
|
|
||
| export class UpdateFileEntity { | ||
| @ApiProperty({ type: String, example: 'path/new' }) | ||
| path: string; | ||
|
|
||
| @ApiProperty({ type: String, example: 'new-example.jpg' }) | ||
| filename: string; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| import { ApiProperty } from '@nestjs/swagger'; | ||
|
|
||
| export class UploadFileEntity { | ||
| @ApiProperty({ type: String, example: './test/uploads/path/to/example.jpg' }) | ||
| filePath: string; | ||
|
|
||
| @ApiProperty({ type: String, example: 'https://static.zerovoyage.com/path/to/example.jpg' }) | ||
| publicUrl: string; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존에 존재하던 JSDoc 설명이 삭제되었습니다. Swagger UI에서도 해당 설명이 노출될 수 있도록
@ApiProperty의description속성을 사용하는 것이 좋습니다.