feat: CR login, register, subscribe
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package usermodel
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
subsmodel "github.com/ardeman/project-legalgo-go/database/subscribe"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
|
||||
SubscribeID string `gorm:"not null" json:"subscribe_id"`
|
||||
Email string `gorm:"unique,not null" json:"email"`
|
||||
Password string `gorm:"not null" json:"password"`
|
||||
Phone string `gorm:"default:null" json:"phone"`
|
||||
Subscribe subsmodel.Subscribe `gorm:"foreignKey:SubscribeID;constraint:OnDelete:CASCADE"`
|
||||
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user