...
|
...
|
@@ -5,14 +5,14 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain"
|
|
|
"gorm.io/gorm"
|
|
|
"gorm.io/plugin/soft_delete"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type Department struct {
|
|
|
Id int64 // 唯一标识
|
|
|
CompanyId int64 `json:"companyId,omitempty"` // 公司ID
|
|
|
ParentId int64 `json:"parentId,omitempty"` // 父级ID
|
|
|
Name string `json:"name,omitempty"` // 部门名称
|
|
|
|
|
|
Id int64 // 唯一标识
|
|
|
CompanyId int64 `json:"companyId,omitempty"` // 公司ID
|
|
|
ParentId int64 `json:"parentId,omitempty"` // 父级ID
|
|
|
Name string `json:"name,omitempty"` // 部门名称
|
|
|
CreatedAt int64 `json:"createdAt,omitempty"`
|
|
|
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
|
|
DeletedAt int64 `json:"deletedAt,omitempty"`
|
...
|
...
|
@@ -25,13 +25,13 @@ func (m *Department) TableName() string { |
|
|
}
|
|
|
|
|
|
func (m *Department) BeforeCreate(tx *gorm.DB) (err error) {
|
|
|
// m.CreatedAt = time.Now().Unix()
|
|
|
// m.UpdatedAt = time.Now().Unix()
|
|
|
m.CreatedAt = time.Now().Unix()
|
|
|
m.UpdatedAt = time.Now().Unix()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func (m *Department) BeforeUpdate(tx *gorm.DB) (err error) {
|
|
|
// m.UpdatedAt = time.Now().Unix()
|
|
|
m.UpdatedAt = time.Now().Unix()
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
|