Skip to content

#3 課題 (takashima.nobutaka) #11

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ntakashima
Copy link

@ntakashima ntakashima commented Mar 30, 2020

課題実装しました!
時間がなく簡易実装になっちゃいましたが..

てか課題2 は何も実装しなくてよかったのか!

Copy link
Owner

@mf-sakura mf-sakura left a comment

Choose a reason for hiding this comment

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

@ntakashima
概ね良さそうです!
多分時間がなかったんだろうなという気がしますが、ちゃんと実装するならdecrementHandlerの修正が必要かなと思います。

Comment on lines +27 to +32
// FIXME 本来は group とか使うのかな.. 時間なく諦めた
e.GET("/incr", methodNotAllowedHandler)
e.PATCH("/incr", methodNotAllowedHandler)
e.PUT("/incr", methodNotAllowedHandler)
e.DELETE("/incr", methodNotAllowedHandler)

Copy link
Owner

Choose a reason for hiding this comment

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

てか課題2 は何も実装しなくてよかったのか!

echoがmethodの判別してくれるので不要という課題でした!
echoのGroupは、/v1/みたいなprefixを管理する為のものですね。

Comment on lines +92 to +95
incrRequest := incrRequest{}
if err := c.Bind(&incrRequest); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Internal Server Error")
}
Copy link
Owner

Choose a reason for hiding this comment

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

多分時間の問題だったと思うんですが、incrRequestを使ってるのが違和感あります

Copy link
Author

@ntakashima ntakashima Mar 30, 2020

Choose a reason for hiding this comment

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

急ぎでやったから(という言い訳
dncrResponse 作ってたけど課題4の実装でデグレってしまった

Comment on lines +91 to +99
func decrementHandler(c echo.Context) error {
incrRequest := incrRequest{}
if err := c.Bind(&incrRequest); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Internal Server Error")
}
dr := &dncrResponse{
Counter: counter,
}
return c.JSON(http.StatusOK, dr)
Copy link
Owner

Choose a reason for hiding this comment

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

デクリメントがされていない?

Copy link
Author

Choose a reason for hiding this comment

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

駆け込みでやったから、、(という言い訳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants