mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: 后端包结构重构、去除无用的文件
This commit is contained in:
		
							
								
								
									
										22
									
								
								server/internal/devops/domain/entity/db.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								server/internal/devops/domain/entity/db.go
									
									
									
									
									
										Normal 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										15
									
								
								server/internal/devops/domain/entity/db_sql.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								server/internal/devops/domain/entity/db_sql.go
									
									
									
									
									
										Normal 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"`
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								server/internal/devops/domain/entity/machine.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								server/internal/devops/domain/entity/machine.go
									
									
									
									
									
										Normal 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 // 禁用状态
 | 
			
		||||
)
 | 
			
		||||
							
								
								
									
										13
									
								
								server/internal/devops/domain/entity/machine_file.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								server/internal/devops/domain/entity/machine_file.go
									
									
									
									
									
										Normal 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"`
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								server/internal/devops/domain/entity/machine_monitor.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								server/internal/devops/domain/entity/machine_monitor.go
									
									
									
									
									
										Normal 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"`
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										13
									
								
								server/internal/devops/domain/entity/machine_script.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								server/internal/devops/domain/entity/machine_script.go
									
									
									
									
									
										Normal 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"`      // 脚本内容
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								server/internal/devops/domain/entity/mongo.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								server/internal/devops/domain/entity/mongo.go
									
									
									
									
									
										Normal 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"`
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								server/internal/devops/domain/entity/project.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								server/internal/devops/domain/entity/project.go
									
									
									
									
									
										Normal 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"` // 备注说明
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								server/internal/devops/domain/entity/project_env.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								server/internal/devops/domain/entity/project_env.go
									
									
									
									
									
										Normal 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"`    // 备注说明
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								server/internal/devops/domain/entity/project_member.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								server/internal/devops/domain/entity/project_member.go
									
									
									
									
									
										Normal 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								server/internal/devops/domain/entity/redis.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								server/internal/devops/domain/entity/redis.go
									
									
									
									
									
										Normal 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
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user