lxz 2 روز پیش
والد
کامیت
18ef1a31ce

+ 3 - 3
DHCP/api/api.go

@@ -1,11 +1,11 @@
 package api
 
 import (
+	"dhcp/api/request"
 	"dhcp/global"
-	"dhcp/ip"
-	"dhcp/request"
+	"dhcp/internal/ip"
+	"dhcp/internal/service"
 	"dhcp/result"
-	"dhcp/service"
 	"github.com/gin-gonic/gin"
 )
 

+ 0 - 0
DHCP/request/requst.go → DHCP/api/request/requst.go


+ 0 - 5
DHCP/code/common.go

@@ -17,8 +17,3 @@ const (
 	DELETE_FROM_DATABASE_EXCEPTION = 10005 // 删除数据库数据异常
 	CONN_DATABASE_EXCEPTION        = 10006 // 连接数据库异常
 )
-
-const (
-	FILE_UPLOAD_EXCEPTION = 20001 // 文件上传异常
-	INVALID_PARAMS        = 1001  // 参数错误
-)

+ 0 - 3
DHCP/global/global.go

@@ -2,11 +2,8 @@ package global
 
 import (
 	"github.com/go-logr/logr"
-	"gorm.io/gorm"
 )
 
-var DB *gorm.DB
-
 var Log logr.Logger
 
 type JWTConfig struct {

+ 2 - 2
DHCP/backend/backend.go → DHCP/internal/backend/backend.go

@@ -2,8 +2,8 @@ package backend
 
 import (
 	"context"
-	"dhcp/data"
-	"dhcp/handler"
+	"dhcp/internal/data"
+	"dhcp/internal/handler"
 	"errors"
 	"net"
 	"net/netip"

+ 0 - 0
DHCP/backend/dhcp.go → DHCP/internal/backend/dhcp.go


+ 0 - 0
DHCP/data/data.go → DHCP/internal/data/data.go


+ 0 - 0
DHCP/ip/IP.go → DHCP/internal/ip/IP.go


+ 5 - 5
DHCP/service/dhcp.go → DHCP/internal/service/dhcp.go

@@ -2,13 +2,13 @@ package service
 
 import (
 	"context"
-	"dhcp/backend"
+	"dhcp/api/request"
 	"dhcp/code"
-	"dhcp/handler/proxy"
-	"dhcp/ip"
-	"dhcp/request"
+	"dhcp/internal/backend"
+	"dhcp/internal/handler/proxy"
+	"dhcp/internal/ip"
+	"dhcp/internal/server"
 	"dhcp/result"
-	"dhcp/server"
 	"fmt"
 	"github.com/go-logr/logr"
 	"github.com/insomniacslk/dhcp/dhcpv4/server4"

+ 0 - 19
DHCP/response/response.go

@@ -1,19 +0,0 @@
-package response
-
-type AllInfo struct {
-	BmcID            int    `json:"bmcId" `            //bmc的id
-	BMCName          string `json:"BMCname" `          //名字
-	BMCMac           string `json:"BMCMac" `           //bmc的物理地址
-	ServerMac        string `json:"serverMac"`         //服务器网卡的物理地址
-	BmcIP            string `json:"bmcIP" `            //bmc的ip地址
-	BMCSubnetMask    string `json:"BMCSubnetMask"`     //bmc的子网掩码
-	Username         string `json:"username"`          //bmc的用户名
-	Password         string `json:"password" `         //bmc的密码
-	ServerID         int    `json:"serverID" `         //服务器的id
-	ServerName       string `json:"serverName"    `    //服务器名
-	ServerIP         string `json:"serverIP" `         //服务器的ip地址
-	ServerSubnetMask string `json:"serverSubnetMask" ` //服务器的子网掩码
-	ImageID          int    `json:"imageID"`           // 系统镜像id
-	ImageAndConfig   string `json:"imageAndConfig"`    // 系统镜像及配置名
-	IPXEScriptURL    string `json:"ipxeScriptUrl"`     // 脚本地址 覆盖在启动时传递到DHCP的默认值。
-}