Skip to content

Funch APIの一覧取得#5

Open
hikaru-0602 wants to merge 17 commits into
mainfrom
feature/get-funch
Open

Funch APIの一覧取得#5
hikaru-0602 wants to merge 17 commits into
mainfrom
feature/get-funch

Conversation

@hikaru-0602
Copy link
Copy Markdown
Contributor

../way/.github/PULL_REQUEST_TEMPLATE.md

やったこと

  • MenuItemsとMenuItemPriceのデータベース作成
  • Domainモデル作成
  • Repositoryのgetのみ作成
  • Serviceのgetのみ作成
  • Handlerのgetのみ作成
  • mainに追加

Copy link
Copy Markdown

@zakiPoteto zakiPoteto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great code

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the initial “menu items list” (GET) flow for the Funch API by introducing menu domain/database models, a read-only repository/service/handler stack, and wiring the generated OpenAPI handlers into the server.

Changes:

  • Add MenuItem / MenuItemPrice DB models + migration, and corresponding domain models
  • Implement repository/service/handler for GET /v1/menuItems?date=...
  • Wire the handler into cmd/server/main.go using oapi-codegen strict server

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/service/funch.go Service layer and repository interface for menu item listing by date
internal/repository/funch.go GORM-based data access for menu items and their prices
internal/handler/get_menu_items_v1.go Strict handler implementation for listing menu items
internal/handler/funch.go Handler DI container for menu item service
internal/handler/converter.go Domain → OpenAPI response model conversion
internal/domain/funch.go Domain models and enums (Category/Size)
internal/database/migrate.go AutoMigrate now includes new tables
internal/database/funch.go GORM models + domain mapping helpers
go.mod Module path updated to github.com/fun-dotto/funch-api
cmd/server/main.go Instantiate repository/service/handler and register OpenAPI routes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/repository/funch.go Outdated
Copy link
Copy Markdown
Member

@kantacky kantacky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot のレビューは修正した方が良さそう

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 28, 2026 00:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/repository/funch.go Outdated
Copilot AI review requested due to automatic review settings May 8, 2026 06:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Comment thread openapi/openapi.yaml
Comment on lines +36 to +58
post:
operationId: MenuItemsV1_create
parameters: []
responses:
'201':
description: The request has succeeded and a new resource has been created as a result.
content:
application/json:
schema:
type: object
properties:
menuItem:
$ref: '#/components/schemas/MenuItem'
required:
- menuItem
tags:
- MenuItems
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MenuItemRequest'
Comment on lines +5 to +11
"fmt"

api "github.com/fun-dotto/funch-api/generated"
)

func (h *Handler) MenuItemsV1Create(ctx context.Context, request api.MenuItemsV1CreateRequestObject) (api.MenuItemsV1CreateResponseObject, error) {
return nil, fmt.Errorf("not implemented")
Comment thread cmd/server/main.go
Comment on lines 49 to +52
router.Use(middleware.OapiRequestValidator(spec))

// TODO: Implement handler
strictHandler := api.NewStrictHandler(h, nil)
api.RegisterHandlers(router, strictHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants