1 Star 0 Fork 0

water/gowater

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
general_rule.go 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
leijmdas 提交于 2025-06-22 20:13 +08:00 . add
package entity
import (
"gitee.com/leijmdas/goweb/godb/generaldao"
"github.com/jinzhu/gorm"
"time"
)
/*
@Title 文件名称: general_rule.go
@Description 描述: 统一返回结构
@Author 作者: raymond@163.com 时间(2025-02-03 10:56:35)
@Update 作者: raymond@163.com 时间(2025-02-03 10:56:35)
*/
type GeneralRule struct {
basedto.BaseEntity `gorm:"-"`
Id int64 `json:"id,string" gorm:"column:id;AUTO_INCREMENT;comment:''"`
CreatedBy int64 `json:"created_by,string" gorm:"column:created_by;type:bigint(20);comment:'创建者';default:-1"`
Rule string `json:"rule" gorm:"column:rule;type:mediumtext;comment:''"`
Result string `json:"result" gorm:"column:result;type:mediumtext;comment:''"`
Param string `json:"param" gorm:"column:param;type:mediumtext;comment:''"`
FuncType string `json:"func_type" gorm:"column:func_type;type:varchar(255);comment:''"`
FuncName string `json:"func_name" gorm:"column:func_name;type:varchar(255);comment:''"`
FuncId string `json:"func_id" gorm:"column:func_id;type:varchar(255);comment:''"`
Domain string `json:"domain" gorm:"column:domain;type:varchar(255);comment:''"`
Description string `json:"description" gorm:"column:description;type:varchar(255);comment:''"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:datetime;comment:''"`
}
type GeneralRuleDto struct {
basedto.BaseEntity
Id int64 `json:"id,string"`
CreatedBy int64 `json:"created_by,string"`
Rule string `json:"rule"`
Result string `json:"result"`
Param string `json:"param"`
FuncType string `json:"func_type"`
FuncName string `json:"func_name"`
FuncId string `json:"func_id"`
Domain string `json:"domain"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
}
func NewGeneralRule() *GeneralRule {
return &GeneralRule{}
}
func (self *GeneralRule) PkeyName() string {
return "id"
}
func (self *GeneralRule) PkeyValue() int64 {
return self.Id
}
func (self *GeneralRule) TableName() string {
return "general_rule0"
}
func (self *GeneralRule) NewDao() *generaldao.BaseDao[int64, *GeneralRule] {
return generaldao.NewBaseDao[int64, *GeneralRule]()
}
func NewDaoGeneralRule() *generaldao.BaseDao[int64, *GeneralRule] {
return generaldao.NewBaseDao[int64, *GeneralRule]()
}
func (self *GeneralRule) AutoMigrate(db *gorm.DB) error {
err := db.AutoMigrate(self).Error
//self.execComment(db)
return err
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leijmdas/gowater.git
git@gitee.com:leijmdas/gowater.git
leijmdas
gowater
gowater
600342654330

搜索帮助