-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
44 lines (41 loc) · 1006 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"github.com/gin-gonic/gin"
"github.com/lethe/config"
"github.com/lethe/handler"
"github.com/lethe/handler/hermes"
"github.com/lethe/middleware"
"github.com/sirupsen/logrus"
"github.com/thinkerou/favicon"
)
func init() {
logrus.SetLevel(logrus.TraceLevel)
config.InitMysql()
}
func main() {
r := gin.New()
r.Use(favicon.New("./favicon.ico"))
r.Use(gin.Logger(),
gin.Recovery(),
middleware.LoginMiddleWare())
v := r.Group("/lethe")
{
v.GET("ping", handler.Test)
//auth
v.POST("register", handler.Register)
v.POST("send_mail", handler.SendEmail)
v.POST("login", handler.Login)
v.GET("logout", handler.Logout)
v.POST("info/change", handler.ChangeInfo)
//doc
v.POST("doc/list", handler.DocList)
v.POST("doc/update", handler.DocUpdate)
//order
v.POST("order/list", handler.OrderList)
v.POST("order/create", handler.CreateOrder)
//hermes
v.GET("hermes/status", hermes.GetStatus)
v.POST("hermes/change", hermes.ChangeHermes)
}
r.Run()
}