3 Star 4 Fork 0

workits / pkgs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
entity.go 747 Bytes
一键复制 编辑 原始数据 按行查看 历史
workits 提交于 2023-09-20 11:58 . add restful module
package dbx
import (
"time"
"gitee.com/chunanyong/zorm"
"github.com/jinzhu/copier"
)
type CommonEntity struct {
zorm.EntityStruct
Id int64 `column:"id"` // 主健
CreatedAt time.Time `column:"created_at"` // 创建时间
CreatedBy int64 `column:"created_by"` // 创建时间
UpdatedAt time.Time `column:"updated_at"` // 更新时间
UpdatedBy int64 `column:"updated_by"` // 更新时间
DeletedAt time.Time `column:"deleted_at"` // 删除时间
DeletedBy int64 `column:"deleted_by"` // 删除时间
}
func (entity *CommonEntity) ToModel(modelPtr any) error {
return copier.Copy(modelPtr, entity)
}
func (entity *CommonEntity) FromModel(modelPtr any) error {
return copier.Copy(entity, modelPtr)
}
Go
1
https://gitee.com/workits/pkgs.git
git@gitee.com:workits/pkgs.git
workits
pkgs
pkgs
v0.1.1

搜索帮助