Skip to content

Commit

Permalink
Merge pull request #93 from jihwooon/issue-61
Browse files Browse the repository at this point in the history
폴더와 불필요한 파일을 리팩터링을 하라
  • Loading branch information
jihwooon authored Nov 2, 2023
2 parents 20ce17e + bba1d9e commit 476d4f9
Show file tree
Hide file tree
Showing 46 changed files with 36 additions and 129 deletions.
22 changes: 0 additions & 22 deletions server/src/app.controller.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions server/src/app.controller.ts

This file was deleted.

6 changes: 1 addition & 5 deletions server/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Module } from '@nestjs/common'
import { RouterModule } from '@nestjs/core'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { ConfigModule } from '@nestjs/config'
import { ItemModule } from './items/item.module'
import { AuthModule } from './auth/auth.module'
import { ExceptionModule } from './config/error/exception.module'
import { ExceptionModule } from './exception/exception.module'

@Module({
imports: [
Expand All @@ -23,7 +21,5 @@ import { ExceptionModule } from './config/error/exception.module'
},
]),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
8 changes: 0 additions & 8 deletions server/src/app.service.ts

This file was deleted.

2 changes: 1 addition & 1 deletion server/src/auth/signin/application/signin.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { SigninService } from './signin.service'
import { InternalServerErrorException, BadRequestException } from '@nestjs/common'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signin/signin.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common'
import { SigninService } from './application/signin.service'
import { SigninController } from './web/signin.controller'
import { DatabaseModule } from '../../config/database/database.module'
import { DatabaseModule } from '../../database/database.module'
import { MemberModule } from '../../members/member.module'
import { JwtModule } from '../../jwt/jwt.module'
import { TokenModule } from '../token/token.module'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signin/web/signin.controller.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { PasswordProvider } from '../../../members/application/password.provider'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { SigninService } from '../application/signin.service'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { SignoutService } from './signout.service'
import { TokenExpiredException } from '../../token/error/token_expired.exception'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signout/signout.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common'
import { DatabaseModule } from '../../config/database/database.module'
import { DatabaseModule } from '../../database/database.module'
import { MemberModule } from '../../members/member.module'
import { JwtModule } from '../../jwt/jwt.module'
import { SignoutService } from './application/signout.service'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signout/web/signout.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Connection } from 'mysql2/promise'
import { SignoutController } from './signout.controller'
import { SignoutService } from '../application/signout.service'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { Response } from 'express'
import { TokenIssuer } from '../../token/application/token.issuer'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signup/application/signup.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { EmailChecker } from '../../../members/application/email.checker'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { SignupService } from './signup.service'
import { PasswordProvider } from '../../../members/application/password.provider'
import { JwtProvider } from '../../../jwt/jwt.provider'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signup/signup.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common'
import { DatabaseModule } from '../../config/database/database.module'
import { DatabaseModule } from '../../database/database.module'
import { MemberModule } from '../../members/member.module'
import { JwtModule } from '../../jwt/jwt.module'
import { SignupService } from './application/signup.service'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signup/web/signup.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SignupController } from './signup.controller'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { EmailChecker } from '../../../members/application/email.checker'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { userMock } from '../../../fixture/memberFixture'
import { SignupService } from '../application/signup.service'
import { PasswordProvider } from '../../../members/application/password.provider'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/token/application/token.issuer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { Connection } from 'mysql2/promise'
import { TokenIssuer } from './token.issuer'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { MemberNotFoundException } from '../../../members/application/error/member-not-found.exception'
import { userMock } from '../../../fixture/memberFixture'
import { JwtProvider } from '../../../jwt/jwt.provider'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/token/token.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common'
import { DatabaseModule } from '../../config/database/database.module'
import { DatabaseModule } from '../../database/database.module'
import { TokenController } from './web/token.controller'
import { TokenIssuer } from './application/token.issuer'
import { MemberModule } from '../../members/member.module'
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/token/web/token.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { UnauthorizedException } from '@nestjs/common'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../config/database/constants'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { TokenController } from './token.controller'
import { TokenIssuer } from '../application/token.issuer'
Expand Down
14 changes: 0 additions & 14 deletions server/src/config/helper/db.helper.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing'
import { itemMock } from '../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { when } from 'jest-when'
import { fileMock, filesMock } from '../../fixture/itemImageFixture'
Expand Down
2 changes: 1 addition & 1 deletion server/src/item-images/domain/item-image.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Connection, ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { Inject } from '@nestjs/common'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { ItemImage } from './item-image.entity'

export class ItemImageRepository {
Expand Down
2 changes: 1 addition & 1 deletion server/src/item-images/item-image.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common'
import { DatabaseModule } from '../config/database/database.module'
import { DatabaseModule } from '../database/database.module'
import { ItemImageCreater } from '../item-images/application/item-image.creater'
import { ItemImageRepository } from '../item-images/domain/item-image.repository'
import { ItemImageUpdater } from '../item-images/application/item-image.updater'
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/application/item.creater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ItemRepository } from '../domain/item.repository'
import { Test, TestingModule } from '@nestjs/testing'
import { ItemCreater } from './item.creater'
import { itemMock } from '../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { InternalServerErrorException } from '@nestjs/common'
import { userMock } from '../../fixture/memberFixture'
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/application/item.reader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ItemRepository } from '../domain/item.repository'
import { Test, TestingModule } from '@nestjs/testing'
import { itemMock } from '../../fixture/itemFixture'
import { ItemReader } from './item.reader'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { when } from 'jest-when'
import { ItemNotFoundException } from '../error/item-not-found.exception'
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/application/item.updater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { ItemUpdater } from './item.updater'
import { ItemRepository } from '../domain/item.repository'
import { itemMock } from '../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { when } from 'jest-when'
import { Item } from '../domain/item.entity'
import { ItemStatusEnum } from '../domain/item-status.enum'
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/domain/item.repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { Test, TestingModule } from '@nestjs/testing'
import { dbItemMock, detailItemMock, itemMock } from '../../fixture/itemFixture'
import { ItemRepository } from './item.repository'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'

describe('ItemRepository class', () => {
let itemRepository: ItemRepository
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/domain/item.repository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Connection, ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { Item } from './item.entity'
import { Inject } from '@nestjs/common'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'

export class ItemRepository {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/web/item-create.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ItemCreateController } from './item-create.controller'
import { ItemCreater } from '../application/item.creater'
import { ItemRepository } from '../domain/item.repository'
import { itemMock } from '../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { CreateItemRequest } from '../dto/save-item.dto'
import { InternalServerErrorException } from '@nestjs/common'
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/web/item-detail.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ItemRepository } from '../domain/item.repository'
import { itemMock } from '../../fixture/itemFixture'
import { ItemDetailController } from './item-detail.controller'
import { ItemReader } from '../application/item.reader'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { ItemResponse } from '../dto/detail-item.dto'
import { JwtProvider } from '../../jwt/jwt.provider'
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/web/item-update.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { ItemUpdateController } from './item-update.controller'
import { ItemUpdater } from '../application/item.updater'
import { ItemRepository } from '../domain/item.repository'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { itemMock } from '../../fixture/itemFixture'
import { UpdateItemRequest } from '../dto/update-item.dto'
Expand Down
2 changes: 1 addition & 1 deletion server/src/jwt/jwt.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from '@nestjs/common'
import { DatabaseModule } from '../config/database/database.module'
import { DatabaseModule } from '../database/database.module'
import { JwtProvider } from '../jwt/jwt.provider'

@Module({
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/application/email.checker.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing'
import { Connection } from 'mysql2/promise'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { MemberRepository } from '../domain/member.repository'
import { EmailChecker } from './email.checker'
import { AlreadyExistedEmailException } from './error/already-existed-email.exception'
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/domain/member.repository.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing'
import { Connection, ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { MemberRepository } from './member.repository'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { dbMemberMock, userMock } from '../../fixture/memberFixture'

describe('MemberRepository class', () => {
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/domain/member.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Connection, ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { Inject } from '@nestjs/common'
import { MYSQL_CONNECTION } from '../../config/database/constants'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Member } from './member.entity'

export class MemberRepository {
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/member.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common'
import { EmailChecker } from './application/email.checker'
import { MemberRepository } from './domain/member.repository'
import { DatabaseModule } from '../config/database/database.module'
import { DatabaseModule } from '../database/database.module'
import { PasswordProvider } from './application/password.provider'

@Module({
Expand Down
33 changes: 0 additions & 33 deletions server/test/app.e2e-spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion server/test/item-create.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ItemUpdateController } from '../src/items/web/item-update.controller'
import { ItemDetailController } from '../src/items/web/item-detail.controller'
import { ItemCreateController } from '../src/items/web/item-create.controller'
import { ItemRepository } from '../src/items/domain/item.repository'
import { MYSQL_CONNECTION } from '../src/config/database/constants'
import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { CreateItemRequest } from '../src/items/dto/save-item.dto'
import { MemberRepository } from '../src/members/domain/member.repository'
Expand Down
2 changes: 1 addition & 1 deletion server/test/item-detail.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ItemUpdateController } from '../src/items/web/item-update.controller'
import { ItemDetailController } from '../src/items/web/item-detail.controller'
import { ItemCreateController } from '../src/items/web/item-create.controller'
import { ItemRepository } from '../src/items/domain/item.repository'
import { MYSQL_CONNECTION } from '../src/config/database/constants'
import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../src/members/domain/member.repository'
import { userMock } from '../src/fixture/memberFixture'
Expand Down
2 changes: 1 addition & 1 deletion server/test/item-update.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ItemUpdateController } from '../src/items/web/item-update.controller'
import { ItemDetailController } from '../src/items/web/item-detail.controller'
import { ItemCreateController } from '../src/items/web/item-create.controller'
import { ItemRepository } from '../src/items/domain/item.repository'
import { MYSQL_CONNECTION } from '../src/config/database/constants'
import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { UpdateItemRequest } from '../src/items/dto/update-item.dto'
import { MemberRepository } from '../src/members/domain/member.repository'
Expand Down
2 changes: 1 addition & 1 deletion server/test/signin.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication, ValidationPipe, BadRequestException, InternalServerErrorException } from '@nestjs/common'
import * as request from 'supertest'
import { MemberRepository } from '../src/members/domain/member.repository'
import { MYSQL_CONNECTION } from '../src/config/database/constants'
import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { PasswordProvider } from '../src/members/application/password.provider'
import { JwtProvider } from '../src/jwt/jwt.provider'
Expand Down
2 changes: 1 addition & 1 deletion server/test/signout.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication, UnauthorizedException, InternalServerErrorException } from '@nestjs/common'
import * as request from 'supertest'
import { MemberRepository } from '../src/members/domain/member.repository'
import { MYSQL_CONNECTION } from '../src/config/database/constants'
import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { JwtProvider } from '../src/jwt/jwt.provider'
import { SignoutController } from '../src/auth/signout/web/signout.controller'
Expand Down
Loading

0 comments on commit 476d4f9

Please sign in to comment.