Repository navigation
feat: 인스타그램 장소 추출 파이프라인 유기적 연동 및 응답 구조 재설계 #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
901bb34
feat: 장소 추출 결과를 장소별 그룹 구조로 재설계
minsour b2603c6
test: place 파이프라인 e2e 추가
minsour 765148e
chore: 전체 플로우 연동 완료로 _test/geocode 임시 엔드포인트 제거
minsour 0578ade
docs: place API Swagger 문서화
minsour 6cd1e7b
Merge branch 'main' into feature/GM-88-instagram-scrap-e2e
minsour 1eaf493
Merge remote-tracking branch 'origin/main' into feature/GM-88-instagr…
minsour fe4f2e3
style: biome 포맷 규칙 적용
minsour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,3 @@ | ||
| import { generateSchema } from "@nestjs/swagger"; | ||
|
|
||
| export type SchemaObject = ReturnType<typeof generateSchema>["schema"]; |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,45 +1,51 @@ | ||
| import { Body, Controller, Get, Post, Query } from "@nestjs/common"; | ||
| import { Body, Controller, Post } from "@nestjs/common"; | ||
| import { ApiBody, ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger"; | ||
| import { ValibotPipe } from "../../common/pipes/valibot.pipe"; | ||
| import { GeocoderService } from "../../infrastructures/geocoder/geocoder.service"; | ||
| import type { GeoCandidate } from "../../infrastructures/geocoder/geocoder.type"; | ||
| import { | ||
| type CreatePlaceRequest, | ||
| createPlaceRequestApiSchema, | ||
| createPlaceRequestSchema, | ||
| type TestGeocodeRequest, | ||
| testGeocodeRequestSchema, | ||
| errorResponseApiSchema, | ||
| placeMatchListResponseApiSchema, | ||
| } from "./place.dto"; | ||
| import { PlaceService } from "./place.service"; | ||
| import type { PlaceCandidate } from "./place.type"; | ||
| import type { PlaceMatch } from "./place.type"; | ||
|
|
||
| @ApiTags("place") | ||
| @Controller("api/v1/place") | ||
| export class PlaceController { | ||
| constructor( | ||
| private readonly placeService: PlaceService, | ||
| // TODO: KakaoProvider 확인용 임시 의존성으로 전체 플로우 연동 후 제거합니다. | ||
| private readonly geocoderService: GeocoderService, | ||
| ) {} | ||
| constructor(private readonly placeService: PlaceService) {} | ||
|
|
||
| @Post("places") | ||
| @ApiOperation({ | ||
| summary: "인스타그램 URL에서 장소를 추출한 후 지오코딩한다", | ||
| description: | ||
| "scrap → AI extraction → geocoding fan-out", | ||
| }) | ||
| @ApiBody({ schema: createPlaceRequestApiSchema }) | ||
| @ApiResponse({ | ||
| status: 201, | ||
| description: "장소별 그룹(PlaceMatch[])", | ||
| schema: placeMatchListResponseApiSchema, | ||
| }) | ||
| @ApiResponse({ | ||
| status: 400, | ||
| description: "요청 형식 오류 (VALIDATION_ERROR)", | ||
| schema: errorResponseApiSchema, | ||
| }) | ||
| @ApiResponse({ | ||
| status: 502, | ||
| description: "외부 연동 실패 (SCRAPER_REQUEST_FAILED / GEOCODER_ALL_FAILED)", | ||
| schema: errorResponseApiSchema, | ||
| }) | ||
| async createPlace( | ||
| @Body(new ValibotPipe(createPlaceRequestSchema)) body: CreatePlaceRequest, | ||
| ): Promise<PlaceCandidate[]> { | ||
| ): Promise<PlaceMatch[]> { | ||
| switch (body.method) { | ||
| case "instagram_url": | ||
| return this.placeService.extractFromUrl(body.data.url); | ||
| default: | ||
| throw new Error(`Unsupported method: ${body.method}`); | ||
| } | ||
| } | ||
|
|
||
| // TODO: KakaoProvider 확인용 임시 테스트 엔드포인트로 전체 플로우 연동 후 제거합니다. | ||
| @Get("_test/geocode") | ||
| async testGeocode( | ||
| @Query(new ValibotPipe(testGeocodeRequestSchema)) query: TestGeocodeRequest, | ||
| ): Promise<GeoCandidate[]> { | ||
| return this.geocoderService.searchAll({ | ||
| placeName: query.placeName, | ||
| areaName: query.areaName, | ||
| areaType: query.areaType, | ||
| }); | ||
| } | ||
| } |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: mash-up-kr/Team-MINO-Node
Length of output: 583
🏁 Script executed:
Repository: mash-up-kr/Team-MINO-Node
Length of output: 222
🏁 Script executed:
Repository: mash-up-kr/Team-MINO-Node
Length of output: 18663
required배열을 추가해 Swagger 응답 스키마를 실제 타입과 맞춰주세요coordinateSchema,geoCandidateSchema,extractedPlaceSchema,placeMatchSchema,placeMatchListResponseApiSchema,errorResponseApiSchema모두required가 없어 응답 필드가 전부 선택적으로 표시됩니다. 특히geoCandidateSchema는GeoCandidate에 맞춰provider,providerPlaceId,placeName,address,coordinate만 필수로 두고 나머지는 제외하세요.🤖 Prompt for AI Agents