All checks were successful
Server CI/CD / deploy (push) Successful in 35s
camelCase JSON 필드명으로 통일, PasswordHash json:"-" 처리 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
603 B
Go
25 lines
603 B
Go
package auth
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Role string
|
|
|
|
const (
|
|
RoleAdmin Role = "admin"
|
|
RoleUser Role = "user"
|
|
)
|
|
|
|
type User struct {
|
|
ID uint `json:"id" gorm:"primaryKey"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
|
Username string `json:"username" gorm:"type:varchar(100);uniqueIndex;not null"`
|
|
PasswordHash string `json:"-" gorm:"not null"`
|
|
Role Role `json:"role" gorm:"default:'user'"`
|
|
}
|