mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
优化模版生成
This commit is contained in:
@@ -10,14 +10,14 @@ import (
|
||||
|
||||
type SysDept struct {
|
||||
DeptId int `json:"deptId" gorm:"primary_key;auto_increment;"` //部门编码
|
||||
ParentId int `json:"parentId" gorm:""` //上级部门
|
||||
DeptPath string `json:"deptPath" gorm:"size:255;"` //
|
||||
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
|
||||
Sort int `json:"sort" gorm:""` //排序
|
||||
Leader string `json:"leader" gorm:"size:128;"` //负责人
|
||||
Phone string `json:"phone" gorm:"size:11;"` //手机
|
||||
Email string `json:"email" gorm:"size:64;"` //邮箱
|
||||
Status string `json:"status" gorm:"size:4;"` //状态
|
||||
ParentId int `json:"parentId" gorm:""` //上级部门
|
||||
DeptPath string `json:"deptPath" gorm:"size:255;"` //
|
||||
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
|
||||
Sort int `json:"sort" gorm:""` //排序
|
||||
Leader string `json:"leader" gorm:"size:128;"` //负责人
|
||||
Phone string `json:"phone" gorm:"size:11;"` //手机
|
||||
Email string `json:"email" gorm:"size:64;"` //邮箱
|
||||
Status string `json:"status" gorm:"size:4;"` //状态
|
||||
CreateBy string `json:"createBy" gorm:"size:64;"`
|
||||
UpdateBy string `json:"updateBy" gorm:"size:64;"`
|
||||
DataScope string `json:"dataScope" gorm:"-"`
|
||||
|
||||
@@ -9,18 +9,18 @@ import (
|
||||
|
||||
type DictData struct {
|
||||
DictCode int `gorm:"primary_key;auto_increment;" json:"dictCode" example:"1"` //字典编码
|
||||
DictSort int `gorm:"" json:"dictSort"` //显示顺序
|
||||
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
|
||||
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
|
||||
DictType string `gorm:"size:64;" json:"dictType"` //字典类型
|
||||
CssClass string `gorm:"size:128;" json:"cssClass"` //
|
||||
ListClass string `gorm:"size:128;" json:"listClass"` //
|
||||
IsDefault string `gorm:"size:8;" json:"isDefault"` //
|
||||
Status string `gorm:"size:4;" json:"status"` //状态
|
||||
Default string `gorm:"size:8;" json:"default"` //
|
||||
CreateBy string `gorm:"size:64;" json:"createBy"` //
|
||||
UpdateBy string `gorm:"size:64;" json:"updateBy"` //
|
||||
Remark string `gorm:"size:255;" json:"remark"` //备注
|
||||
DictSort int `gorm:"" json:"dictSort"` //显示顺序
|
||||
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
|
||||
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
|
||||
DictType string `gorm:"size:64;" json:"dictType"` //字典类型
|
||||
CssClass string `gorm:"size:128;" json:"cssClass"` //
|
||||
ListClass string `gorm:"size:128;" json:"listClass"` //
|
||||
IsDefault string `gorm:"size:8;" json:"isDefault"` //
|
||||
Status string `gorm:"size:4;" json:"status"` //状态
|
||||
Default string `gorm:"size:8;" json:"default"` //
|
||||
CreateBy string `gorm:"size:64;" json:"createBy"` //
|
||||
UpdateBy string `gorm:"size:64;" json:"updateBy"` //
|
||||
Remark string `gorm:"size:255;" json:"remark"` //备注
|
||||
Params string `gorm:"-" json:"params"`
|
||||
DataScope string `gorm:"-" json:"dataScope"`
|
||||
BaseModel
|
||||
|
||||
@@ -12,15 +12,15 @@ import (
|
||||
|
||||
func InitDb(db *gorm.DB) (err error) {
|
||||
filePath := "config/db.sql"
|
||||
err = ExecSql(db,filePath)
|
||||
err = ExecSql(db, filePath)
|
||||
if global.Driver == "postgres" {
|
||||
filePath = "config/pg.sql"
|
||||
err = ExecSql(db,filePath)
|
||||
err = ExecSql(db, filePath)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func ExecSql(db *gorm.DB,filePath string) error {
|
||||
func ExecSql(db *gorm.DB, filePath string) error {
|
||||
sql, err := Ioutil(filePath)
|
||||
if err != nil {
|
||||
fmt.Println("数据库基础数据初始化脚本读取失败!原因:", err.Error())
|
||||
|
||||
@@ -8,19 +8,19 @@ import (
|
||||
|
||||
type LoginLog struct {
|
||||
InfoId int `json:"infoId" gorm:"primary_key;auto_increment;"` //主键
|
||||
Username string `json:"username" gorm:"size:128;"` //用户名
|
||||
Status string `json:"status" gorm:"size:4;"` //状态
|
||||
Ipaddr string `json:"ipaddr" gorm:"size:255;"` //ip地址
|
||||
LoginLocation string `json:"loginLocation" gorm:"size:255;"` //归属地
|
||||
Browser string `json:"browser" gorm:"size:255;"` //浏览器
|
||||
Os string `json:"os" gorm:"size:255;"` //系统
|
||||
Platform string `json:"platform" gorm:"size:255;"` // 固件
|
||||
LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;"` //登录时间
|
||||
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
|
||||
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
|
||||
DataScope string `json:"dataScope" gorm:"-"` //数据
|
||||
Params string `json:"params" gorm:"-"` //
|
||||
Remark string `json:"remark" gorm:"size:255;"` //备注
|
||||
Username string `json:"username" gorm:"size:128;"` //用户名
|
||||
Status string `json:"status" gorm:"size:4;"` //状态
|
||||
Ipaddr string `json:"ipaddr" gorm:"size:255;"` //ip地址
|
||||
LoginLocation string `json:"loginLocation" gorm:"size:255;"` //归属地
|
||||
Browser string `json:"browser" gorm:"size:255;"` //浏览器
|
||||
Os string `json:"os" gorm:"size:255;"` //系统
|
||||
Platform string `json:"platform" gorm:"size:255;"` // 固件
|
||||
LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;"` //登录时间
|
||||
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
|
||||
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
|
||||
DataScope string `json:"dataScope" gorm:"-"` //数据
|
||||
Params string `json:"params" gorm:"-"` //
|
||||
Remark string `json:"remark" gorm:"size:255;"` //备注
|
||||
Msg string `json:"msg" gorm:"size:255;"`
|
||||
BaseModel
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ type SysJobControl struct {
|
||||
CronExpression string `json:"cronExpression"` // cron表达式
|
||||
InvokeTarget string `json:"invokeTarget"` // 调用目标
|
||||
Args string `json:"args"` // 目标参数
|
||||
MisfirePolicy int `json:"misfirePolicy"` // 执行策略
|
||||
MisfirePolicy int `json:"misfirePolicy"` // 执行策略
|
||||
Concurrent int `json:"concurrent"` // 是否并发
|
||||
Status int `json:"status"` // 状态
|
||||
EntryId int `json:"entryId"` // job启动时返回的id
|
||||
EntryId int `json:"entryId"` // job启动时返回的id
|
||||
}
|
||||
|
||||
func (s *SysJobControl) Bind(ctx *gin.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user