Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
22
pkg/common/dbbasemodel/dbbase.go
Normal file
22
pkg/common/dbbasemodel/dbbase.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package dbbasemodel
|
||||
|
||||
import "time"
|
||||
|
||||
type DBModelBase struct {
|
||||
CreatedAt *time.Time `pg:"default:now()" json:"created,omitempty" swaggerignore:"true"`
|
||||
UpdatedAt *time.Time `pg:"default:now()" json:"updated,omitempty" swaggerignore:"true"`
|
||||
}
|
||||
|
||||
func (d *DBModelBase) ClearCreatedAt() {
|
||||
d.CreatedAt = nil
|
||||
}
|
||||
|
||||
func (d *DBModelBase) ClearDates() {
|
||||
d.CreatedAt = nil
|
||||
d.UpdatedAt = nil
|
||||
}
|
||||
|
||||
// Keeping the Scrub name used in other locations so people are more likely to find this function
|
||||
func (d *DBModelBase) Scrub(){
|
||||
d.ClearDates()
|
||||
}
|
||||
Reference in New Issue
Block a user