Apply .gitignore rules

This commit is contained in:
皮蛋13361098506
2025-01-06 16:21:36 +08:00
parent 1b77f62820
commit ccd2c530cf
580 changed files with 69806 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package main
import (
"common/connection"
"sync"
_ "admincenter/internal/admin"
_ "common/resultStatus"
"common/webServer"
)
var (
wg sync.WaitGroup
)
func init() {
// 设置WaitGroup需要等待的数量只要有一个服务器出现错误都停止服务器
wg.Add(1)
}
func main() {
//加载配置
loadConfig()
// 启动webserver
go webServer.Start(&wg)
// 阻塞等待以免main线程退出
wg.Wait()
}
// loadConfig 用于加载配置信息。
// 该函数会读取配置文件或环境变量中的设置,并根据这些设置初始化程序所需的配置。
// 目前函数的实现为空,需要根据实际的配置加载逻辑进行填充。
func loadConfig() {
//构建数据库
connection.BuildDB()
}

View File

@@ -0,0 +1,15 @@
package managecenterModel
// 服务器状态
type MaintainType int32
const (
// 计划维护
Con_MaintainType_PlanMaintain MaintainType = 1
// 开始维护
Con_MaintainType_BeginMaintain MaintainType = 2
// 结束维护
Con_MaintainType_EndMaintain MaintainType = 3
)

View File

@@ -0,0 +1,66 @@
package debugUtil
import (
"github.com/fatih/color"
)
var (
isDebug = false
code Code = Code_Bold
foregroundColor ForegroundColor = Foreground_Purple
backgroundColor BackgroundColor = BackgroundColor_Black
colorObj = color.New(foregroundColor, code)
)
// 设置DEBUG状态
// _isDebug是否是DEBUG
func SetDebug(_isDebug bool) {
isDebug = _isDebug
}
// 是否处于调试状态
func IsDebug() bool {
return isDebug
}
// 设置显示信息
func SetDisplayInfo(_code Code, _foregroundColor ForegroundColor, _backgroundColor BackgroundColor) {
code = _code
foregroundColor = _foregroundColor
backgroundColor = _backgroundColor
colorObj = color.New(foregroundColor, code)
}
// Print formats using the default formats for its operands and writes to standard output.
// Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered.
func Print(a ...interface{}) {
if !isDebug {
return
}
_, _ = colorObj.Print(a...)
}
// Printf formats according to a format specifier and writes to standard output.
// It returns the number of bytes written and any write error encountered.
func Printf(format string, a ...interface{}) {
if !isDebug {
return
}
_, _ = colorObj.Printf(format, a...)
}
// Println formats using the default formats for its operands and writes to standard output.
// Spaces are always added between operands and a newline is appended.
// It returns the number of bytes written and any write error encountered.
func Println(a ...interface{}) {
if !isDebug {
return
}
_, _ = colorObj.Println(a...)
}

View File

@@ -0,0 +1,3 @@
package impl_localfile
// 包名不能采用中分线而且前面的包已经说明了是log包这个子文件夹不需要在加上log