refactor: 모델에 JSON 태그 추가 및 gorm.Model 인라인 확장
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:
2026-02-24 14:32:11 +09:00
parent 05d6d5af4d
commit ec6ac35ac7
3 changed files with 36 additions and 15 deletions

View File

@@ -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'"`
}