Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

사용하지 않는 코드 정리, import 순서 변경 #368

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions nestjs-BE/server/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { MongooseModule } from '@nestjs/mongoose';
import { ScheduleModule } from '@nestjs/schedule';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
import { ProfilesModule } from './profiles/profiles.module';
import { SpacesModule } from './spaces/spaces.module';
import { BoardsModule } from './boards/boards.module';
import { ScheduleModule } from '@nestjs/schedule';
import { MongooseModule } from '@nestjs/mongoose';
import { InviteCodesModule } from './invite-codes/invite-codes.module';
import { ProfileSpaceModule } from './profile-space/profile-space.module';
import { BoardTreesModule } from './board-trees/board-trees.module';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
imports: [
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/board-trees/board-trees.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { BoardTreesService } from './board-trees.service';
import { BoardTreesGateway } from './board-trees.gateway';
import { MongooseModule } from '@nestjs/mongoose';
import { BoardTree, BoardTreeSchema } from './schemas/board-tree.schema';

@Module({
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/board-trees/board-trees.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { BoardTree } from './schemas/board-tree.schema';
import { Model } from 'mongoose';
import { BoardTree } from './schemas/board-tree.schema';
import { CrdtTree } from '../crdt/crdt-tree';
import { Operation } from '../crdt/operation';

Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/boards/dto/create-board.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
import { MAX_NAME_LENGTH } from '../../config/magic-number';
import { MAX_NAME_LENGTH } from '../../config/constants';

export class CreateBoardDto {
@ApiProperty({ description: '보드 이름' })
Expand Down
4 changes: 4 additions & 0 deletions nestjs-BE/server/src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const REFRESH_TOKEN_EXPIRY_WEEKS = 2;
export const INVITE_CODE_LENGTH = 10;
export const INVITE_CODE_EXPIRY_HOURS = 6;
export const MAX_NAME_LENGTH = 20;
13 changes: 0 additions & 13 deletions nestjs-BE/server/src/config/magic-number.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class CreateInviteCodeDto {
@ApiProperty({
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/invite-codes/invite-codes.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PrismaService } from '../prisma/prisma.service';
import {
INVITE_CODE_EXPIRY_HOURS,
INVITE_CODE_LENGTH,
} from '../config/magic-number';
} from '../config/constants';
import { checkExpiry, getExpiryDate } from '../utils/date';
import { SpacesService } from '../spaces/spaces.service';

Expand Down
6 changes: 3 additions & 3 deletions nestjs-BE/server/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
import { swaggerConfig } from './config/swagger';
import { ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ProfileSpace } from '@prisma/client';
import { ProfileSpaceService } from './profile-space.service';
import { PrismaService } from '../prisma/prisma.service';
import { ProfileSpace } from '@prisma/client';

describe('ProfileSpaceService', () => {
let profileSpaceService: ProfileSpaceService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
import { ProfileSpace } from '@prisma/client';
import { PrismaService } from '../prisma/prisma.service';

@Injectable()
export class ProfileSpaceService {
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/profiles/dto/create-profile.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { MaxLength } from 'class-validator';
import { MAX_NAME_LENGTH } from '../../config/magic-number';
import { MAX_NAME_LENGTH } from '../../config/constants';

export class CreateProfileDto {
userUuid: string;
Expand Down
4 changes: 2 additions & 2 deletions nestjs-BE/server/src/profiles/dto/update-profile.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PartialType } from '@nestjs/mapped-types';
import { CreateProfileDto } from './create-profile.dto';
import { ApiProperty } from '@nestjs/swagger';
import { MaxLength } from 'class-validator';
import { MAX_NAME_LENGTH } from '../../config/magic-number';
import { CreateProfileDto } from './create-profile.dto';
import { MAX_NAME_LENGTH } from '../../config/constants';

export class UpdateProfileDto extends PartialType(CreateProfileDto) {
@MaxLength(MAX_NAME_LENGTH)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Module } from '@nestjs/common';
import { RefreshTokensService } from './refresh-tokens.service';
import { JwtModule } from '@nestjs/jwt';
import { RefreshTokensService } from './refresh-tokens.service';
import { PrismaModule } from '../prisma/prisma.module';

@Module({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ConfigModule } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import { Test, TestingModule } from '@nestjs/testing';
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library';
import { v4 as uuid } from 'uuid';
import { RefreshTokensService } from './refresh-tokens.service';
import { PrismaService } from '../prisma/prisma.service';
import { JwtModule } from '@nestjs/jwt';
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library';
import { ConfigModule } from '@nestjs/config';
import { getExpiryDate } from '../utils/date';
import { v4 as uuid } from 'uuid';

jest.useFakeTimers();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Prisma, RefreshToken } from '@prisma/client';
import { v4 as uuid } from 'uuid';
import { PrismaService } from '../prisma/prisma.service';
import { getExpiryDate } from '../utils/date';
import { REFRESH_TOKEN_EXPIRY_WEEKS } from '../config/constants';

@Injectable()
export class RefreshTokensService {
Expand All @@ -19,7 +20,7 @@ export class RefreshTokensService {
return this.prisma.refreshToken.create({
data: {
token: this.createToken(),
expiryDate: getExpiryDate({ week: 2 }),
expiryDate: getExpiryDate({ week: REFRESH_TOKEN_EXPIRY_WEEKS }),
userUuid,
},
});
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/spaces/dto/create-space.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
import { MAX_NAME_LENGTH } from '../../config/magic-number';
import { Expose } from 'class-transformer';
import { v4 as uuid } from 'uuid';
import { MAX_NAME_LENGTH } from '../../config/constants';

export class CreateSpaceRequestDto {
@IsString()
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/spaces/dto/update-space.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
import { MAX_NAME_LENGTH } from '../../config/magic-number';
import { MAX_NAME_LENGTH } from '../../config/constants';

export class UpdateSpaceRequestDto {
@IsOptional()
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/spaces/spaces.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BadRequestException, HttpStatus } from '@nestjs/common';
import { Profile, Space } from '@prisma/client';
import { Test, TestingModule } from '@nestjs/testing';
import { Profile, Space } from '@prisma/client';
import { SpacesController } from './spaces.controller';
import { SpacesService } from './spaces.service';
import { UpdateSpaceRequestDto } from './dto/update-space.dto';
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/upload/upload.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
import { v4 as uuid } from 'uuid';
import { ConfigService } from '@nestjs/config';

@Injectable()
export class UploadService {
Expand Down
2 changes: 1 addition & 1 deletion nestjs-BE/server/src/users/users.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpStatus } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import { UsersController } from './users.controller';
import { UsersService } from './users.service';
import { HttpStatus } from '@nestjs/common';

describe('UsersController', () => {
let controller: UsersController;
Expand Down
4 changes: 2 additions & 2 deletions nestjs-BE/server/src/users/users.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Test, TestingModule } from '@nestjs/testing';
import { KakaoUser, User } from '@prisma/client';
import { v4 as uuid } from 'uuid';
import { UsersService } from './users.service';
import { PrismaService } from '../prisma/prisma.service';
import { v4 as uuid } from 'uuid';
import { KakaoUser, User } from '@prisma/client';

describe('UsersService', () => {
let usersService: UsersService;
Expand Down
4 changes: 2 additions & 2 deletions nestjs-BE/server/src/users/users.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
import { CreateUserPrismaDto } from './dto/create-user.dto';
import { Space, User } from '@prisma/client';
import { v4 as uuid } from 'uuid';
import { CreateUserPrismaDto } from './dto/create-user.dto';
import { PrismaService } from '../prisma/prisma.service';

@Injectable()
export class UsersService {
Expand Down
6 changes: 0 additions & 6 deletions nestjs-BE/server/src/utils/interface.ts

This file was deleted.

86 changes: 0 additions & 86 deletions nestjs-BE/server/src/utils/lru-cache.ts

This file was deleted.

30 changes: 0 additions & 30 deletions nestjs-BE/server/src/utils/response.ts

This file was deleted.

Loading