Skip to content

Commit 2ccc3d3

Browse files
Merge pull request #300 from boostcampwm-2024/dev
[Deploy] 6주차 1차 배포
2 parents 314cfaa + b963cc1 commit 2ccc3d3

File tree

131 files changed

+2868
-1696
lines changed

Some content is hidden

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

131 files changed

+2868
-1696
lines changed

README.md

Lines changed: 59 additions & 82 deletions
Large diffs are not rendered by default.

backend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"dotenv": "^16.4.5",
4040
"ioredis": "^5.4.1",
4141
"mysql2": "^3.11.4",
42-
"nestjs-paginate": "^10.0.0",
4342
"nestjs-redis-om": "^0.1.2",
4443
"passport": "^0.7.0",
4544
"passport-custom": "^1.1.1",

backend/src/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { createDataSource, typeOrmConfig } from "./config/typeorm.config";
1414
import { QuestionListModule } from "./question-list/question-list.module";
1515
import { RedisOmModule } from "@moozeh/nestjs-redis-om";
1616
import { SigServerModule } from "@/signaling-server/sig-server.module";
17+
import { QuestionModule } from './question/question.module';
1718

1819
@Module({
1920
imports: [
@@ -29,6 +30,7 @@ import { SigServerModule } from "@/signaling-server/sig-server.module";
2930
UserModule,
3031
QuestionListModule,
3132
SigServerModule,
33+
QuestionModule,
3234
],
3335
controllers: [AppController],
3436
providers: [AppService],

backend/src/config/typeorm.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { SnakeNamingStrategy } from "typeorm-naming-strategies";
33
import { User } from "@/user/user.entity";
44
import "dotenv/config";
55
import { addTransactionalDataSource } from "typeorm-transactional";
6-
import { QuestionList } from "@/question-list/question-list.entity";
7-
import { Question } from "@/question-list/question.entity";
8-
import { Category } from "@/question-list/category.entity";
6+
import { QuestionList } from "@/question-list/entity/question-list.entity";
7+
import { Question } from "@/question-list/entity/question.entity";
8+
import { Category } from "@/question-list/entity/category.entity";
99

1010
export const typeOrmConfig: DataSourceOptions = {
1111
type: "mysql",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { IsInt, IsNumberString, IsString } from "class-validator";
2+
import { Expose } from "class-transformer";
3+
4+
export class PaginateMetaDto {
5+
@Expose()
6+
@IsInt()
7+
itemsPerPage: number;
8+
9+
@Expose()
10+
@IsInt()
11+
totalItems: number;
12+
13+
@Expose()
14+
@IsNumberString()
15+
currentPage: string;
16+
17+
@Expose()
18+
@IsInt()
19+
totalPages: number;
20+
21+
@Expose()
22+
@IsString()
23+
sortBy: string;
24+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { IsInt, IsOptional, IsString, Min } from "class-validator";
2+
import { Expose, Transform } from "class-transformer";
3+
4+
export class PaginateQueryDto {
5+
@Expose()
6+
@IsOptional()
7+
@IsInt()
8+
@Min(1)
9+
@Transform(({ value }) => (value ? parseInt(value) : 1))
10+
page?: number;
11+
12+
@Expose()
13+
@IsOptional()
14+
@IsInt()
15+
@Min(1)
16+
@Transform(({ value }) => (value ? parseInt(value) : 4))
17+
limit?: number;
18+
19+
@Expose()
20+
@IsOptional()
21+
@IsString()
22+
@Transform(({ value }) => value || "usage:DESC")
23+
sortBy?: string;
24+
25+
@Expose()
26+
@IsOptional()
27+
@IsString()
28+
category?: string;
29+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { SelectQueryBuilder } from "typeorm";
2+
3+
export class PaginateDto {
4+
queryBuilder: SelectQueryBuilder<any>;
5+
skip: number;
6+
take: number;
7+
field: string;
8+
direction: "ASC" | "DESC";
9+
}

backend/src/question-list/dto/question-list-contents.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Question } from "../question.entity";
1+
import { Question } from "../entity/question.entity";
22

33
export interface QuestionListContentsDto {
44
id: number;

0 commit comments

Comments
 (0)