Skip to content

Commit

Permalink
fix: RESTful 하지 않은 endpoint deprecated 처리 및 RESTful 한 경로 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Minseo Park committed Sep 22, 2024
1 parent d5e80b4 commit 4af1471
Showing 1 changed file with 183 additions and 1 deletion.
184 changes: 183 additions & 1 deletion backend/src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,52 @@ export class UsersController {
constructor() {}

@Get('search')
@ApiOperation({
summary: 'Search users',
description: '검색할 유저의 nickname or email',
deprecated: true,
tags: ['users'],
})
@ApiResponse({
status: 200,
description: '검색 결과를 반환한다.',
type: GetUsersRequestDto,
})
@ApiResponse({
status: 400,
description: '입력된 인자가 부적절합니다',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
errorCode: {
type: 'number',
description: '에러코드',
example: 200,
},
},
},
},
},
})
@ApiResponse({
status: 500,
description: '',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
errorCode: { type: 'number', description: '에러코드', example: 1 },
},
},
},
},
})
async getUsersDeprecated(@Query() getUsersRequestDto: GetUsersRequestDto) {}

Check failure on line 69 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (20)

Delete `··`

Check failure on line 69 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (22)

Delete `··`
@Get()
@ApiOperation({
summary: 'Search users',
description: '검색할 유저의 nickname or email',
Expand Down Expand Up @@ -67,6 +113,37 @@ export class UsersController {
async getUsers(@Query() getUsersRequestDto: GetUsersRequestDto) {}

@Post('create')
@ApiOperation({
summary: 'Create users',
description: '유저를 생성한다.',
deprecated: true,
tags: ['users'],
})
@ApiResponse({
status: 200,
description: '유저 생성 성공!',
})
@ApiResponse({
status: 400,
description: 'Client Error Bad Request',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
errorCode: {
type: 'number',
description: '에러코드',
example: 200,
},
},
},
},
},
})
async createUsersDeprecated(@Body() createUsersRequestDto: CreateUsersRequestDto) {}

Check failure on line 144 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (20)

Replace `@Body()·createUsersRequestDto:·CreateUsersRequestDto` with `⏎····@Body()·createUsersRequestDto:·CreateUsersRequestDto,⏎··`

Check failure on line 144 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (22)

Replace `@Body()·createUsersRequestDto:·CreateUsersRequestDto` with `⏎····@Body()·createUsersRequestDto:·CreateUsersRequestDto,⏎··`

Check failure on line 145 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (20)

Delete `··`

Check failure on line 145 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (22)

Delete `··`
@Post()
@ApiOperation({
summary: 'Create users',
description: '유저를 생성한다.',
Expand Down Expand Up @@ -97,6 +174,22 @@ export class UsersController {
async createUsers(@Body() createUsersRequestDto: CreateUsersRequestDto) {}

@Post('update/:id')
@ApiOperation({
description: '유저 정보를 변경한다.',
deprecated: true,
tags: ['users'],
})
@ApiResponse({
status: 200,
description: '유저 정보 수정 성공!',
type: UpdateUsersResponseDto,
})
async updateUsersDeprecated(
@Param('id') id: string,
@Body() updateUsersRequestDto: UpdateUsersRequestDto,
) {}

Check failure on line 191 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (20)

Delete `··`

Check failure on line 191 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (22)

Delete `··`
@Post(':id')
@ApiOperation({
description: '유저 정보를 변경한다.',
tags: ['users'],
Expand All @@ -112,6 +205,95 @@ export class UsersController {
) {}

@Patch('myupdate')
@ApiOperation({
description: '내 유저정보를 변경한다.',
deprecated: true,
tags: ['users'],
})
@ApiResponse({
status: 200,
description: '유저 정보 변경 성공!',
})
@ApiResponse({
status: 400,
description: '들어온 인자가 없습니다..',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
errorCode: {
type: 'number',
description: '에러코드',
example: 200,
},
},
},
},
},
})
@ApiResponse({
status: 403,
description: '수정하려는 계정이 본인의 계정이 아닙니다',
content: {
'application/json': {
schema: {
type: 'object',
description: 'error description',
properties: {
errorCode: {
type: 'number',
description: '에러코드',
example: 206,
},
},
},
},
},
})
@ApiResponse({
status: 409,
description: '수정하려는 값이 중복됩니다',
content: {
'application/json': {
schema: {
type: 'object',
description: '203, 204 에러',
properties: {
errorCode: {
type: 'number',
description: '에러코드',
example: 204,
},
},
},
},
},
})
@ApiResponse({
status: 500,
description: 'Server Error',
content: {
'application/json': {
schema: {
type: 'object',
description: 'error description',
properties: {
errorCode: {
type: 'number',
description: '에러코드',
example: 1,
},
},
},
},
},
})
async myUpdateUsersDeprecated(
@Body() myUpddateUsersRequestDto: MyUpddateUsersRequestDto,
) {}

Check failure on line 295 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (20)

Delete `··`

Check failure on line 295 in backend/src/users/users.controller.ts

View workflow job for this annotation

GitHub Actions / build (22)

Delete `··`
@Patch('/me')
@ApiOperation({
description: '내 유저정보를 변경한다.',
tags: ['users'],
Expand Down Expand Up @@ -199,7 +381,7 @@ export class UsersController {
@Body() myUpddateUsersRequestDto: MyUpddateUsersRequestDto,
) {}

@Get('EasterEgg')
@Get('EasterEgg') // suggesting to change this to 'version'
@ApiOperation({
description: '집현전 개발 버전을 확인합니다.',
tags: ['users'],
Expand Down

0 comments on commit 4af1471

Please sign in to comment.