-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: develop
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.
api2/pkg/server/controller/user.go
Outdated
user model.User | ||
name model.User | ||
image model.User | ||
year model.User | ||
month model.User | ||
gender model.User |
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.
一つで十分
user.Idとかで参照できる
api2/pkg/server/controller/user.go
Outdated
) | ||
|
||
//ユーザー情報 | ||
func HandleUserSet() gin.HandlerFunc { | ||
return func(c *gin.Context) { |
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.
gin.contextをcと定義してるので以下の部分でcontextとなっている部分をcにするかもしくはここをcontextにするか
api2/pkg/server/controller/user.go
Outdated
return func(c *gin.Context) { | ||
if err := context.BindJSON(&HandleUserSet); err != nil { |
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.
&HandleUserSet構造体を入れる必要がある
api2/pkg/server/controller/user.go
Outdated
return | ||
} | ||
restoken.Token = uuid.String() | ||
if err := HandleUserUpdate(HandleUserSet.Id, HandleUserSet.Name, HandleUserSet.Image, HandleUserSet.Year, HandleUserSet.Month HandleUserSet.Gender , restoken.Token); err != nil { |
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.
引数が関数になっているので構造体にする必要がある
api2/pkg/server/controller/user.go
Outdated
return func(c *gin.Context) { | ||
stmt, err := db.Con.Prepare("INSERT INTO UserSet VALUES (?,?,?)") |
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.
Mysqlのクエリが間違っている(?の数も足りない)
api2/pkg/server/controller/user.go
Outdated
if err != nil { | ||
return err | ||
} | ||
_, err = stmt.Exec(id, name, image, token, year, month, gender) |
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.
引数の順番も注意
[担当者]
Resnsサーバー:堺
[目的]
ユーザーのプロフィール設定の機能
[レビューして欲しいところ]
機能が十分か
無駄な記述がないか