-
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 #269 from boostcampwm-2024/refactor/admin-statistic
♻️ refactor: admin, statistic 리팩토링
- Loading branch information
Showing
15 changed files
with
263 additions
and
81 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { | ||
ApiBadRequestResponse, | ||
ApiConflictResponse, | ||
ApiCreatedResponse, | ||
ApiOperation, | ||
ApiUnauthorizedResponse, | ||
} from '@nestjs/swagger'; | ||
|
||
export function ApiCreateAdmin() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: `관리자 회원 가입 API`, | ||
}), | ||
ApiCreatedResponse({ | ||
description: 'Created', | ||
schema: { | ||
properties: { | ||
message: { | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
example: { | ||
message: '성공적으로 관리자 계정이 생성되었습니다.', | ||
}, | ||
}), | ||
ApiBadRequestResponse({ | ||
description: 'Bad Request', | ||
example: { | ||
message: '오류 메세지', | ||
}, | ||
}), | ||
ApiConflictResponse({ | ||
description: 'Conflict', | ||
example: { | ||
message: '이미 존재하는 계정입니다.', | ||
}, | ||
}), | ||
ApiUnauthorizedResponse({ | ||
description: 'Unauthorized', | ||
example: { | ||
message: '인증되지 않은 요청입니다.', | ||
}, | ||
}), | ||
); | ||
} |
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,40 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { | ||
ApiBadRequestResponse, | ||
ApiOkResponse, | ||
ApiOperation, | ||
ApiUnauthorizedResponse, | ||
} from '@nestjs/swagger'; | ||
|
||
export function ApiLoginAdmin() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: `관리자 로그인 API`, | ||
}), | ||
ApiOkResponse({ | ||
description: 'Ok', | ||
schema: { | ||
properties: { | ||
message: { | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
example: { | ||
message: '로그인이 성공적으로 처리되었습니다.', | ||
}, | ||
}), | ||
ApiBadRequestResponse({ | ||
description: 'Bad Request', | ||
example: { | ||
message: '오류 메세지', | ||
}, | ||
}), | ||
ApiUnauthorizedResponse({ | ||
description: 'Unauthorized', | ||
example: { | ||
message: '아이디 혹은 비밀번호가 잘못되었습니다.', | ||
}, | ||
}), | ||
); | ||
} |
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,33 @@ | ||
import { | ||
ApiOkResponse, | ||
ApiOperation, | ||
ApiUnauthorizedResponse, | ||
} from '@nestjs/swagger'; | ||
import { applyDecorators } from '@nestjs/common'; | ||
|
||
export function ApiLogoutAdmin() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: '관리자 로그아웃 API', | ||
}), | ||
ApiOkResponse({ | ||
description: 'Ok', | ||
schema: { | ||
properties: { | ||
message: { | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
example: { | ||
message: '로그아웃이 성공적으로 처리되었습니다.', | ||
}, | ||
}), | ||
ApiUnauthorizedResponse({ | ||
description: 'Unauthorized', | ||
example: { | ||
message: '인증되지 않은 요청입니다.', | ||
}, | ||
}), | ||
); | ||
} |
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,60 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { | ||
ApiOkResponse, | ||
ApiOperation, | ||
ApiUnauthorizedResponse, | ||
} from '@nestjs/swagger'; | ||
|
||
export function ApiReadSessionIdAdmin() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: `관리자 페이지 출력을 위한 sessionId 확인 API`, | ||
}), | ||
ApiOkResponse({ | ||
description: 'Ok', | ||
schema: { | ||
properties: { | ||
message: { | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
example: { | ||
message: '정상적인 sessionId입니다.', | ||
}, | ||
}), | ||
ApiUnauthorizedResponse({ | ||
description: 'Unauthorized', | ||
example: { | ||
message: '인증되지 않은 요청입니다.', | ||
}, | ||
}), | ||
); | ||
} | ||
|
||
export function ApiLogout() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: '관리자 로그아웃 API', | ||
}), | ||
ApiOkResponse({ | ||
description: 'Ok', | ||
schema: { | ||
properties: { | ||
message: { | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
example: { | ||
message: '로그아웃이 성공적으로 처리되었습니다.', | ||
}, | ||
}), | ||
ApiUnauthorizedResponse({ | ||
description: 'Unauthorized', | ||
example: { | ||
message: '인증되지 않은 요청입니다.', | ||
}, | ||
}), | ||
); | ||
} |
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
42 changes: 42 additions & 0 deletions
42
server/src/statistic/api-docs/readPlatformStatistic.api-docs.ts
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,42 @@ | ||
import { applyDecorators } from '@nestjs/common'; | ||
import { ApiOkResponse, ApiOperation } from '@nestjs/swagger'; | ||
|
||
export function ApiReadPlatformStatistic() { | ||
return applyDecorators( | ||
ApiOperation({ | ||
summary: '블로그 플랫폼 통계 조회 API', | ||
}), | ||
ApiOkResponse({ | ||
description: 'Ok', | ||
schema: { | ||
properties: { | ||
message: { | ||
type: 'string', | ||
}, | ||
data: { | ||
type: 'array', | ||
items: { | ||
properties: { | ||
platform: { | ||
type: 'string', | ||
}, | ||
count: { | ||
type: 'number', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
example: { | ||
message: '블로그 플랫폼 통계 조회 완료', | ||
data: [ | ||
{ | ||
platform: 'test', | ||
count: 30, | ||
}, | ||
], | ||
}, | ||
}), | ||
); | ||
} |
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.