-
Notifications
You must be signed in to change notification settings - Fork 18
[OpenAPI] Add endpoint for list of events #179 #259
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
Conversation
@Capella87 머지 컨플릭트 먼저 해결해 주세요! |
충돌 해결했습니다. |
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.
코멘트 남겨뒀습니다. 무언가 새로운 것을 도입하고 싶다면, 별도의 이슈를 생성하고 거기서 논의를 거쳐 그것을 바탕으로 다른 PR을 생성해 주세요. 새로운 것은 이 태스크의 스코프가 아닙니다.
src/AzureOpenAIProxy.ApiApp/Extensions/ServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
@Capella87 로컬에서 빌드가 성공하든가요? 로컬에서 빌드가 성공하는지 확인하시고 커밋해 보세요. |
@Capella87 거의 비슷한 형태로 다른 엔드포인트만을 구현하는 것이다보니 기존의 코드베이스에 대한 분석을 먼저 하고 비슷하게 적용시켜보는 것이 제일 좋습니다. |
This endpoint is for logged users
확인한 결과 추가한 이후 빌드와 테스트가 성공했습니다. |
수정한 점
|
그렇지 않습니다 최신 코드를 받아보세요. 누락됐다고 하는 코드는 이미 한참전에 추가되어 있었어요. 지금 이상태라면 자신의 코드가 가장 최신을 반영하고 있는지 먼저 검토해 보는 것을 추천합니다. |
다른 코멘트에서도 언급을 했지만, 현재 변경사항이 최신 코드베이스에서 한 것인지 의구심이 듭니다. 자신의 코드베이스를 최신화 한 후에 이 변경사항을 적용시켜보시고, 그리고 다시 PR을 생성해 주세요. |
Remove unused using directives in EventEndpoint.cs, Program.cs Removed the following unused using directives: - In EventEndpoint.cs: - Microsoft.AspNetCore.Http.HttpResults - Microsoft.AspNetCore.Mvc - In Program.cs: - System.Reflection - Microsoft.Extensions.DependencyInjection - Microsoft.OpenApi.Models
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.
잘하셨습니다! 이제 테스트코드를 작성해 주세요!
@Capella87 컨플릭 났어요~! |
@justinyoo 해결했습니다. |
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.
좋습니다! 고생하셨어요!
Description
/events
GET handler와, handler에서 사용할 Data Transfer Object 모델인EventListEntity
, 해당 핸들러가 있는EventEndpoint
를 추가하였습니다.현재
GET
handler는 샘플의EventListEntity
를 생성해 반환하는 방식으로 구현되어 있습니다.Features on this PR
이벤트를 보여주기 위해 필요한 정보를 담는 클래스 두 개를 새로 정의했습니다.
EventListEntity
해당 클래스는 내부에 리소스 정보를 담기 위해 ResourceEntity라는 서브 클래스 정의를 갖고 있습니다.
ResourceEntity
Azure 쪽에서는 리소스(예: gpt4o)를 표시하고 있었기 때문에 추가하였습니다. 이 클래스에서는 리소스 ID와 이름만 들어 있습니다. 리소스에 대한 자세한 정보를 담는 클래스는 별도로 정의될 것 같습니다.
Endpoint
이벤트 목록을 반환하는 GET 메소드를
MapGet
을 통해/events
경로 하에 정의하였으며, 해당 메소드를 갖고 있는 endpoint를RouteHandlerBuilder
를 사용하여EventEndpoint
로 정의하였습니다.아울러, 페이로드를 정의해야 했으나 현재 구현에서는 샘플 객체를 반환하는 방식으로만 구현했고, Authorization 관련 구현이 없어 따로 정의하지는 않았습니다.
events
는 TypedResults를 이용해 정상적으로는 200 OK를 반환하며, Authorization 없는 접근의 경우 401번, 찾을 수 없었던 경우면 404번, 서버에 문제가 생긴 경우 500번을 반환하게 정했습니다.해당 에러가 발생하는 경우 application/problem+json MIME으로 반환하게 됩니다.
기타 변경점
해당 endpoint에 관련된 테스트도 추가하겠습니다.
감사합니다.