Skip to content

Commit 6879823

Browse files
authored
Merge pull request #129 from oodd-team/dev
리팩토링 v1.1.0 (2차)
2 parents 9c218f1 + 28bc09c commit 6879823

83 files changed

Lines changed: 915 additions & 918 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/apis/auth/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { newRequest } from '@apis/core';
2+
23
import type { getUserInfoByJwtResponse } from './dto';
34

45
// jwt로 사용자 정보 조회 api /auth/me

src/apis/chatting/dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface chatRoomMessagesData {
2727
fromUser: FromUserDto;
2828
toUser: ToUserDto;
2929
createdAt: string;
30-
toUserReadAt: any;
30+
toUserReadAt: Date;
3131
}
3232

3333
export interface FromUserDto {

src/apis/core/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import axios, {
55
AxiosResponse,
66
InternalAxiosRequestConfig,
77
} from 'axios';
8+
89
import { NEW_JWT_KEY } from '../../config/constant';
910

1011
// 기존 서버 응답 타입

src/apis/matching/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { newRequest } from '@apis/core';
2+
23
import type {
34
CreateMatchingRequest,
45
CreateMatchingResponse,

src/apis/post-comment/dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface Content {
1717
content: string;
1818
}
1919

20-
interface CreateCommentData extends Content {}
20+
type CreateCommentData = Content;
2121

2222
export interface Comment {
2323
id: number;

src/apis/post-comment/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { newRequest } from '../core';
2-
import { CreateCommentRequest, CreateCommentResponse, GetCommentListResponse } from './dto';
3-
import { EmptySuccessResponse } from '../core/dto';
1+
import { newRequest } from '@apis/core';
2+
3+
import type { EmptySuccessResponse } from '@apis/core/dto';
4+
5+
import type { CreateCommentRequest, CreateCommentResponse, GetCommentListResponse } from './dto';
46

57
// 게시글 댓글 생성 API
68
export const createCommentApi = (postId: number, data: CreateCommentRequest) =>

src/apis/post-like/dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { BaseSuccessResponse } from '../core/dto';
2-
import { PaginationMeta } from '../util/dto';
1+
import type { BaseSuccessResponse } from '@apis/core/dto';
2+
import type { PaginationMeta } from '@apis/util/dto';
33

44
// 좋아요 누르기/취소
55
export type TogglePostLikeStatusResponse = BaseSuccessResponse<TogglePostLikeStatusData>;

src/apis/post-like/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { newRequest } from '../core';
2-
import { TogglePostLikeStatusResponse, GetPostLikeListResponse } from './dto';
1+
import { newRequest } from '@apis/core';
2+
3+
import type { TogglePostLikeStatusResponse, GetPostLikeListResponse } from './dto';
34

45
// 게시글 좋아요 누르기/취소
56
export const togglePostLikeStatusApi = (postId: number) =>

src/apis/post-report/dto.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
import { BaseSuccessResponse } from '../core/dto';
1+
import type { BaseSuccessResponse } from '@apis/core/dto';
22

33
interface BaseReport {
4-
id: number; // 신고 ID
5-
userId: number; // 신고 생성 사용자 ID
6-
postId: number; // 신고된 게시글 ID
7-
content: string; // 신고된 게시글 내용
8-
repostReason: string; // 신고 사유
4+
id: number; // 신고 ID
5+
userId: number; // 신고 생성 사용자 ID
6+
postId: number; // 신고된 게시글 ID
7+
content: string; // 신고된 게시글 내용
8+
repostReason: string; // 신고 사유
99
}
1010

1111
// 게시글 신고 요청 DTO
1212
export interface SendPostReportRequest {
13-
requesterId: number; // 신고하는 사용자 ID
14-
postId: number; // 신고 대상 게시글 ID
15-
reason: string; // 신고 사유
13+
requesterId: number; // 신고하는 사용자 ID
14+
postId: number; // 신고 대상 게시글 ID
15+
reason: string; // 신고 사유
1616
}
1717

1818
// 게시물 신고 응답 데이터
1919
export interface SendPostReportData extends BaseReport {
20-
requesterId: number; // 신고하는 사용자 ID
21-
postId: number; // 신고 대상 게시글 ID
22-
reason: string; // 신고 사유
20+
requesterId: number; // 신고하는 사용자 ID
21+
postId: number; // 신고 대상 게시글 ID
22+
reason: string; // 신고 사유
2323
}
2424

2525
// 게시물 신고 응답 타입
2626
export type SendPostReportResponse = BaseSuccessResponse<SendPostReportData>;
27-

src/apis/post-report/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { newRequest } from "../core";
2-
import { SendPostReportRequest, SendPostReportResponse } from "./dto";
1+
import { newRequest } from '@apis/core';
2+
3+
import type { SendPostReportRequest, SendPostReportResponse } from './dto';
34

45
// 게시글 신고 API
56
export const sendPostReportApi = (data: SendPostReportRequest) =>
6-
newRequest.post<SendPostReportResponse>('/post-report', data);
7+
newRequest.post<SendPostReportResponse>('/post-report', data);

0 commit comments

Comments
 (0)