-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into preproduction
# Conflicts: # BE/package-lock.json # BE/package.json # BE/src/app.module.ts # BE/src/auth/auth.controller.ts # BE/src/auth/auth.service.ts # BE/src/common/multer.config.ts # BE/src/mates/mates.controller.ts # BE/src/mates/mates.module.ts # BE/src/mates/mates.service.ts # BE/src/users/users.service.ts # iOS/FlipMate/FlipMate.xcodeproj/project.pbxproj # iOS/FlipMate/FlipMate/Application/DIContainer/AppDIContainer.swift # iOS/FlipMate/FlipMate/Application/DIContainer/CategoryDIContainer.swift # iOS/FlipMate/FlipMate/Application/DIContainer/LoginDIContainer.swift # iOS/FlipMate/FlipMate/Application/DIContainer/TabBarDIContainer.swift # iOS/FlipMate/FlipMate/Application/DIContainer/TimerSceneDIContainer.swift # iOS/FlipMate/FlipMate/Data/Extension/UIColor++Extension.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/Flows/CategorySettingCoordinator.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/Flows/TimerFlowCoordinator.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/View/CategoryColorSelectView.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/ViewController/CategoryModifyViewController.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/ViewController/CategorySettingViewController.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/ViewModel/CategoryViewModel.swift # iOS/FlipMate/FlipMate/Presentation/TimerScene/ViewModel/TimerViewModel.swift
- Loading branch information
Showing
49 changed files
with
1,342 additions
and
395 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Injectable, NestMiddleware } from '@nestjs/common'; | ||
import { NextFunction } from 'express'; | ||
|
||
@Injectable() | ||
export class LoggingMiddleware implements NestMiddleware { | ||
use(req: Request & { now: number }, res: Response, next: NextFunction) { | ||
req.now = Date.now(); | ||
next(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { RedisClientType, createClient } from 'redis'; | ||
|
||
@Injectable() | ||
export class RedisService { | ||
private client: RedisClientType; | ||
constructor() { | ||
this.client = createClient(); | ||
this.client.connect(); | ||
} | ||
set(key: string, value: string) { | ||
this.client.set(key, value); | ||
} | ||
|
||
get(key: string): Promise<string | null> { | ||
return this.client.get(key); | ||
} | ||
|
||
async del(key: string): Promise<void> { | ||
await this.client.del(key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class ResponseDto { | ||
@ApiProperty({ | ||
type: 'number', | ||
example: 200, | ||
description: '상태 코드', | ||
}) | ||
statusCode; | ||
|
||
@ApiProperty({ | ||
type: 'string', | ||
example: '요청이 정상적으로 처리되었습니다.', | ||
description: '메세지', | ||
}) | ||
message; | ||
|
||
constructor(statusCode: number, message: string) { | ||
this.statusCode = statusCode; | ||
this.message = message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Injectable, InternalServerErrorException } from '@nestjs/common'; | ||
import { ConfigService } from '@nestjs/config'; | ||
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3'; | ||
import * as sharp from 'sharp'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
import * as path from 'path'; | ||
|
||
@Injectable() | ||
export class S3Service { | ||
private s3Client: S3Client; | ||
|
||
constructor(private configService: ConfigService) { | ||
this.s3Client = new S3Client({ | ||
endpoint: this.configService.get('IMAGE_ENDPOINT'), | ||
credentials: { | ||
accessKeyId: this.configService.get('IMAGE_ACCESSKEY'), | ||
secretAccessKey: this.configService.get('IMAGE_SECRETKEY'), | ||
}, | ||
region: this.configService.get('IMAGE_REGION'), | ||
}); | ||
} | ||
|
||
async uploadFile(file: Express.Multer.File): Promise<string> { | ||
try { | ||
const buffer = await sharp(file.buffer).resize(800, 800).toBuffer(); | ||
const fileName = `IMG_${uuidv4()}${path.extname(file.originalname)}`; | ||
|
||
await this.s3Client.send( | ||
new PutObjectCommand({ | ||
Bucket: this.configService.get('IMAGE_BUCKET'), | ||
Key: fileName, | ||
Body: buffer, | ||
}), | ||
); | ||
|
||
return fileName; | ||
} catch (error) { | ||
throw new InternalServerErrorException(error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.