-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from asn6878/feat/rss-get-api
✨ feat: RSS 전체 조회 API 구현
- Loading branch information
Showing
4 changed files
with
91 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,61 +2,61 @@ import { ApiProperty } from '@nestjs/swagger'; | |
import { IsEmail, IsNotEmpty, IsString, IsUrl, Length } from 'class-validator'; | ||
|
||
export class RssRegisterDto { | ||
@ApiProperty({ | ||
example: 'seok3765.log', | ||
description: '블로그 이름을 입력해주세요.', | ||
}) | ||
@IsString({ | ||
message: '문자열로 입력해주세요.', | ||
}) | ||
@IsNotEmpty({ | ||
message: '블로그 이름이 없습니다.', | ||
}) | ||
blog: string; | ||
@ApiProperty({ | ||
example: 'seok3765.log', | ||
description: '블로그 이름을 입력해주세요.', | ||
}) | ||
@IsString({ | ||
message: '문자열로 입력해주세요.', | ||
}) | ||
@IsNotEmpty({ | ||
message: '블로그 이름이 없습니다.', | ||
}) | ||
blog: string; | ||
|
||
@ApiProperty({ | ||
example: 'J235_조민석', | ||
description: '실명을 입력해주세요.', | ||
}) | ||
@Length(2, 50, { message: '이름 길이가 올바르지 않습니다.' }) | ||
@IsString({ | ||
message: '문자열로 입력해주세요.', | ||
}) | ||
@IsNotEmpty({ | ||
message: '실명이 없습니다.', | ||
}) | ||
name: string; | ||
@ApiProperty({ | ||
example: 'J235_조민석', | ||
description: '실명을 입력해주세요.', | ||
}) | ||
@Length(2, 50, { message: '이름 길이가 올바르지 않습니다.' }) | ||
@IsString({ | ||
message: '문자열로 입력해주세요.', | ||
}) | ||
@IsNotEmpty({ | ||
message: '실명이 없습니다.', | ||
}) | ||
name: string; | ||
|
||
@ApiProperty({ | ||
example: '[email protected]', | ||
description: '이메일을 입력해주세요.', | ||
}) | ||
@IsEmail( | ||
{}, | ||
{ | ||
message: '이메일 주소 형식에 맞춰서 작성해주세요.', | ||
}, | ||
) | ||
@IsNotEmpty({ | ||
message: '이메일이 없습니다.', | ||
}) | ||
email: string; | ||
@ApiProperty({ | ||
example: '[email protected]', | ||
description: '이메일을 입력해주세요.', | ||
}) | ||
@IsEmail( | ||
{}, | ||
{ | ||
message: '이메일 주소 형식에 맞춰서 작성해주세요.', | ||
}, | ||
) | ||
@IsNotEmpty({ | ||
message: '이메일이 없습니다.', | ||
}) | ||
email: string; | ||
|
||
@ApiProperty({ | ||
example: 'https://v2.velog.io/rss/@seok3765', | ||
description: 'RSS 주소를 입력해주세요.', | ||
}) | ||
@IsUrl( | ||
{ | ||
require_protocol: true, | ||
protocols: ['http', 'https'], | ||
}, | ||
{ | ||
message: 'http, https 프로토콜과 URL 형식을 맞춰주세요.', | ||
}, | ||
) | ||
@IsNotEmpty({ | ||
message: 'RSS URL이 없습니다.', | ||
}) | ||
rssURL: string; | ||
@ApiProperty({ | ||
example: 'https://v2.velog.io/rss/@seok3765', | ||
description: 'RSS 주소를 입력해주세요.', | ||
}) | ||
@IsUrl( | ||
{ | ||
require_protocol: true, | ||
protocols: ['http', 'https'], | ||
}, | ||
{ | ||
message: 'http, https 프로토콜과 URL 형식을 맞춰주세요.', | ||
}, | ||
) | ||
@IsNotEmpty({ | ||
message: 'RSS URL이 없습니다.', | ||
}) | ||
rssURL: string; | ||
} |
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 |
---|---|---|
|
@@ -37,3 +37,23 @@ export function ApiPostRegisterRss() { | |
}), | ||
); | ||
} | ||
|
||
export function ApiGetRss() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: 'RSS 전체 조회 API', | ||
}), | ||
ApiCreatedResponse({ | ||
description: 'OK', | ||
schema: { | ||
example: { | ||
id: 1, | ||
name: '안성윤', | ||
userName: '성윤', | ||
email: '[email protected]', | ||
rssURL: 'url', | ||
}, | ||
}, | ||
}), | ||
); | ||
} |
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