Skip to content

Commit

Permalink
♻️ rename apis
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0q committed Oct 26, 2023
1 parent e76f37f commit 70cfa68
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,58 +70,58 @@ func (h *Handlers) SetupRoute() *echo.Echo {
// 認証あり (JWT認証、traQ認証)
apiWithAuth := apiNoAuth.Group("", h.TraQUserMiddleware)
{
apiGroups := apiWithAuth.Group("/groups")
groupsAPI := apiWithAuth.Group("/groups")
{
apiGroups.GET("", h.HandleGetGroups)
apiGroups.POST("", h.HandlePostGroup)
apiGroups.GET("/:groupid", h.HandleGetGroup)
apiGroups.PUT("/:groupid", h.HandleUpdateGroup, h.GroupAdminsMiddleware)
apiGroups.DELETE("/:groupid", h.HandleDeleteGroup, h.GroupAdminsMiddleware)
apiGroups.PUT("/:groupid/members/me", h.HandleAddMeGroup)
apiGroups.DELETE("/:groupid/members/me", h.HandleDeleteMeGroup)
apiGroups.GET("/:groupid/events", h.HandleGetEventsByGroupID)
groupsAPI.GET("", h.HandleGetGroups)
groupsAPI.POST("", h.HandlePostGroup)
groupsAPI.GET("/:groupid", h.HandleGetGroup)
groupsAPI.PUT("/:groupid", h.HandleUpdateGroup, h.GroupAdminsMiddleware)
groupsAPI.DELETE("/:groupid", h.HandleDeleteGroup, h.GroupAdminsMiddleware)
groupsAPI.PUT("/:groupid/members/me", h.HandleAddMeGroup)
groupsAPI.DELETE("/:groupid/members/me", h.HandleDeleteMeGroup)
groupsAPI.GET("/:groupid/events", h.HandleGetEventsByGroupID)
}

apiEvents := apiWithAuth.Group("/events")
eventsAPI := apiWithAuth.Group("/events")
{
apiEvents.GET("", h.HandleGetEvents)
apiEvents.POST("", h.HandlePostEvent, middleware.BodyDump(h.WebhookEventHandler))
apiEvents.GET("/:eventid", h.HandleGetEvent)
apiEvents.PUT("/:eventid", h.HandleUpdateEvent, h.EventAdminsMiddleware, middleware.BodyDump(h.WebhookEventHandler))
apiEvents.DELETE("/:eventid", h.HandleDeleteEvent, h.EventAdminsMiddleware)
apiEvents.PUT("/:eventid/attendees/me", h.HandleUpsertMeEventSchedule)
apiEvents.POST("/:eventid/tags", h.HandleAddEventTag)
apiEvents.DELETE("/:eventid/tags/:tagName", h.HandleDeleteEventTag)
eventsAPI.GET("", h.HandleGetEvents)
eventsAPI.POST("", h.HandlePostEvent, middleware.BodyDump(h.WebhookEventHandler))
eventsAPI.GET("/:eventid", h.HandleGetEvent)
eventsAPI.PUT("/:eventid", h.HandleUpdateEvent, h.EventAdminsMiddleware, middleware.BodyDump(h.WebhookEventHandler))
eventsAPI.DELETE("/:eventid", h.HandleDeleteEvent, h.EventAdminsMiddleware)
eventsAPI.PUT("/:eventid/attendees/me", h.HandleUpsertMeEventSchedule)
eventsAPI.POST("/:eventid/tags", h.HandleAddEventTag)
eventsAPI.DELETE("/:eventid/tags/:tagName", h.HandleDeleteEventTag)
}

apiRooms := apiWithAuth.Group("/rooms")
roomsAPI := apiWithAuth.Group("/rooms")
{
apiRooms.GET("", h.HandleGetRooms)
apiRooms.POST("", h.HandlePostRoom)
apiRooms.POST("/all", h.HandleCreateVerifedRooms, h.PrevilegeUserMiddleware)
apiRooms.GET("/:roomid", h.HandleGetRoom)
apiRooms.DELETE("/:roomid", h.HandleDeleteRoom)
apiRooms.POST("/:roomid/verified", h.HandleVerifyRoom, h.PrevilegeUserMiddleware)
apiRooms.DELETE("/:roomid/verified", h.HandleUnVerifyRoom, h.PrevilegeUserMiddleware)
roomsAPI.GET("", h.HandleGetRooms)
roomsAPI.POST("", h.HandlePostRoom)
roomsAPI.POST("/all", h.HandleCreateVerifedRooms, h.PrevilegeUserMiddleware)
roomsAPI.GET("/:roomid", h.HandleGetRoom)
roomsAPI.DELETE("/:roomid", h.HandleDeleteRoom)
roomsAPI.POST("/:roomid/verified", h.HandleVerifyRoom, h.PrevilegeUserMiddleware)
roomsAPI.DELETE("/:roomid/verified", h.HandleUnVerifyRoom, h.PrevilegeUserMiddleware)
}

apiUsers := apiWithAuth.Group("/users")
usersAPI := apiWithAuth.Group("/users")
{
apiUsers.GET("", h.HandleGetUsers)
apiUsers.POST("/sync", h.HandleSyncUser, h.PrevilegeUserMiddleware)
apiUsers.GET("/me", h.HandleGetUserMe)
apiUsers.GET("/me/ical", h.HandleGetiCal)
apiUsers.PUT("/me/ical", h.HandleUpdateiCal)
apiUsers.GET("/me/groups", h.HandleGetMeGroupIDs)
apiUsers.GET("/me/events", h.HandleGetMeEvents)
apiUsers.GET("/:userid/events", h.HandleGetEventsByUserID)
apiUsers.GET("/:userid/groups", h.HandleGetGroupIDsByUserID)
usersAPI.GET("", h.HandleGetUsers)
usersAPI.POST("/sync", h.HandleSyncUser, h.PrevilegeUserMiddleware)
usersAPI.GET("/me", h.HandleGetUserMe)
usersAPI.GET("/me/ical", h.HandleGetiCal)
usersAPI.PUT("/me/ical", h.HandleUpdateiCal)
usersAPI.GET("/me/groups", h.HandleGetMeGroupIDs)
usersAPI.GET("/me/events", h.HandleGetMeEvents)
usersAPI.GET("/:userid/events", h.HandleGetEventsByUserID)
usersAPI.GET("/:userid/groups", h.HandleGetGroupIDsByUserID)
}

apiTags := apiWithAuth.Group("/tags")
tagsAPI := apiWithAuth.Group("/tags")
{
apiTags.POST("", h.HandlePostTag)
apiTags.GET("", h.HandleGetTags)
tagsAPI.POST("", h.HandlePostTag)
tagsAPI.GET("", h.HandleGetTags)
}
}

Expand Down

0 comments on commit 70cfa68

Please sign in to comment.