diff --git a/pkg/controller/oauth_controller.go b/pkg/controller/oauth_controller.go index 978f66f..b96a3a1 100644 --- a/pkg/controller/oauth_controller.go +++ b/pkg/controller/oauth_controller.go @@ -114,8 +114,9 @@ func (ctrl *OAuthController) LineLoginCallback(c *gin.Context) { log.Printf("payload: %#v", payload) user := &model.User{ - ID: payload.Sub, - Name: payload.Name, + ID: payload.Sub, + Name: payload.Name, + PictureURL: payload.Picture, } err = ctrl.userSvc.CreateFakeUser(c, user) diff --git a/pkg/model/user.go b/pkg/model/user.go index 4a1e71c..6025a0c 100644 --- a/pkg/model/user.go +++ b/pkg/model/user.go @@ -12,6 +12,8 @@ type User struct { ID string `json:"id" gorm:"type:varchar(36);primary_key"` Name string `json:"name" gorm:"type:varchar(255);index"` // TODO: add more user info for line login and line message API identity + PictureURL string `json:"picture_url" gorm:"type:varchar(255)"` + Events []Event `gorm:"many2many:user_events;"` }