style(be):拆分模块目录

This commit is contained in:
teaser
2021-03-20 21:42:32 +08:00
committed by dushixiang
parent 86e8e25aac
commit c31b3c8359
36 changed files with 68 additions and 48 deletions

12
main.go
View File

@ -3,9 +3,11 @@ package main
import (
"fmt"
"next-terminal/pkg/config"
"next-terminal/pkg/global"
"next-terminal/pkg/task"
"next-terminal/server/api"
"next-terminal/server/config"
"next-terminal/server/global"
"next-terminal/server/repository"
"github.com/labstack/gommon/log"
"github.com/robfig/cron/v3"
@ -42,8 +44,10 @@ func Run() error {
if global.Config.ResetPassword != "" {
return api.ResetPassword()
}
api.SetupTicker()
sessionRepo := repository.NewSessionRepository(db)
propertyREpo := repository.NewPropertyRepository(db)
ticker := task.NewTicker(sessionRepo, propertyREpo)
ticker.SetupTicker()
if global.Config.Server.Cert != "" && global.Config.Server.Key != "" {
return e.StartTLS(global.Config.Server.Addr, global.Config.Server.Cert, global.Config.Server.Key)