|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"gin_server_admin/core"
|
|
|
|
|
"gin_server_admin/global"
|
|
|
|
|
"gin_server_admin/initialize"
|
|
|
|
|
"gin_server_admin/scheduledtask"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//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 Swagger Example API
|
|
|
|
|
// @version 0.0.1
|
|
|
|
|
// @description This is a sample Server pets
|
|
|
|
|
// @securityDefinitions.apikey ApiKeyAuth
|
|
|
|
|
// @in header
|
|
|
|
|
// @name x-token
|
|
|
|
|
// @BasePath /
|
|
|
|
|
func main() {
|
|
|
|
|
global.GVA_VP = core.Viper() // 初始化Viper
|
|
|
|
|
global.GVA_LOG = core.Zap() // 初始化zap日志库
|
|
|
|
|
global.GVA_DB = initialize.Gorm() // gorm连接数据库
|
|
|
|
|
|
|
|
|
|
initialize.Redis() //Redis初始化
|
|
|
|
|
// Redis
|
|
|
|
|
|
|
|
|
|
initialize.Timer()
|
|
|
|
|
if global.GVA_DB != nil {
|
|
|
|
|
initialize.MysqlTables(global.GVA_DB) // 初始化表
|
|
|
|
|
// 程序结束前关闭数据库链接
|
|
|
|
|
db, _ := global.GVA_DB.DB()
|
|
|
|
|
defer db.Close()
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_Master = initialize.GormMysqlChange("mysqlMaster")
|
|
|
|
|
if global.GVA_DB_Master != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlMaster初始化成功\n", global.GVA_DB_Master)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_BookDate = initialize.GormMysqlChange("mysqlBookDate")
|
|
|
|
|
if global.GVA_DB_BookDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlBookDate初始化成功\n", global.GVA_DB_BookDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_WatchDate = initialize.GormMysqlChange("mysqlWatchDate")
|
|
|
|
|
if global.GVA_DB_WatchDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlWatchDate初始化成功\n", global.GVA_DB_WatchDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_ErrorSubjectDate = initialize.GormMysqlChange("mysqlErrorSubjectDate")
|
|
|
|
|
if global.GVA_DB_ErrorSubjectDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlErrorSubjectDate初始化成功\n", global.GVA_DB_ErrorSubjectDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_MyTestDate = initialize.GormMysqlChange("mysqlMyTestDate")
|
|
|
|
|
if global.GVA_DB_MyTestDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlMyTestDate初始化成功\n", global.GVA_DB_MyTestDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_BooImgkDate = initialize.GormMysqlChange("mysqlBooImgkDate")
|
|
|
|
|
if global.GVA_DB_BooImgkDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlBooImgkDate初始化成功\n", global.GVA_DB_BooImgkDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_IntegralDate = initialize.GormMysqlChange("mysqlIntegralDate")
|
|
|
|
|
if global.GVA_DB_IntegralDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlIntegralDate初始化成功\n", global.GVA_DB_IntegralDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_QADate = initialize.GormMysqlChange("mysqlQADate")
|
|
|
|
|
if global.GVA_DB_QADate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlQADate初始化成功\n", global.GVA_DB_QADate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_BillboardDate = initialize.GormMysqlChange("mysqlBillboardDate")
|
|
|
|
|
if global.GVA_DB_BillboardDate != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlBillboardDate初始化成功\n", global.GVA_DB_BillboardDate)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_HealthReport = initialize.GormMysqlChange("mysqlHealthReportDate")
|
|
|
|
|
if global.GVA_DB_HealthReport != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlHealthReportDate初始化成功\n", global.GVA_DB_HealthReport)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_ApprovalProcess = initialize.GormMysqlChange("mysqlApprovalProcess")
|
|
|
|
|
if global.GVA_DB_ApprovalProcess != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlApprovalProcess初始化成功\n", global.GVA_DB_ApprovalProcess)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_Performanceappraisal = initialize.GormMysqlChange("mysqlPerformanceappraisal")
|
|
|
|
|
if global.GVA_DB_Performanceappraisal != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlApprovalProcess初始化成功\n", global.GVA_DB_Performanceappraisal)
|
|
|
|
|
}
|
|
|
|
|
global.GVA_DB_WechatCallBack = initialize.GormMysqlChange("mysqlWechatCallBack")
|
|
|
|
|
if global.GVA_DB_Performanceappraisal != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库mysqlWechatCallBack初始化成功\n", global.GVA_DB_WechatCallBack)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
global.GVA_DB_HrDataBase = initialize.GormMysqlChange("hrdatabase")
|
|
|
|
|
if global.GVA_DB_Performanceappraisal != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库hrdatabase初始化成功\n", global.GVA_DB_HrDataBase)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
global.GVA_DB_HrKingDee = initialize.GormMysqlChange("hrdatabasekingdee")
|
|
|
|
|
if global.GVA_DB_Performanceappraisal != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库HrKingDee初始化成功\n", global.GVA_DB_HrKingDee)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
global.GVA_DB_System_Permission = initialize.GormMysqlChange("systemPermission")
|
|
|
|
|
if global.GVA_DB_Performanceappraisal != nil {
|
|
|
|
|
fmt.Printf("%v==>数据库Permission初始化成功\n", global.GVA_DB_System_Permission)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scheduledtask.TimeTask()
|
|
|
|
|
// fmt.Printf("WEiXin------>%v===>%v----->%v----->%v\n", global.GVA_CONFIG.WorkWechatId, global.GVA_CONFIG.WorkWechatSchool, global.GVA_CONFIG.WorkWechatMailList, global.GVA_CONFIG.WorkHealthReport)
|
|
|
|
|
// fmt.Printf("jkskd => %v===>%v----->%v\n", global.GVA_CONFIG.MyConfig.AppKey, global.GVA_CONFIG.MyConfig.Visit, global.GVA_CONFIG)
|
|
|
|
|
// fmt.Printf("%v===>%v----->%v\n", global.GVA_CONFIG.WorkWechatIds, global.GVA_CONFIG.WorkWechatSchools, global.GVA_CONFIG.WorkWechatMailLists)MysqlHealthReportDate
|
|
|
|
|
core.RunWindowsServer()
|
|
|
|
|
|
|
|
|
|
}
|