-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (39 loc) · 1.03 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"example.com/m/model/automigrate"
"example.com/m/pkg/app"
"example.com/m/pkg/log"
"example.com/m/router"
"example.com/m/router/api/ceping"
"example.com/m/router/api/jiagu"
"flag"
"github.com/gin-gonic/gin"
"io"
"os"
)
func main() {
flag.Parse()
// 将请求放入控制台与run.log中
gin.DefaultWriter = io.MultiWriter(os.Stdout, log.FileWriter)
r := gin.Default()
// 进行建表操作
automigrate.Run()
// 进行服务注册操作
router.Init(r)
// 过5分钟进行加固策略更新
go jiagu.GetPolicyListByType("android加固")
go jiagu.GetPolicyListByType("h5加固")
// 过1个半小时重新获取测评平台token
go ceping.TimeToGetToken()
log.Info(`
/$$$$$$ /$$$$$$$ /$$$$$$
/$$__ $$| $$__ $$ /$$__ $$
| $$ \ $$| $$ \ $$| $$ \__/
| $$$$$$$$| $$$$$$$ | $$
| $$__ $$| $$__ $$| $$
| $$ | $$| $$ \ $$| $$ $$
| $$ | $$| $$$$$$$/| $$$$$$/
|__/ |__/|_______/ \______/
`)
log.Fatal(r.Run(":" + app.Conf.System.Port))
}