You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
848 B
35 lines
848 B
6 months ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"bkb-seller/core"
|
||
|
_ "bkb-seller/docs"
|
||
|
"bkb-seller/global"
|
||
|
"bkb-seller/initialize"
|
||
|
)
|
||
|
|
||
|
//go:generate go env -w GO111MODULE=on
|
||
|
//go:generate go env -w GOPROXY=https://goproxy.cn,direct
|
||
|
//go:generate go mod tidy
|
||
|
//go:generate go mod download
|
||
|
|
||
|
// @title seller
|
||
|
// @version 0.0.1
|
||
|
// @securityDefinitions.apikey ApiKeyAuth
|
||
|
// @in header
|
||
|
// @name x-token
|
||
|
// @BasePath /
|
||
|
func main() {
|
||
|
global.MG_VP = core.Viper() // 初始化Viper
|
||
|
global.MG_LOG = core.Zap() // 初始化zap日志库
|
||
|
global.MG_DB = initialize.Gorm() // gorm连接数据库
|
||
|
initialize.Timer()
|
||
|
initialize.InitNacosClient() //初始化微服务连接
|
||
|
if global.MG_DB != nil {
|
||
|
initialize.MysqlTables(global.MG_DB) //初始化表
|
||
|
// 程序结束前关闭数据库链接
|
||
|
db, _ := global.MG_DB.DB()
|
||
|
defer db.Close()
|
||
|
}
|
||
|
core.RunWindowsServer()
|
||
|
}
|