Skip to content

Commit

Permalink
Fixed the endpoint for getting book data
Browse files Browse the repository at this point in the history
  • Loading branch information
ybkuroki committed May 3, 2021
1 parent 6f669bf commit ce37989
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ There are the following services in the book management.
|Service Name|HTTP Method|URL|Parameter|Summary|
|:---|:---:|:---|:---|:---|
|Get Service|GET|``/api/book/get?id=[BOOK_ID]``|Book ID|Get a book data.|
|Get Service|GET|``/api/book?id=[BOOK_ID]``|Book ID|Get a book data.|
|List Service|GET|``/api/book/list?page=[PAGE_NUMBER]&size=[PAGE_SIZE]``|Page|Get a list of books.|
|Regist Service|POST|``/api/book/new``|Book|Regist a book data.|
|Edit Service|POST|``/api/book/edit``|Book|Edit a book data.|
Expand Down
2 changes: 0 additions & 2 deletions controller/api_const.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const (
API = "/api"
// APIBook represents the group of book management API.
APIBook = API + "/book"
// APIBookGet represents the API to get one book.
APIBookGet = APIBook + "/get"
// APIBookList represents the API to get book's list.
APIBookList = APIBook + "/list"
// APIBookSearch represents the API to search book's list.
Expand Down
2 changes: 1 addition & 1 deletion router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Init(e *echo.Echo, context mycontext.Context) {
account := controller.NewAccountController(context)
health := controller.NewHealthController(context)

e.GET(controller.APIBookGet, func(c echo.Context) error { return book.GetBook(c) })
e.GET(controller.APIBook, func(c echo.Context) error { return book.GetBook(c) })
e.GET(controller.APIBookList, func(c echo.Context) error { return book.GetBookList(c) })
e.GET(controller.APIBookSearch, func(c echo.Context) error { return book.GetBookSearch(c) })
e.POST(controller.APIBookRegist, func(c echo.Context) error { return book.PostBookRegist(c) })
Expand Down

0 comments on commit ce37989

Please sign in to comment.