Skip to content

Commit

Permalink
Merge pull request #354 from boostcampwm2023/develop
Browse files Browse the repository at this point in the history
12/14 마지막 배포
  • Loading branch information
SongJSeop authored Dec 14, 2023
2 parents fb52aa1 + 2e252b8 commit 7d676cc
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 68 deletions.
249 changes: 193 additions & 56 deletions README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function Instances({ count, size, color, isCustom }: PropsType) {

instancedMeshRef.current.getMatrixAt(index, tempMatrix);
tempObject.position.setFromMatrixPosition(tempMatrix);
tempObject.scale.set(scale, scale, scale);
if (scale > 0.5) tempObject.scale.set(scale, scale, scale);
tempObject.updateMatrix();
instancedMeshRef.current.setMatrixAt(index++, tempObject.matrix);
}
Expand Down
1 change: 0 additions & 1 deletion packages/server/src/admin/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { LogInterceptor } from '../interceptor/log.interceptor';
import { HttpExceptionFilter } from '../exception-filter/http.exception-filter';
import * as osUtils from 'os-utils';
import { exec } from 'child_process';
import { decryptAes } from '../util/aes.util';
import { InjectModel } from '@nestjs/mongoose';
import { Exception } from '../exception-filter/exception.schema';
import { awsConfig, bucketName } from '../config/aws.config';
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/board/dto/create-board.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IsJSON, IsNotEmpty, IsString, MaxLength } from 'class-validator';
export class CreateBoardDto {
@IsNotEmpty({ message: '게시글 제목은 필수 입력입니다.' })
@IsString({ message: '게시글 제목은 문자열로 입력해야 합니다.' })
@MaxLength(255, { message: '게시글 제목은 255자 이내로 입력해야 합니다.' })
@MaxLength(20, { message: '게시글 제목은 20자 이내로 입력해야 합니다.' })
@ApiProperty({
description: '게시글 제목',
example: 'test title',
Expand Down
22 changes: 16 additions & 6 deletions packages/server/src/board/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,26 @@ import * as sharp from 'sharp';
@Injectable()
export class FileService {
async uploadFile(file: Express.Multer.File): Promise<any> {
if (!file.mimetype.includes('image')) {
throw new BadRequestException('not an image file');
if (
!file.mimetype.includes('image') ||
!file.originalname.match(/\.(jpg|jpeg|png)$/)
) {
throw new BadRequestException('not supported image files');
}

const { buffer } = file;

const resized_buffer = await sharp(buffer)
.resize(500, 500, { fit: 'cover' })
.toFormat('png', { quality: 100 })
.toBuffer();
let resized_buffer;
try {
resized_buffer = await sharp(buffer)
.resize(500, 500, { fit: 'cover' })
.toFormat('png', { quality: 100 })
.toBuffer();
} catch (e) {
// sharp에서 지원하지 않는 파일 형식 등의 이유로 리사이징에 실패한 경우 에러 리턴
Logger.error(e);
throw new InternalServerErrorException('image resize failed');
}

const filename = uuid();

Expand Down
1 change: 0 additions & 1 deletion packages/server/src/interceptor/transaction.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
CallHandler,
ExecutionContext,
Injectable,
InternalServerErrorException,
Logger,
NestInterceptor,
} from '@nestjs/common';
Expand Down
2 changes: 0 additions & 2 deletions packages/server/src/star/dto/update-star.dto.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import { PartialType } from '@nestjs/swagger';

export class UpdateStarDto {}

0 comments on commit 7d676cc

Please sign in to comment.