[feat/image-marker]: 마커 생성 시 이미지 함께 저장 및 조회 응답에 포함#37
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 마커 생성 및 조회 기능에 이미지 첨부 기능을 통합합니다. 사용자가 마커를 생성할 때 관련 이미지를 함께 저장할 수 있게 하며, 이후 마커 정보를 조회할 때 해당 이미지들도 함께 응답에 포함되도록 개선되었습니다. 이는 사용자에게 더 풍부한 정보를 제공하고 데이터의 연관성을 강화하는 데 기여합니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
| const ALLOWED_MIME_TYPES = [ | ||
| 'image/jpeg', | ||
| 'image/png', | ||
| 'image/webp', | ||
| 'image/gif', | ||
| ] as const; | ||
|
|
||
| export class CreateMarkerImageDto { | ||
| @IsUrl() | ||
| url: string; | ||
|
|
||
| @IsIn(ALLOWED_MIME_TYPES) | ||
| mimeType: string; | ||
|
|
||
| @IsInt() | ||
| @Min(1) | ||
| @Max(10 * 1024 * 1024) | ||
| size: number; | ||
| } |
There was a problem hiding this comment.
최대 이미지 크기를 나타내는 10 * 1024 * 1024는 매직 넘버입니다. 가독성과 유지보수성을 높이기 위해 상수로 정의하는 것이 좋습니다. 이렇게 하면 값이 무엇을 의미하는지 이해하기 쉽고, 나중에 변경해야 할 때 한 곳에서만 수정하면 됩니다.
const ALLOWED_MIME_TYPES = [
'image/jpeg',
'image/png',
'image/webp',
'image/gif',
] as const;
const MAX_IMAGE_SIZE_BYTES = 10 * 1024 * 1024; // 10MB
export class CreateMarkerImageDto {
@IsUrl()
url: string;
@IsIn(ALLOWED_MIME_TYPES)
mimeType: string;
@IsInt()
@Min(1)
@Max(MAX_IMAGE_SIZE_BYTES)
size: number;
}| await manager | ||
| .createQueryBuilder() | ||
| .insert() | ||
| .into(Image) | ||
| .values( | ||
| dto.images.map((img) => ({ | ||
| reportId, | ||
| url: img.url, | ||
| mimeType: img.mimeType, | ||
| size: img.size, | ||
| })), | ||
| ) | ||
| .execute(); |
관련 이슈
closes #이슈번호
작업 내용
변경 사항
테스트
리뷰어에게