完善季度

This commit is contained in:
2024-08-29 09:05:26 +08:00
parent 2622876c70
commit a27c5f702f
13 changed files with 292 additions and 58 deletions

31
core/init-db-data/init.go Normal file
View File

@@ -0,0 +1,31 @@
package init_db_data
import (
"fmt"
"os"
)
type InitDBFunc interface {
Init() (err error)
}
// 初始化数据库
func initDB(InitDBFunctions ...InitDBFunc) (err error) {
for _, v := range InitDBFunctions {
err = v.Init()
if err != nil {
return err
}
}
return nil
}
func InitDbData() {
err := initDB(initPeakValleyTimeBlockData)
if err != nil {
fmt.Println("[-]初始化基础数据失败:", err)
os.Exit(0)
}
}
//