Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WebBack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websystem
WebBack
Commits
6e0ce3d0
Commit
6e0ce3d0
authored
4 months ago
by
tpgus2603
Browse files
Options
Downloads
Patches
Plain Diff
refactor : 컨트롤러 및 기타 주석 정리(
#22
)
parent
476327cd
No related branches found
No related tags found
2 merge requests
!42
[#25] 배포코드 master브랜치로 이동
,
!35
Refactor/#22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controllers/meetingController.js
+1
-1
1 addition, 1 deletion
controllers/meetingController.js
services/friendService.js
+18
-23
18 additions, 23 deletions
services/friendService.js
with
19 additions
and
24 deletions
controllers/meetingController.js
+
1
−
1
View file @
6e0ce3d0
...
...
@@ -14,7 +14,7 @@ class MeetingController {
* "time_idx_start": 40, // 예: 10:00 AM
* "time_idx_end": 42, // 예: 10:30 AM
* "location": "회의실 A",
* "deadline": "
2024-04-25T23:59:59Z
",
* "deadline": "
43
",
* "type": "OPEN" // "OPEN" 또는 "CLOSE"
* "max_num":
* }
...
...
This diff is collapsed.
Click to expand it.
services/friendService.js
+
18
−
23
View file @
6e0ce3d0
...
...
@@ -11,9 +11,7 @@ const FriendListDTO = require('../dtos/FriendListDTO');
class
FriendService
{
/**
* User 존재 여부 유효성 검사
* @param {number} userId - 검사할 사용자 ID
* @returns {Promise<User>} - 유효한 사용자 객체
* @throws {Error} - 사용자가 존재하지 않을 경우
* userId - 검사할 사용자 ID
*/
async
validUser
(
userId
)
{
const
user
=
await
User
.
findByPk
(
userId
);
...
...
@@ -25,10 +23,9 @@ class FriendService {
/**
* 친구 요청 보내기
* @param {number} userId - 친구 요청을 보내는 사용자 ID
* @param {number} friendId - 친구 요청을 받는 사용자 ID
* @returns {Promise<FriendResponseDTO>} - 생성된 친구 요청 DTO
* @throws {Error} - 유효하지 않은 요청일 경우
* userId - 친구 요청을 보내는 사용자 ID
* friendId - 친구 요청을 받는 사용자 ID
* returns - 생성된 친구 요청 DTO
*/
async
sendFriendRequest
(
userId
,
friendId
)
{
await
this
.
validUser
(
userId
);
...
...
@@ -81,8 +78,8 @@ class FriendService {
/**
* 받은 친구 요청 목록 조회
* @param {number}
userId - 요청을 받은 사용자 ID
* @returns {Promise<Array<FriendResponseDTO>>} -
받은 친구 요청 목록 DTO 배열
userId - 요청을 받은 사용자 ID
받은 친구 요청 목록 DTO 배열
*/
async
getReceivedRequests
(
userId
)
{
const
receivedRequests
=
await
Friend
.
findAll
({
...
...
@@ -101,8 +98,7 @@ class FriendService {
/**
* 보낸 친구 요청 목록 조회
* @param {number} userId - 요청을 보낸 사용자 ID
* @returns {Promise<Array<FriendResponseDTO>>} - 보낸 친구 요청 목록 DTO 배열
* userId - 요청을 보낸 사용자 ID
*/
async
getSentRequests
(
userId
)
{
const
sentRequests
=
await
Friend
.
findAll
({
...
...
@@ -163,10 +159,9 @@ class FriendService {
/**
* 친구 요청 거절
* @param {number} userId - 요청을 거절하는 사용자 ID
* @param {number} friendId - 친구 요청을 보낸 사용자 ID
* @returns {Promise<number>} - 삭제된 친구 요청 수
* @throws {Error} - 친구 요청이 존재하지 않을 경우
*userId - 요청을 거절하는 사용자 ID
* friendId - 친구 요청을 보낸 사용자 ID
* returns - 삭제된 친구 요청 수
*/
async
rejectFriendRequest
(
userId
,
friendId
)
{
const
result
=
await
Friend
.
destroy
({
...
...
@@ -186,10 +181,10 @@ class FriendService {
/**
* 친구 목록 조회
* @param {number}
userId - 친구 목록을 조회할 사용자 ID
* @param {number}
limit - 한 페이지에 표시할 친구 수
* @param {number}
offset - 페이징 오프셋
* @returns {Promise<Array<FriendListDTO>>} -
친구 목록 DTO 배열
userId - 친구 목록을 조회할 사용자 ID
limit - 한 페이지에 표시할 친구 수
offset - 페이징 오프셋
친구 목록 DTO 배열
*/
async
getFriendList
(
userId
,
pagination
)
{
const
{
limit
=
20
,
offset
=
0
}
=
pagination
;
...
...
@@ -232,10 +227,10 @@ class FriendService {
/**
* 친구 삭제
* @param {number} userId
- 친구를 삭제하는 사용자 ID
* @param {number} friendId
- 삭제할 친구의 사용자 ID
* @returns {Promise<number>}
- 삭제된 친구 관계 수
* @throws {Error} -
친구 관계가 존재하지 않을 경우
- 친구를 삭제하는 사용자 ID
- 삭제할 친구의 사용자 ID
- 삭제된 친구 관계 수
-
친구 관계가 존재하지 않을 경우
*/
async
deleteFriend
(
userId
,
friendId
)
{
const
result
=
await
Friend
.
destroy
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment