Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d197c3d
[FE] FEAT: 친구 API #202
42inshin Feb 20, 2025
2b0c000
[FE] FEAT: myRoom 빈화면 추가 #202
42inshin Feb 20, 2025
27ee0c3
[FE] FEAT: 홈 첫화면 UI 추가 #202
42inshin Feb 20, 2025
a175e04
[FE] FEAT: friend card UI 추가 #202
42inshin Feb 20, 2025
b28f9b1
[FE] FEAT: 친구 skeleton UI 추가 #202
42inshin Feb 20, 2025
ec13580
[FE] FEAT: 친구 목록 API 요청 및 UI 정리 #202
42inshin Feb 20, 2025
d87ae53
[FE] FEAT: 이미지 에러시 기본 이미지로 나오게 처리 #202
42inshin Feb 20, 2025
93ca9f8
[FE] FEAT: 친구 요청 알림 처리 #202
42inshin Feb 21, 2025
0c8a4e2
[FE] BUG: stateMessage 없는 경우, 에러 처리 #202
42inshin Feb 21, 2025
ddcd74f
[FE] FEAT: 알림 왔을 시 알림에 카운트 업 #202
42inshin Feb 21, 2025
bb3b022
[FE] FEAT: 알림 왔을 시 알림에 카운트 업 UI 처리 #202
42inshin Feb 21, 2025
4da6128
[FE] FEAT: 검색 처리 #202
42inshin Feb 21, 2025
b6ec368
[FE] FEAT: 알림 store로 분리 #202
42inshin Feb 21, 2025
7e8f4a2
[FE] FEAT: 로그인 시 초기 정보 추가 #202
42inshin Feb 21, 2025
cfe6e58
[FE] FIX: 로그아웃 처리 변경 #202
42inshin Feb 21, 2025
2acd667
[FE] FIX: 로그인 에러처리 #202
42inshin Feb 21, 2025
c8b45cc
[FE] FIX: 친구 페이지 store로 변경 및 소켓 처리 #202
42inshin Feb 21, 2025
1fe8ae8
[FE] FIX: 로그아웃 시 store 초기화 #202
42inshin Feb 21, 2025
066bb82
[FE] FIX: 알림 카운트 NotificationStore로 변경 #202
42inshin Feb 21, 2025
e3f52ad
[FE] FIX: SearchItem 파일 분리 #202
42inshin Feb 21, 2025
c4abbaa
[BE] FEAT: 유저 like 검색 추가 #202
42inshin Feb 21, 2025
335469e
[BE] FIX: 모니터링 코드 삭제 및 비밀번호 불일치 시 401에러로 변경 #202
42inshin Feb 21, 2025
bdc4d74
[FE] FEAT: Toat UI 추가 #202
42inshin Feb 21, 2025
1b83de7
[FE] FEAT: 친구 초대 받을 경우 Toast로 실시간 받기 #202
42inshin Feb 21, 2025
d86cbfb
[FE] FEAT: favicon 추가 #202
42inshin Feb 21, 2025
c40f0aa
[FE] FIX: 검색 시 키보드로 변경 했을 때, 검색어 변경 #202
42inshin Feb 21, 2025
c30b119
[FE] FIX: index.html 타이틀 변경 #202
42inshin Feb 21, 2025
83be8d0
Merge branch 'dev' into fe/dev/feat_friendApi/#202
42inshin Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/auth-server/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class AuthService {

const isPasswordMatch = await bcrypt.compare(password, user.password);
if (!isPasswordMatch) {
throw new BadRequestException(MESSAGES.INVALID_LOGIN_INFO);
throw new UnauthorizedException(MESSAGES.INVALID_LOGIN_INFO);
}

const { password: _, ...withoutPassword } = user;
Expand Down
3 changes: 2 additions & 1 deletion src/backend/user-server/src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ export class UserController {
async findAll(
@Query("page", new DefaultValuePipe(0), ParseIntPipe) page: number = 0,
@Query("size", new DefaultValuePipe(10), ParseIntPipe) size: number = 10,
@Query("nickname") nickname?: string,
) {
return this.userService.findAll(page, size);
return this.userService.findAll(page, size, nickname);
}

@Get(":id")
Expand Down
12 changes: 8 additions & 4 deletions src/backend/user-server/src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
NotFoundException,
} from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";
import { Like, Repository } from "typeorm";
import { User } from "./entity/user.entity";
import { CreateUserDto } from "./dto/create-user.dto";
import * as bcrypt from "bcryptjs";
Expand All @@ -17,6 +17,7 @@ import { REDIS_KEY } from "./constants/redis-key.constant";
import { DeviceType } from "./enum/device-type.enum";
import { MESSAGES } from "./constants/constants";
import { ENV_KEY } from "./constants/env-key.constants";

@Injectable()
export class UserService {
private readonly redis: Redis;
Expand Down Expand Up @@ -68,15 +69,18 @@ export class UserService {
return this.userRepository.findOne({ where: { email } });
}

// NOTE: pagination 필요할 경우 추가
async findAll(page: number = 0, size: number = 10) {
async findAll(page: number = 0, size: number = 10, nickname?: string) {
const whereCondition = nickname ? { nickname: Like(`%${nickname}%`) } : {};

const [users, total] = await this.userRepository.findAndCount({
where: whereCondition,
skip: page * size,
take: size,
});

return {
users,
total,
totalLength: total,
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Kicktube</title>
<title>KickTube</title>
</head>
<body>
<div id="root"></div>
Expand Down
1 change: 1 addition & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@types/sockjs-client": "^1.5.4",
"@types/stompjs": "^2.3.9",
"axios": "^1.7.9",
"lucide-react": "^0.475.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.1.3",
Expand Down
12 changes: 12 additions & 0 deletions src/frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/frontend/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions src/frontend/src/api/endpoints/friend/friend.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import instance from '@/api/axios.instance';
import { FriendDto, NotificationDto } from './friend.interface';

export const friendApi = {
// 친구 목록 제공
getFriends: async () => {
const { data } = await instance.get<{ friends: FriendDto[] }>('/friends/list');
return data.friends;
},

// 친구 요청
requestFriend: async (me: number, receiverId: number) => {
const { data } = await instance.post(`/friends/request`, {
senderId: me,
receiverId,
});
return data;
},

// 친구 요청 수락
acceptFriend: async (me: number, senderId: number) => {
const { data } = await instance.post(`/friends/accept`, {
senderId,
receiverId: me,
});
return data;
},

// 친구 요청 거절
rejectFriend: async (me: number, senderId: number) => {
const { data } = await instance.post(`/friends/reject`, {
senderId,
receiverId: me,
});
return data;
},

// 알림 정보
getNotifications: async () => {
const { data } = await instance.get<{ requests: NotificationDto[] }>('/friends/requests');
return data.requests;
},

// 안 읽은 알림 개수 제공
getUnreadNotificationsCount: async () => {
const { data } = await instance.get('/friends/unread');
return data;
},
};
23 changes: 23 additions & 0 deletions src/frontend/src/api/endpoints/friend/friend.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export interface FriendDto {
friend_id: number;
nickname: string;
profile_image_url?: string;
role: number;
status: string;
}

export interface NotificationDto {
isRead: boolean;
receiverId: number;
receiverNickname: string;
roomCode: string | null;
roomId: string | null;
senderId: number;
senderNickname: string;
status: NotificationStatus;
timestamp: number;
type: NotificationType;
}

export type NotificationStatus = 'PENDING' | 'ACCEPTED' | 'REJECTED';
export type NotificationType = 'friend_request' | 'room_request';
7 changes: 5 additions & 2 deletions src/frontend/src/api/endpoints/user/user.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ export const userApi = {
},

// 전체 유저 조회
getUsers: async (page: number = 0, size: number = 10) => {
const { data } = await instance.get(`users`, { params: { page, size } });
getUsers: async (page: number = 0, size: number = 10, nickname?: string) => {
const { data } = await instance.get<{ users: UserResponseDto[]; totalLength: number }>(
`users`,
{ params: { page, size, nickname } },
);
return data;
},

Expand Down
11 changes: 2 additions & 9 deletions src/frontend/src/assets/img/AddUser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/frontend/src/assets/img/CircleInformation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/frontend/src/assets/img/PeopleSearch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading