refactor: 后端包结构重构、去除无用的文件

This commit is contained in:
meilin.huang
2022-06-02 17:41:11 +08:00
parent 51d06ab206
commit b2dc9dff0b
234 changed files with 749 additions and 816 deletions

View File

@@ -0,0 +1,22 @@
package entity
import (
"mayfly-go/pkg/model"
)
type Db struct {
model.Model
Name string `orm:"column(name)" json:"name"`
Type string `orm:"column(type)" json:"type"` // 类型mysql oracle等
Host string `orm:"column(host)" json:"host"`
Port int `orm:"column(port)" json:"port"`
Network string `orm:"column(network)" json:"network"`
Username string `orm:"column(username)" json:"username"`
Password string `orm:"column(password)" json:"-"`
Database string `orm:"column(database)" json:"database"`
ProjectId uint64
Project string
EnvId uint64
Env string
}

View File

@@ -0,0 +1,15 @@
package entity
import (
"mayfly-go/pkg/model"
)
type DbSql struct {
model.Model `orm:"-"`
DbId uint64 `json:"dbId"`
Db string `json:"db"`
Type int `json:"type"` // 类型
Sql string `json:"sql"`
Name string `json:"name"`
}

View File

@@ -0,0 +1,23 @@
package entity
import (
"mayfly-go/pkg/model"
)
type Machine struct {
model.Model
ProjectId uint64 `json:"projectId"`
ProjectName string `json:"projectName"`
Name string `json:"name"`
Ip string `json:"ip"` // IP地址
Username string `json:"username"` // 用户名
Password string `json:"-"`
Port int `json:"port"` // 端口号
Status int8 `json:"status"` // 状态 1:启用2:停用
Remark string `json:"remark"` // 备注
}
const (
MachineStatusEnable int8 = 1 // 启用状态
MachineStatusDisable int8 = -1 // 禁用状态
)

View File

@@ -0,0 +1,13 @@
package entity
import "mayfly-go/pkg/model"
type MachineFile struct {
model.Model
Name string `json:"name"`
// 机器id
MachineId uint64 `json:"machineId"`
Type int `json:"type"`
// 路径
Path string `json:"path"`
}

View File

@@ -0,0 +1,14 @@
package entity
import (
"time"
)
type MachineMonitor struct {
Id uint64 `json:"id"`
MachineId uint64 `json:"machineId"`
CpuRate float32 `json:"cpuRate"`
MemRate float32 `json:"memRate"`
SysLoad string `json:"sysLoad"`
CreateTime time.Time `json:"createTime"`
}

View File

@@ -0,0 +1,13 @@
package entity
import "mayfly-go/pkg/model"
type MachineScript struct {
model.Model
Name string `json:"name"`
MachineId uint64 `json:"machineId"` // 机器id
Type int `json:"type"`
Description string `json:"description"` // 脚本描述
Params string `json:"params"` // 参数列表json
Script string `json:"script"` // 脚本内容
}

View File

@@ -0,0 +1,14 @@
package entity
import "mayfly-go/pkg/model"
type Mongo struct {
model.Model
Name string `orm:"column(name)" json:"name"`
Uri string `orm:"column(uri)" json:"uri"`
ProjectId uint64 `json:"projectId"`
Project string `json:"project"`
EnvId uint64 `json:"envId"`
Env string `json:"env"`
}

View File

@@ -0,0 +1,10 @@
package entity
import "mayfly-go/pkg/model"
// 项目
type Project struct {
model.Model
Name string `json:"name"` // 项目名
Remark string `json:"remark"` // 备注说明
}

View File

@@ -0,0 +1,11 @@
package entity
import "mayfly-go/pkg/model"
// 项目环境
type ProjectEnv struct {
model.Model
Name string `json:"name"` // 环境名
ProjectId uint64 `json:"projectId"` // 项目id
Remark string `json:"remark"` // 备注说明
}

View File

@@ -0,0 +1,11 @@
package entity
import "mayfly-go/pkg/model"
// 项目成员,用于对项目下组件的访问控制
type ProjectMember struct {
model.Model
AccountId uint64 `json:"accountId"` // 账号
Username string `json:"username"` // 账号用户名
ProjectId uint64 `json:"projectId"` // 项目id
}

View File

@@ -0,0 +1,17 @@
package entity
import (
"mayfly-go/pkg/model"
)
type Redis struct {
model.Model
Host string `orm:"column(host)" json:"host"`
Password string `orm:"column(password)" json:"-"`
Db int `orm:"column(database)" json:"db"`
ProjectId uint64
Project string
EnvId uint64
Env string
}