From c15b3fbe23a03ca02c1dbc7642913acbe6363014 Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Sat, 31 Aug 2024 14:40:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Storage=20=EB=8C=80=EC=8B=A0=20File?= =?UTF-8?q?=EC=9D=84=20import=20=ED=95=98=EA=B3=A0=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/app.module.ts | 6 ++++-- BE/src/app.service.ts | 5 +++-- BE/src/auth/auth.module.ts | 6 ++++-- BE/src/postings/postings.module.ts | 5 +++-- BE/src/postings/postings.service.ts | 5 +++-- BE/src/timelines/timelines.module.ts | 6 ++++-- BE/src/timelines/timelines.service.ts | 5 +++-- BE/src/users/users.module.ts | 5 +++-- BE/src/users/users.service.ts | 5 +++-- 9 files changed, 30 insertions(+), 18 deletions(-) diff --git a/BE/src/app.module.ts b/BE/src/app.module.ts index cc74bcf..fcb89d7 100644 --- a/BE/src/app.module.ts +++ b/BE/src/app.module.ts @@ -7,7 +7,8 @@ import { TimelinesModule } from './timelines/timelines.module'; import { AuthModule } from './auth/auth.module'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { DatabaseModule } from './database/database.module'; -import { StorageModule } from './storage/storage.module'; +// import { StorageModule } from './storage/storage.module'; +import { FileModule } from './file/file.module'; import { JwtModule } from '@nestjs/jwt'; import { EmailModule } from './email/email.module'; @@ -22,7 +23,8 @@ import { EmailModule } from './email/email.module'; secret: process.env.JWT_SECRET_ACCESS, signOptions: { expiresIn: '30d' }, }), - StorageModule, + // StorageModule, + FileModule, UsersModule, PostingsModule, TimelinesModule, diff --git a/BE/src/app.service.ts b/BE/src/app.service.ts index 477d7c5..89787e8 100644 --- a/BE/src/app.service.ts +++ b/BE/src/app.service.ts @@ -1,9 +1,10 @@ -import { StorageService } from './storage/storage.service'; +// import { StorageService } from './storage/storage.service'; +import { FileService } from './file/file.service'; import { Injectable } from '@nestjs/common'; @Injectable() export class AppService { - constructor(private readonly storageService: StorageService) {} + constructor(private readonly storageService: FileService) {} getHello(): string { return ` diff --git a/BE/src/auth/auth.module.ts b/BE/src/auth/auth.module.ts index fe6a376..69fd8cc 100644 --- a/BE/src/auth/auth.module.ts +++ b/BE/src/auth/auth.module.ts @@ -3,7 +3,8 @@ import { AuthService } from './auth.service'; import { AuthController } from './auth.controller'; import { UsersModule } from 'src/users/users.module'; import { UsersService } from 'src/users/users.service'; -import { StorageService } from 'src/storage/storage.service'; +// import { StorageService } from 'src/storage/storage.service'; +import { FileService } from 'src/file/file.service'; import { HttpModule } from '@nestjs/axios'; import { AuthGuard } from './auth.guard'; import { EmailModule } from 'src/email/email.module'; @@ -16,7 +17,8 @@ import { AppleLoginStrategy } from 'src/socialLogin/apple-login-strategy'; providers: [ AuthService, UsersService, - StorageService, + // StorageService, + FileService, AuthGuard, KakaoLoginStrategy, AppleLoginStrategy, diff --git a/BE/src/postings/postings.module.ts b/BE/src/postings/postings.module.ts index d03d59f..62815a1 100644 --- a/BE/src/postings/postings.module.ts +++ b/BE/src/postings/postings.module.ts @@ -7,10 +7,11 @@ import { PostingsRepository } from './repositories/postings.repository'; import { LikedsRepository } from './repositories/likeds.repository'; import { ReportsRepository } from './repositories/reports.repository'; import { UsersModule } from '../users/users.module'; -import { StorageModule } from 'src/storage/storage.module'; +// import { StorageModule } from 'src/storage/storage.module'; +import { FileModule } from 'src/file/file.module'; @Module({ - imports: [DatabaseModule, UsersModule, StorageModule], + imports: [DatabaseModule, UsersModule, FileModule], controllers: [PostingsController], providers: [ ...postingsProviders, diff --git a/BE/src/postings/postings.service.ts b/BE/src/postings/postings.service.ts index f329d5b..1ac86a7 100644 --- a/BE/src/postings/postings.service.ts +++ b/BE/src/postings/postings.service.ts @@ -17,7 +17,8 @@ import { Liked } from './entities/liked.entity'; import { Report } from './entities/report.entity'; import { Period, Season } from './postings.types'; import { BLOCKING_LIMIT } from './postings.constants'; -import { StorageService } from 'src/storage/storage.service'; +// import { StorageService } from 'src/storage/storage.service'; +import { FileService } from 'src/file/file.service'; import { BlockRepository } from 'src/users/block.repository'; @Injectable() @@ -28,7 +29,7 @@ export class PostingsService { private readonly postingsRepository: PostingsRepository, private readonly likedsRepository: LikedsRepository, private readonly reportsRepository: ReportsRepository, - private readonly storageService: StorageService + private readonly storageService: FileService ) {} async create(userId: string, createPostingDto: CreatePostingDto) { diff --git a/BE/src/timelines/timelines.module.ts b/BE/src/timelines/timelines.module.ts index 7a0490c..9ff66a1 100644 --- a/BE/src/timelines/timelines.module.ts +++ b/BE/src/timelines/timelines.module.ts @@ -12,14 +12,16 @@ import { PostingsRepository } from '../postings/repositories/postings.repository import { LikedsRepository } from '../postings/repositories/likeds.repository'; import { ReportsRepository } from '../postings/repositories/reports.repository'; import { postingsProviders } from '../postings/postings.providers'; -import { StorageModule } from '../storage/storage.module'; +// import { StorageModule } from '../storage/storage.module'; +import { FileModule } from '../file/file.module'; @Module({ imports: [ DatabaseModule, PostingsModule, UsersModule, - StorageModule, + // StorageModule, + FileModule, HttpModule, ], controllers: [TimelinesController], diff --git a/BE/src/timelines/timelines.service.ts b/BE/src/timelines/timelines.service.ts index 3b43388..9f421aa 100644 --- a/BE/src/timelines/timelines.service.ts +++ b/BE/src/timelines/timelines.service.ts @@ -10,7 +10,8 @@ import { CreateTimelineDto } from './dto/create-timeline.dto'; import { UpdateTimelineDto } from './dto/update-timeline.dto'; import { TimelinesRepository } from './timelines.repository'; import { Timeline } from './entities/timeline.entity'; -import { StorageService } from '../storage/storage.service'; +// import { StorageService } from '../storage/storage.service'; +import { FileService } from '../file/file.service'; import { PostingsService } from '../postings/postings.service'; import { KAKAO_KEYWORD_SEARCH, PAPAGO_URL } from './timelines.constants'; import { PostingsRepository } from '../postings/repositories/postings.repository'; @@ -21,7 +22,7 @@ export class TimelinesService { private readonly timelinesRepository: TimelinesRepository, private readonly postingsRepository: PostingsRepository, private readonly postingsService: PostingsService, - private readonly storageService: StorageService, + private readonly storageService: FileService, private readonly httpService: HttpService ) {} diff --git a/BE/src/users/users.module.ts b/BE/src/users/users.module.ts index a535949..042dde4 100644 --- a/BE/src/users/users.module.ts +++ b/BE/src/users/users.module.ts @@ -3,12 +3,13 @@ import { UsersService } from './users.service'; import { UsersController } from './users.controller'; import { usersProvider } from './users.providers'; import { UserRepository } from './users.repository'; -import { StorageModule } from '../storage/storage.module'; +// import { StorageModule } from '../storage/storage.module'; +import { FileModule } from '../file/file.module'; import { DatabaseModule } from '../database/database.module'; import { BlockRepository } from './block.repository'; @Module({ - imports: [DatabaseModule, StorageModule], + imports: [DatabaseModule, FileModule], controllers: [UsersController], providers: [UsersService, ...usersProvider, UserRepository, BlockRepository], exports: [UserRepository, UsersService, BlockRepository], diff --git a/BE/src/users/users.service.ts b/BE/src/users/users.service.ts index ef963e3..45c4406 100644 --- a/BE/src/users/users.service.ts +++ b/BE/src/users/users.service.ts @@ -1,6 +1,7 @@ import { BadRequestException, Injectable } from '@nestjs/common'; import { UserInfoDto } from './dto/user-info.dto'; -import { StorageService } from 'src/storage/storage.service'; +// import { StorageService } from 'src/storage/storage.service'; +import { FileService } from 'src/file/file.service'; import { UserRepository } from './users.repository'; import { CheckDuplicatedNameResponseDto } from './dto/check-duplicated-name-response.dto'; import { UpdateUserDto } from './dto/update-user.dto'; @@ -12,7 +13,7 @@ export class UsersService { constructor( private userRepository: UserRepository, private blockRepository: BlockRepository, - private readonly storageService: StorageService + private readonly storageService: FileService ) {} nameGenerator() {