liuxiaolong
2019-06-28 be64cfabbce01effd524ce1a56deca1558466f80
fix BaseEntity
1个文件已修改
22 ■■■■ 已修改文件
models/model.go 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/model.go
@@ -4,23 +4,23 @@
type BaseEntity struct {
    Uuid        string `gorm:"primary_key" json:"uuid,omitempty" example:"XeW0HmoBevddG23Ild5o"`
    Create_time string `json:"create_time,omitempty" example:""`
    Update_time string `json:"update_time,omitempty" example:""`
    Create_by   string `json:"create_by,omitempty" example:""`
    Del_flag    string `json:"del_flag,omitempty" example:"0 未删除 1已删除"`
    Enabled     string `json:"enabled,omitempty" example:"0 生效 1未生效"`
    Id        string `gorm:"primary_key" json:"id" example:"XeW0HmoBevddG23Ild5o"`
    CreateTime string `json:"createTime,omitempty" example:""`
    UpdateTime string `json:"updateTime,omitempty" example:""`
    CreateBy   string `json:"createBy,omitempty" example:""`
    IsDelete   bool `json:"isDelete,omitempty" example:"0 未删除 1已删除"`
    Enable     bool `json:"enable,omitempty" example:"0 生效 1未生效"`
}
func (dp *BaseEntity) PriInsert() {
    dp.Create_time = time.Now().Format("2006-01-02 15:04:05")
    dp.Create_by = "admin"
    dp.Del_flag = "0"
    dp.Enabled = "0"
    dp.CreateTime = time.Now().Format("2006-01-02 15:04:05")
    dp.CreateBy = "admin"
    dp.IsDelete = false
    dp.Enable = false
}
func (dp *BaseEntity) PriUpdate() {
    dp.Update_time = time.Now().Format("2006-01-02 15:04:05")
    dp.UpdateTime = time.Now().Format("2006-01-02 15:04:05")
}
type Area struct {