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
Merge requests
!42
[
#25
] 배포코드 master브랜치로 이동
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[
#25
] 배포코드 master브랜치로 이동
deploy
into
master
Overview
0
Commits
75
Pipelines
0
Changes
40
Merged
세현 임
requested to merge
deploy
into
master
3 months ago
Overview
0
Commits
75
Pipelines
0
Changes
40
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
ebe370c8
75 commits,
3 months ago
40 files
+
2141
−
857
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
40
Search (e.g. *.vue) (Ctrl+P)
controllers/chatController.js
+
63
−
0
Options
@@ -91,4 +91,67 @@ exports.updateStatusAndLogId = async (req, res) => {
console
.
error
(
'
Error updating user status and lastReadLogId:
'
,
err
);
res
.
status
(
500
).
json
({
error
:
'
Failed to update user status and lastReadLogId
'
});
}
};
// 공지 등록
exports
.
addNotice
=
async
(
req
,
res
)
=>
{
const
{
chatRoomId
}
=
req
.
params
;
const
{
sender
,
message
}
=
req
.
body
;
try
{
const
notice
=
await
chatService
.
addNotice
(
chatRoomId
,
sender
,
message
);
res
.
status
(
200
).
json
(
notice
);
}
catch
(
error
)
{
console
.
error
(
'
Error adding notice:
'
,
error
.
message
);
res
.
status
(
500
).
json
({
error
:
'
Failed to add notice
'
});
}
};
// 최신 공지 조회
exports
.
getLatestNotice
=
async
(
req
,
res
)
=>
{
const
{
chatRoomId
}
=
req
.
params
;
try
{
const
latestNotice
=
await
chatService
.
getLatestNotice
(
chatRoomId
);
if
(
latestNotice
)
{
res
.
status
(
200
).
json
(
latestNotice
);
}
else
{
res
.
status
(
404
).
json
({
message
:
'
No notices found
'
});
}
}
catch
(
error
)
{
console
.
error
(
'
Error fetching latest notice:
'
,
error
.
message
);
res
.
status
(
500
).
json
({
error
:
'
Failed to fetch latest notice
'
});
}
};
// 공지 전체 조회
exports
.
getAllNotices
=
async
(
req
,
res
)
=>
{
const
{
chatRoomId
}
=
req
.
params
;
try
{
const
notices
=
await
chatService
.
getAllNotices
(
chatRoomId
);
console
.
log
(
`[getAllNotices] Notices for chatRoomId
${
chatRoomId
}
:`
,
notices
);
// 로그 추가
res
.
status
(
200
).
json
(
notices
);
}
catch
(
error
)
{
console
.
error
(
'
Error fetching all notices:
'
,
error
.
message
);
res
.
status
(
500
).
json
({
error
:
'
Failed to fetch all notices
'
});
}
};
// 공지사항 상세 조회
exports
.
getNoticeById
=
async
(
req
,
res
)
=>
{
const
{
chatRoomId
,
noticeId
}
=
req
.
params
;
try
{
const
notice
=
await
chatService
.
getNoticeById
(
chatRoomId
,
noticeId
);
if
(
!
notice
)
{
return
res
.
status
(
404
).
json
({
error
:
'
Notice not found
'
});
}
res
.
status
(
200
).
json
(
notice
);
}
catch
(
error
)
{
console
.
error
(
'
Error fetching notice by ID:
'
,
error
.
message
);
res
.
status
(
500
).
json
({
error
:
'
Failed to fetch notice by ID
'
});
}
};
\ No newline at end of file
Loading