Skip to content

Commit

Permalink
feat: Storage 대신 File을 import 하고 사용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kmi0817 committed Aug 31, 2024
1 parent 51ab102 commit c15b3fb
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 18 deletions.
6 changes: 4 additions & 2 deletions BE/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions BE/src/app.service.ts
Original file line number Diff line number Diff line change
@@ -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 `
Expand Down
6 changes: 4 additions & 2 deletions BE/src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -16,7 +17,8 @@ import { AppleLoginStrategy } from 'src/socialLogin/apple-login-strategy';
providers: [
AuthService,
UsersService,
StorageService,
// StorageService,
FileService,
AuthGuard,
KakaoLoginStrategy,
AppleLoginStrategy,
Expand Down
5 changes: 3 additions & 2 deletions BE/src/postings/postings.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions BE/src/postings/postings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions BE/src/timelines/timelines.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
5 changes: 3 additions & 2 deletions BE/src/timelines/timelines.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
) {}

Expand Down
5 changes: 3 additions & 2 deletions BE/src/users/users.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
5 changes: 3 additions & 2 deletions BE/src/users/users.service.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -12,7 +13,7 @@ export class UsersService {
constructor(
private userRepository: UserRepository,
private blockRepository: BlockRepository,
private readonly storageService: StorageService
private readonly storageService: FileService
) {}

nameGenerator() {
Expand Down

0 comments on commit c15b3fb

Please sign in to comment.