-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
28 lines (22 loc) · 805 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import (
log "github.com/Sirupsen/logrus"
"github.com/beppeben/go-dictionary/excel"
"github.com/beppeben/go-dictionary/persistence"
"github.com/beppeben/go-dictionary/utils"
"github.com/beppeben/go-dictionary/web"
)
func main() {
log.SetLevel(log.DebugLevel)
log.SetFormatter(&log.TextFormatter{DisableColors: true})
config := utils.NewAppConfig()
sysutils := utils.NewSysUtils(config)
msgutils := utils.NewMessageUtils(config)
handler := persistence.NewMySqlHandler(config)
dbReader := excel.NewReader(config.GetExcelDir() + "mydb.xlsx")
calReader := excel.NewReader(config.GetExcelDir() + "calendar.xlsx")
repo := persistence.NewRepo(handler, dbReader, calReader)
webhandler := web.NewWebHandler(repo, config, sysutils, msgutils)
webhandler.StartServer()
select {}
}