findAll() {
+ return userStatusRepository.findAll().stream()
+ .map(this::convertToResponse)
+ .toList();
+ }
+
+ @Override
+ public void deleteByUserId(UUID userId) {
+ userStatusRepository.findByUserId(userId)
+ .ifPresent(s -> userStatusRepository.delete(s.getId()));
+ }
+
+ private UserStatusResponse convertToResponse(UserStatus status) {
+ return new UserStatusResponse(
+ status.getId(),
+ status.getUserId(),
+ status.getLastAccessedAt()
+ );
+ }
+}
\ No newline at end of file
diff --git a/discodeit/src/main/resources/application.yaml b/discodeit/src/main/resources/application.yaml
new file mode 100644
index 00000000..f62960aa
--- /dev/null
+++ b/discodeit/src/main/resources/application.yaml
@@ -0,0 +1,4 @@
+discodeit:
+ repository:
+ type: jcf # jcf 또는 file
+ file-directory: .discodeit # 이 부분이 누락되어서 에러가 난 거예요!
\ No newline at end of file
diff --git a/discodeit/src/main/resources/static/script.js b/discodeit/src/main/resources/static/script.js
new file mode 100644
index 00000000..e63118b8
--- /dev/null
+++ b/discodeit/src/main/resources/static/script.js
@@ -0,0 +1,67 @@
+// API endpoints
+const API_BASE_URL = '/api';
+const ENDPOINTS = {
+ USERS: `${API_BASE_URL}/user/findAll`,
+ BINARY_CONTENT: `${API_BASE_URL}/binaryContent/find`
+};
+
+// Initialize the application
+document.addEventListener('DOMContentLoaded', () => {
+ fetchAndRenderUsers();
+});
+
+// Fetch users from the API
+async function fetchAndRenderUsers() {
+ try {
+ const response = await fetch(ENDPOINTS.USERS);
+ if (!response.ok) throw new Error('Failed to fetch users');
+ const users = await response.json();
+ renderUserList(users);
+ } catch (error) {
+ console.error('Error fetching users:', error);
+ }
+}
+
+// Fetch user profile image
+async function fetchUserProfile(profileId) {
+ try {
+ const response = await fetch(`${ENDPOINTS.BINARY_CONTENT}?binaryContentId=${profileId}`);
+ if (!response.ok) throw new Error('Failed to fetch profile');
+ const profile = await response.json();
+
+ // Convert base64 encoded bytes to data URL
+ return `data:${profile.contentType};base64,${profile.bytes}`;
+ } catch (error) {
+ console.error('Error fetching profile:', error);
+ return '/default-avatar.png'; // Fallback to default avatar
+ }
+}
+
+// Render user list
+async function renderUserList(users) {
+ const userListElement = document.getElementById('userList');
+ userListElement.innerHTML = ''; // Clear existing content
+
+ for (const user of users) {
+ const userElement = document.createElement('div');
+ userElement.className = 'user-item';
+
+ // Get profile image URL
+ const profileUrl = user.profileId ?
+ await fetchUserProfile(user.profileId) :
+ '/default-avatar.png';
+
+ userElement.innerHTML = `
+
+
+
${user.username}
+
${user.email}
+
+
+ ${user.online ? '온라인' : '오프라인'}
+
+ `;
+
+ userListElement.appendChild(userElement);
+ }
+}
\ No newline at end of file
diff --git a/discodeit/src/main/resources/static/styles.css b/discodeit/src/main/resources/static/styles.css
new file mode 100644
index 00000000..b45f4e70
--- /dev/null
+++ b/discodeit/src/main/resources/static/styles.css
@@ -0,0 +1,80 @@
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: Arial, sans-serif;
+ background-color: #f5f5f5;
+}
+
+.container {
+ max-width: 800px;
+ margin: 0 auto;
+ padding: 20px;
+}
+
+h1 {
+ text-align: center;
+ margin-bottom: 30px;
+ color: #333;
+}
+
+.user-list {
+ background-color: white;
+ border-radius: 8px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+.user-item {
+ display: flex;
+ align-items: center;
+ padding: 20px;
+ border-bottom: 1px solid #eee;
+}
+
+.user-item:last-child {
+ border-bottom: none;
+}
+
+.user-avatar {
+ width: 60px;
+ height: 60px;
+ border-radius: 50%;
+ margin-right: 20px;
+ object-fit: cover;
+}
+
+.user-info {
+ flex-grow: 1;
+}
+
+.user-name {
+ font-size: 18px;
+ font-weight: bold;
+ color: #333;
+ margin-bottom: 5px;
+}
+
+.user-email {
+ font-size: 14px;
+ color: #666;
+}
+
+.status-badge {
+ padding: 6px 12px;
+ border-radius: 20px;
+ font-size: 14px;
+ font-weight: bold;
+}
+
+.online {
+ background-color: #4CAF50;
+ color: white;
+}
+
+.offline {
+ background-color: #9e9e9e;
+ color: white;
+}
\ No newline at end of file
diff --git a/discodeit/src/main/resources/static/user-list.html b/discodeit/src/main/resources/static/user-list.html
new file mode 100644
index 00000000..f3acfdb5
--- /dev/null
+++ b/discodeit/src/main/resources/static/user-list.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ 사용자 목록
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/discodeit/src/test/java/com/sprint/mission/discodeit/DiscodeitApplicationTests.java b/discodeit/src/test/java/com/sprint/mission/discodeit/DiscodeitApplicationTests.java
new file mode 100644
index 00000000..3a987a21
--- /dev/null
+++ b/discodeit/src/test/java/com/sprint/mission/discodeit/DiscodeitApplicationTests.java
@@ -0,0 +1,13 @@
+package com.sprint.mission.discodeit;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class DiscodeitApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
diff --git a/messages.ser b/messages.ser
new file mode 100644
index 00000000..d2022304
Binary files /dev/null and b/messages.ser differ
diff --git a/users.ser b/users.ser
new file mode 100644
index 00000000..be2bf0a6
Binary files /dev/null and b/users.ser differ