-
Notifications
You must be signed in to change notification settings - Fork 25
#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
base: master
Are you sure you want to change the base?
Conversation
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.
@ntakashima
概ね良さそうです!
多分時間がなかったんだろうなという気がしますが、ちゃんと実装するならdecrementHandler
の修正が必要かなと思います。
// FIXME 本来は group とか使うのかな.. 時間なく諦めた | ||
e.GET("/incr", methodNotAllowedHandler) | ||
e.PATCH("/incr", methodNotAllowedHandler) | ||
e.PUT("/incr", methodNotAllowedHandler) | ||
e.DELETE("/incr", methodNotAllowedHandler) | ||
|
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.
てか課題2 は何も実装しなくてよかったのか!
echoがmethodの判別してくれるので不要という課題でした!
echoのGroupは、/v1/
みたいなprefixを管理する為のものですね。
incrRequest := incrRequest{} | ||
if err := c.Bind(&incrRequest); err != nil { | ||
return echo.NewHTTPError(http.StatusInternalServerError, "Internal Server Error") | ||
} |
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.
多分時間の問題だったと思うんですが、incrRequestを使ってるのが違和感あります
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.
急ぎでやったから(という言い訳
dncrResponse 作ってたけど課題4の実装でデグレってしまった
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) |
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.
デクリメントがされていない?
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.
駆け込みでやったから、、(という言い訳
課題実装しました!
時間がなく簡易実装になっちゃいましたが..
てか課題2 は何も実装しなくてよかったのか!