-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.go
93 lines (67 loc) · 2.39 KB
/
router.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package main
import (
"fmt"
. "o-confdb/apis"
"github.com/gin-gonic/gin"
)
func testLog(){
fmt.Println("hello")
}
func initRouter() *gin.Engine{
router := gin.Default()
router.GET("/users/:id", GetUserApi)
router.POST("/users", AddUserApi)
router.POST("/auth", AddTokenApi)
//speaker
router.GET("/speakers", GetSpeakersApi)
router.POST("/speakers", AddSpeakerApi)
router.PATCH("/speakers", ModSpeakersApi)
router.DELETE("/speakers", DelSpeakersApi)
router.GET("/speakers/:id", GetSpeakerApi)
router.PATCH("/speakers/:id", ModSpeakerApi)
router.DELETE("/speakers/:id", DelSpeakerApi)
router.GET("/speakers/:id/conferences", GetSpeakerConfsApi)
//origin
router.GET("/origins", GetOriginsApi)
router.POST("/origins", AddOriginApi)
router.PATCH("/origins", ModOriginsApi)
router.DELETE("/origins", DelOriginsApi)
router.GET("/origins/:id", GetOriginApi)
router.PATCH("/origins/:id", ModOriginApi)
router.DELETE("/origins/:id", DelOriginApi)
router.GET("/origins/:id/speakers", GetOriginSpeakersApi)
router.GET("/origins/:id/conferences", GetOriginConfsApi)
//places
router.GET("/places", GetPlacesApi)
router.POST("/places", AddPlaceApi)
router.PATCH("/places", ModPlacesApi)
router.DELETE("/places", DelPlacesApi)
router.GET("/places/:id", GetPlaceApi)
router.PATCH("/places/:id", ModPlaceApi)
router.DELETE("/places/:id", DelPlaceApi)
router.GET("/places/:id/conferences", GetPlaceConfsApi)
// regions
router.GET("/regions", GetRegionsApi)
router.POST("/regions", AddRegionApi)
router.PATCH("/regions", ModRegionsApi)
router.DELETE("/regions", DelRegionsApi)
router.GET("/regions/:id", GetRegionApi)
router.PATCH("/regions/:id", ModRegionApi)
router.DELETE("/regions/:id", DelRegionApi)
router.GET("/regions/:id/places", GetRegionPlacesApi)
router.GET("/region/:id/conferences", GetRegionConfsApi)
// conferences
router.GET("/conferences", GetConfsApi)
router.POST("/conferences", AddConfApi)
router.PATCH("/conferences", ModConfsApi)
router.DELETE("/conferences", DelConfsApi)
router.GET("/conferences/:id", GetConfApi)
router.PATCH("/conferences/:id", ModConfApi)
router.DELETE("/conferences/:id", DelConfApi)
router.GET("/conferences/:id/comments", GetConfCommentsApi)
// router.GET("/conferences/:id/ranks");
// comments
// router.GET("/comments");
// router.GET("/comments/:id");
return router
}