feat: add Go models for User and UserProfile

- Create models/user.go with bcrypt password hashing
- Create models/user_profile.go with foreign key relationship
- Add GORM hooks for automatic profile creation
- Include proper JSON tags and database constraints
This commit is contained in:
Cipher Vance 2025-09-18 20:06:36 -05:00
parent e40a119bdc
commit 3ed698918b
5 changed files with 52 additions and 75 deletions

12
models/user_profile.go Normal file
View file

@ -0,0 +1,12 @@
package models
type UserProfile struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"not null" json:"user_id"`
FirstName string `gorm:"size:80;not null" json:"first_name"`
LastName string `gorm:"size:80;not null" json:"last_name"`
Bio string `gorm:"type:text" json:"bio"`
ProfilePicture string `gorm:"size:255" json:"profile_picture"`
User *User `gorm:"foreignKey:UserID" json:"user,omitempty"`
}