refactor: 把 deleted_at 分离出来
This commit is contained in:
parent
d74d4a5348
commit
437cd18dc7
@ -22,6 +22,7 @@ type User struct {
|
|||||||
ID int64
|
ID int64
|
||||||
Name string
|
Name string
|
||||||
Timestamps
|
Timestamps
|
||||||
|
SoftDelete
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u User) ConfigureEntity(e *EntityConfigurator) {
|
func (u User) ConfigureEntity(e *EntityConfigurator) {
|
||||||
|
@ -35,6 +35,7 @@ type Object struct {
|
|||||||
ID int64
|
ID int64
|
||||||
Name string
|
Name string
|
||||||
Timestamps
|
Timestamps
|
||||||
|
SoftDelete
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o Object) ConfigureEntity(e *EntityConfigurator) {
|
func (o Object) ConfigureEntity(e *EntityConfigurator) {
|
||||||
|
@ -14,5 +14,8 @@ import (
|
|||||||
type Timestamps struct {
|
type Timestamps struct {
|
||||||
CreatedAt sql.NullTime
|
CreatedAt sql.NullTime
|
||||||
UpdatedAt sql.NullTime
|
UpdatedAt sql.NullTime
|
||||||
|
}
|
||||||
|
|
||||||
|
type SoftDelete struct {
|
||||||
DeletedAt sql.NullTime
|
DeletedAt sql.NullTime
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user