-
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.
- Loading branch information
1 parent
074ab83
commit ba4b385
Showing
11 changed files
with
258 additions
and
92 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
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { DataSource } from 'typeorm'; | ||
|
||
export const LetterDataSource =(param : { | ||
type : any, | ||
host : string, | ||
port : number, | ||
username : string, | ||
password : string, | ||
database : string, | ||
synchronize : boolean | ||
}) => new DataSource({ | ||
...param, | ||
entities: [__dirname + '/../entity/*.{ts,js}'], | ||
migrations: [__dirname + '/../migration/*.{ts,js}'], | ||
}); | ||
export const LetterDataSource = (param: { | ||
type: any; | ||
host: string; | ||
port: number; | ||
username: string; | ||
password: string; | ||
database: string; | ||
synchronize: boolean; | ||
}) => | ||
new DataSource({ | ||
...param, | ||
entities: [__dirname + '/../entity/*.{ts,js}'], | ||
migrations: [__dirname + '/../migration/*.{ts,js}'], | ||
}); |
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 |
---|---|---|
@@ -1,20 +1,34 @@ | ||
import { LetterCategory, LetterCategoryCode } from "@util/category"; | ||
import { Transform } from "class-transformer"; | ||
import { IsDefined, IsIn, IsOptional, IsString, MaxLength } from "class-validator"; | ||
import { LetterCategoryCode } from '@util/category'; | ||
import { | ||
IsBoolean, | ||
IsDefined, | ||
IsIn, | ||
IsOptional, | ||
IsString, | ||
MaxLength, | ||
} from 'class-validator'; | ||
|
||
export class AddLetterRequest { | ||
@IsDefined() | ||
@IsString() | ||
@IsIn(Object.values(LetterCategoryCode)) | ||
category : LetterCategoryCode | ||
@IsDefined() | ||
@IsString() | ||
@IsIn(Object.values(LetterCategoryCode)) | ||
category: LetterCategoryCode; | ||
|
||
@IsDefined() | ||
@IsString() | ||
@MaxLength(20) | ||
title : string | ||
@IsDefined() | ||
@IsString() | ||
@MaxLength(20) | ||
title: string; | ||
|
||
@IsOptional() | ||
@IsString() | ||
@MaxLength(255) | ||
body : string; | ||
} | ||
@IsOptional() | ||
@IsString() | ||
@MaxLength(255) | ||
body?: string; | ||
|
||
@IsOptional() | ||
@IsBoolean() | ||
commentYn?: boolean; | ||
|
||
@IsOptional() | ||
@IsBoolean() | ||
attendYn?: boolean; | ||
} |
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,9 @@ | ||
import { Transform } from 'class-transformer'; | ||
import { IsNumber, Max } from 'class-validator'; | ||
|
||
export class PrepareRequest { | ||
@Transform(({ value }) => Number(value)) | ||
@IsNumber() | ||
@Max(10) | ||
componentCount: number; | ||
} |
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,46 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { | ||
IsArray, | ||
IsNotEmpty, | ||
IsNumber, | ||
IsOptional, | ||
IsUrl, | ||
} from 'class-validator'; | ||
|
||
export class PrepareResponse { | ||
@ApiProperty({ | ||
description: '썸네일 업로드 권한이 열려있는 url', | ||
example: | ||
'https://s3.ap-northeast-1.wasabisys.com/bucket/file.txt?AWSAccessKeyId=...', | ||
}) | ||
@IsNotEmpty() | ||
@IsUrl() | ||
thumbnailUrl: string; | ||
|
||
@ApiProperty({ | ||
description: '배경 업로드 권한이 열려있는 url', | ||
example: | ||
'https://s3.ap-northeast-1.wasabisys.com/bucket/file.txt?AWSAccessKeyId=...', | ||
}) | ||
@IsNotEmpty() | ||
@IsUrl() | ||
backgroundUrl: string; | ||
|
||
@ApiProperty({ | ||
description: '아이템 업로드 권한이 열려있는 url', | ||
example: | ||
'[https://s3.ap-northeast-1.wasabisys.com/bucket/file.txt?AWSAccessKeyId=...]', | ||
}) | ||
@IsOptional() | ||
@IsArray() | ||
@IsUrl({},{each:true}) | ||
componentUrls: string[]; | ||
|
||
@ApiProperty({ | ||
description: 'url 만료 기간', | ||
example: 60, | ||
}) | ||
@IsNotEmpty() | ||
@IsNumber() | ||
expires: number; | ||
} |
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
Oops, something went wrong.