fix: return user fields in lower-case json for aftersales relations
This commit is contained in:
+10
-10
@@ -8,16 +8,16 @@ import (
|
|||||||
|
|
||||||
// User 模型
|
// User 模型
|
||||||
type User struct {
|
type User struct {
|
||||||
ID uint `gorm:"primaryKey"`
|
ID uint `gorm:"primaryKey" json:"id"`
|
||||||
Username string `gorm:"uniqueIndex;size:255"`
|
Username string `gorm:"uniqueIndex;size:255" json:"username"`
|
||||||
Password string `gorm:"size:255"`
|
Password string `gorm:"size:255" json:"-"`
|
||||||
Name string `gorm:"size:255"`
|
Name string `gorm:"size:255" json:"name"`
|
||||||
Email string `gorm:"size:255"`
|
Email string `gorm:"size:255" json:"email"`
|
||||||
Role string `gorm:"size:50;default:'user'"`
|
Role string `gorm:"size:50;default:'user'" json:"role"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||||
Serials []Serial `gorm:"foreignKey:CreatedBy"`
|
Serials []Serial `gorm:"foreignKey:CreatedBy" json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Company 模型
|
// Company 模型
|
||||||
|
|||||||
Reference in New Issue
Block a user