feat✨ 分离app
This commit is contained in:
1 parent
c6d94c03fb
commit
7fffcffcdd
68 files changed
+590
-478
No files matched your search
@@ -1,29 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"go-admin/common/models"
|
||||
)
|
||||
|
||||
type SysCategory struct {
|
||||
models.Model
|
||||
Name string `json:"name" gorm:"type:varchar(255);comment:名称"` //
|
||||
Img string `json:"img" gorm:"type:varchar(255);comment:图标"` //
|
||||
Sort int `json:"sort" gorm:"type:int(4);comment:排序"` //
|
||||
Status int `json:"status" gorm:"type:int(1);comment:状态"` //
|
||||
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` //
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
}
|
||||
|
||||
func (SysCategory) TableName() string {
|
||||
return "sys_category"
|
||||
}
|
||||
|
||||
func (e *SysCategory) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysCategory) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"go-admin/common/models"
|
||||
)
|
||||
|
||||
type SysChinaAreaData struct {
|
||||
models.Model
|
||||
|
||||
PId string `json:"pId" gorm:"type:int(11);comment:上级编码"`
|
||||
Name string `json:"name" gorm:"type:varchar(128);comment:名称"`
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
}
|
||||
|
||||
func (SysChinaAreaData) TableName() string {
|
||||
return "sys_china_area_data"
|
||||
}
|
||||
|
||||
func (e *SysChinaAreaData) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysChinaAreaData) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"go-admin/common/models"
|
||||
)
|
||||
|
||||
type SysContent struct {
|
||||
models.Model
|
||||
CateId int `json:"cateId" gorm:"type:int(11);comment:分类id"`
|
||||
Name string `json:"name" gorm:"type:varchar(255);comment:名称"`
|
||||
Status int `json:"status" gorm:"type:int(1);comment:状态"`
|
||||
Img string `json:"img" gorm:"type:varchar(255);comment:图片"`
|
||||
Content string `json:"content" gorm:"type:text;comment:内容"`
|
||||
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
|
||||
Sort int `json:"sort" gorm:"type:int(4);comment:排序"`
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
}
|
||||
|
||||
// TableName
|
||||
func (SysContent) TableName() string {
|
||||
return "sys_content"
|
||||
}
|
||||
|
||||
// Generate
|
||||
func (e *SysContent) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysContent) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"go-admin/common/models"
|
||||
)
|
||||
|
||||
type SysFileDir struct {
|
||||
models.Model
|
||||
Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
|
||||
PId int `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
|
||||
Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
|
||||
Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
|
||||
Children []SysFileDir `json:"children,omitempty" gorm:"-"` // 下级信息
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
}
|
||||
|
||||
type SysFileDirL struct {
|
||||
models.Model
|
||||
Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
|
||||
PId int `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
|
||||
Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
|
||||
Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
Children []SysFileDirL `json:"children,omitempty" gorm:"-"` // 下级信息
|
||||
}
|
||||
|
||||
func (SysFileDir) TableName() string { /**/
|
||||
return "sys_file_dir"
|
||||
}
|
||||
|
||||
func (e *SysFileDir) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysFileDir) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"go-admin/common/models"
|
||||
)
|
||||
|
||||
type SysFileInfo struct {
|
||||
models.Model
|
||||
Type string `json:"type" gorm:"type:varchar(255);comment:类型"` //
|
||||
Name string `json:"name" gorm:"type:varchar(255);comment:名称"` //
|
||||
Size string `json:"size" gorm:"type:int(11);comment:大小"` //
|
||||
PId int `json:"pId" gorm:"type:int(11);comment:目录"` //
|
||||
Source string `json:"source" gorm:"type:varchar(255);comment:来源"` //
|
||||
Url string `json:"url" gorm:"type:varchar(255);comment:地址"` //
|
||||
FullUrl string `json:"fullUrl" gorm:"type:varchar(255);comment:全地址"` //
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
}
|
||||
|
||||
func (SysFileInfo) TableName() string {
|
||||
return "sys_file_info"
|
||||
}
|
||||
|
||||
func (e *SysFileInfo) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysFileInfo) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"go-admin/common/models"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type SysJob struct {
|
||||
JobId int `json:"jobId" gorm:"primaryKey;autoIncrement"` // 编码
|
||||
JobName string `json:"jobName" gorm:"size:255;"` // 名称
|
||||
JobGroup string `json:"jobGroup" gorm:"size:255;"` // 任务分组
|
||||
JobType int `json:"jobType" gorm:"size:1;"` // 任务类型
|
||||
CronExpression string `json:"cronExpression" gorm:"size:255;"` // cron表达式
|
||||
InvokeTarget string `json:"invokeTarget" gorm:"size:255;"` // 调用目标
|
||||
Args string `json:"args" gorm:"size:255;"` // 目标参数
|
||||
MisfirePolicy int `json:"misfirePolicy" gorm:"size:255;"` // 执行策略
|
||||
Concurrent int `json:"concurrent" gorm:"size:1;"` // 是否并发
|
||||
Status int `json:"status" gorm:"size:1;"` // 状态
|
||||
EntryId int `json:"entry_id" gorm:"size:11;"` // job启动时返回的id
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
|
||||
DataScope string `json:"dataScope" gorm:"-"`
|
||||
}
|
||||
|
||||
func (SysJob) TableName() string {
|
||||
return "sys_job"
|
||||
}
|
||||
|
||||
func (e *SysJob) Generate() models.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysJob) GetId() interface{} {
|
||||
return e.JobId
|
||||
}
|
||||
|
||||
func (e *SysJob) SetCreateBy(createBy int) {
|
||||
e.CreateBy = createBy
|
||||
}
|
||||
|
||||
func (e *SysJob) SetUpdateBy(updateBy int) {
|
||||
e.UpdateBy = updateBy
|
||||
}
|
||||
|
||||
// 创建SysJob
|
||||
//func (e *SysJob) Create() (err error) {
|
||||
// return orm.Eloquent.Table(e.TableName()).Create(e).Error
|
||||
//}
|
||||
|
||||
// 获取SysJob
|
||||
//func (e *SysJob) Get(id interface{}) (err error) {
|
||||
// return orm.Eloquent.Table(e.TableName()).First(e, id).Error
|
||||
//}
|
||||
|
||||
// 获取SysJob带分页
|
||||
//func (e *SysJob) GetPage(pageSize int, pageIndex int, v interface{}, list interface{}) (int, error) {
|
||||
// table := orm.Eloquent.Table(e.TableName()).Scopes(dto.MakeCondition(v))
|
||||
//
|
||||
// // 数据权限控制(如果不需要数据权限请将此处去掉)
|
||||
// //dataPermission := new(DataPermission)
|
||||
// userid, _ := tools.StringToInt(e.DataScope)
|
||||
//
|
||||
// var count int64
|
||||
//
|
||||
// if err := table.Scopes(system.DataScopes(e.TableName(), userid), dto.Paginate(pageSize, pageIndex)).Find(list).Offset(-1).Limit(-1).Count(&count).Error; err != nil {
|
||||
// return 0, err
|
||||
// }
|
||||
// return int(count), nil
|
||||
//}
|
||||
|
||||
func (e *SysJob) GetList(tx *gorm.DB, list interface{}) (err error) {
|
||||
return tx.Table(e.TableName()).Where("status = ?", 2).Find(list).Error
|
||||
}
|
||||
|
||||
// 更新SysJob
|
||||
func (e *SysJob) Update(tx *gorm.DB, id interface{}) (err error) {
|
||||
return tx.Table(e.TableName()).Where(id).Updates(&e).Error
|
||||
}
|
||||
|
||||
func (e *SysJob) RemoveAllEntryID(tx *gorm.DB) (update SysJob, err error) {
|
||||
if err = tx.Table(e.TableName()).Where("entry_id > ?", 0).Update("entry_id", 0).Error; err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//func (e *SysJob) RemoveEntryID(entryID int) (update SysJob, err error) {
|
||||
// if err = orm.Eloquent.Table(e.TableName()).Where("entry_id = ?", entryID).Updates(map[string]interface{}{"entry_id": 0}).Error; err != nil {
|
||||
// return
|
||||
// }
|
||||
// return
|
||||
//}
|
||||
|
||||
// 删除SysJob
|
||||
//func (e *SysJob) Delete(id int) (success bool, err error) {
|
||||
// if err = orm.Eloquent.Table(e.TableName()).Where(id).Delete(&SysJob{}).Error; err != nil {
|
||||
// success = false
|
||||
// return
|
||||
// }
|
||||
// success = true
|
||||
// return
|
||||
//}
|
||||
|
||||
//批量删除
|
||||
//func (e *SysJob) BatchDelete(id []int) error {
|
||||
// return orm.Eloquent.Table(e.TableName()).Where(id).Delete(&SysJob{}).Error
|
||||
//}
|
||||
Reference in new issue
Block a user