refactor: 모델에 JSON 태그 추가 및 gorm.Model 인라인 확장
All checks were successful
Server CI/CD / deploy (push) Successful in 35s
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>
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package auth
|
||||
|
||||
import "gorm.io/gorm"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Role string
|
||||
|
||||
@@ -10,8 +14,11 @@ const (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Username string `gorm:"type:varchar(100);uniqueIndex;not null"`
|
||||
PasswordHash string `gorm:"not null"`
|
||||
Role Role `gorm:"default:'user'"`
|
||||
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'"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user