findAll() {
- return userRepository.findAll();
- }
-
- @Override
- public User update(UUID userId, String newUsername, String newEmail, String newPassword) {
- User user = find(userId);
- user.update(newUsername, newEmail, newPassword);
- return userRepository.save(user);
- }
-
- @Override
- public void delete(UUID userId) {
- if (!userRepository.existsById(userId)) {
- throw new NoSuchElementException("User with id " + userId + " not found");
- }
- userRepository.deleteById(userId);
- }
-}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
deleted file mode 100644
index 24910bdf1c..0000000000
--- a/src/main/resources/application.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-server:
- port: 8080
-
-spring:
- application:
- name: discodeit
diff --git a/src/main/resources/static/script.js b/src/main/resources/static/script.js
new file mode 100644
index 0000000000..e63118b89c
--- /dev/null
+++ b/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/src/main/resources/static/styles.css b/src/main/resources/static/styles.css
new file mode 100644
index 0000000000..b45f4e7042
--- /dev/null
+++ b/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/src/main/resources/static/user-list.html b/src/main/resources/static/user-list.html
new file mode 100644
index 0000000000..f3acfdb596
--- /dev/null
+++ b/src/main/resources/static/user-list.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ 사용자 목록
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/java/com/sprint/mission/discodeit/DiscodeitApplicationTests.java b/src/test/java/com/sprint/mission/discodeit/DiscodeitApplicationTests.java
deleted file mode 100644
index f6096d0b0c..0000000000
--- a/src/test/java/com/sprint/mission/discodeit/DiscodeitApplicationTests.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.sprint.mission.discodeit;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(classes = DiscodeitApplication.class)
-class DiscodeitApplicationTests {
-
- @Test
- void contextLoads() {
- // Spring Boot 컨텍스트가 정상적으로 로드되는지 확인하는 테스트
- }
-}
diff --git "a/uploads/ee7ec40f-ea90-4c71-a00b-e17c613dd5e2_\354\247\204\354\235\264.jpeg" "b/uploads/ee7ec40f-ea90-4c71-a00b-e17c613dd5e2_\354\247\204\354\235\264.jpeg"
new file mode 100644
index 0000000000..cc497b1b0e
Binary files /dev/null and "b/uploads/ee7ec40f-ea90-4c71-a00b-e17c613dd5e2_\354\247\204\354\235\264.jpeg" differ
diff --git "a/uploads/\354\247\204\354\235\264.jpeg" "b/uploads/\354\247\204\354\235\264.jpeg"
new file mode 100644
index 0000000000..cc497b1b0e
Binary files /dev/null and "b/uploads/\354\247\204\354\235\264.jpeg" differ