2022-09-07 09:06:05 +08:00
|
|
|
package main
|
|
|
|
|
2023-06-15 16:49:21 +08:00
|
|
|
import (
|
|
|
|
"github.com/robfig/cron/v3"
|
2024-04-30 19:22:19 +08:00
|
|
|
"go.uber.org/zap"
|
|
|
|
"jcc-schedule/core"
|
|
|
|
"jcc-schedule/global"
|
2024-03-08 17:23:45 +08:00
|
|
|
"jcc-schedule/pkg/apiserver"
|
2024-03-22 17:27:07 +08:00
|
|
|
internalCron "jcc-schedule/pkg/cron"
|
2023-06-15 16:49:21 +08:00
|
|
|
)
|
2022-09-07 09:06:05 +08:00
|
|
|
|
|
|
|
// @title jcc调度中心
|
|
|
|
// @version 1.0
|
|
|
|
// @description jcc
|
|
|
|
func main() {
|
2024-04-30 19:22:19 +08:00
|
|
|
global.PCM_VP = core.Viper() // 初始化viper
|
|
|
|
global.PCM_LOG = core.Zap() // 初始化zap日志
|
|
|
|
zap.ReplaceGlobals(global.PCM_LOG)
|
|
|
|
|
2024-03-08 17:23:45 +08:00
|
|
|
apiserver.NewAPIServer()
|
2024-03-22 17:27:07 +08:00
|
|
|
c := cron.New(cron.WithSeconds())
|
|
|
|
|
2023-06-15 16:49:21 +08:00
|
|
|
c.Start()
|
2024-03-22 17:27:07 +08:00
|
|
|
internalCron.AddCronGroup(c)
|
2024-04-30 19:22:19 +08:00
|
|
|
core.RunServer()
|
2022-09-07 09:06:05 +08:00
|
|
|
}
|