Skip to content

Commit

Permalink
feat: add PictureURL field to User model
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Feb 21, 2024
1 parent 97089e2 commit 1a06f83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/oauth_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;"`
}

Expand Down

0 comments on commit 1a06f83

Please sign in to comment.