forked from GitTsewell/exchange_data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.go
35 lines (27 loc) · 762 Bytes
/
api.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
package route
import (
"exchange_api/app"
"exchange_api/middleware"
"exchange_api/tool"
"github.com/gin-gonic/gin"
)
func InitRoute() *gin.Engine {
r := gin.Default()
r.Use(Cors()) // 跨域
r.Use(middleware.LoggerToFile()) // 日志
r.POST("/login",app.LoginPost)
// auth
auth := r.Group("/")
auth.Use(tool.JWTAuth())
auth.GET("/depth",app.DepthIndex)
auth.GET("/depth/edit",app.DepthEdit)
auth.PUT("/depth/:platform",app.DepthUpdate)
auth.GET("/depth/check/:platform",app.DepthCheck)
auth.GET("/depth/commit",app.DepthCommit)
auth.GET("/system",app.SystemIndex)
auth.PUT("/system",app.SystemUpdate)
auth.GET("/system/:key",app.SystemExec)
auth.GET("/exchange",app.ExchangeEdit)
auth.PUT("/exchange",app.ExchangeUpdate)
return r
}