Skip to content
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

Feature/profile settings and updates #12

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

take-2405
Copy link
Contributor

[担当者]
Resnsサーバー:堺
[目的]
ユーザーのプロフィール設定の機能
[レビューして欲しいところ]
機能が十分か
無駄な記述がないか

@take-2405 take-2405 added the wontfix This will not be worked on label Oct 9, 2020
Copy link
Contributor Author

@take-2405 take-2405 left a comment

Choose a reason for hiding this comment

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

Comment on lines 13 to 18
user model.User
name model.User
image model.User
year model.User
month model.User
gender model.User
Copy link
Contributor Author

Choose a reason for hiding this comment

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

一つで十分
user.Idとかで参照できる

)

//ユーザー情報
func HandleUserSet() gin.HandlerFunc {
return func(c *gin.Context) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

gin.contextをcと定義してるので以下の部分でcontextとなっている部分をcにするかもしくはここをcontextにするか

return func(c *gin.Context) {
if err := context.BindJSON(&HandleUserSet); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

&HandleUserSet構造体を入れる必要がある

return
}
restoken.Token = uuid.String()
if err := HandleUserUpdate(HandleUserSet.Id, HandleUserSet.Name, HandleUserSet.Image, HandleUserSet.Year, HandleUserSet.Month HandleUserSet.Gender , restoken.Token); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

引数が関数になっているので構造体にする必要がある

return func(c *gin.Context) {
stmt, err := db.Con.Prepare("INSERT INTO UserSet VALUES (?,?,?)")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mysqlのクエリが間違っている(?の数も足りない)

if err != nil {
return err
}
_, err = stmt.Exec(id, name, image, token, year, month, gender)
Copy link
Contributor 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
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants