add my events
This commit is contained in:
1
main.go
1
main.go
@@ -62,6 +62,7 @@ func main() {
|
||||
|
||||
//Events
|
||||
mainGroup.GET("/events", events.GetEvents)
|
||||
mainGroup.GET("/events/me", events.GetMyEvents)
|
||||
mainGroup.GET("/events/:id", events.GetEvent)
|
||||
mainGroup.POST("/events", events.CreateEvent)
|
||||
mainGroup.DELETE("/events", events.DeleteEvent)
|
||||
|
||||
@@ -19,6 +19,18 @@ func GetEvents(c echo.Context) error {
|
||||
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
||||
}
|
||||
|
||||
func GetMyEvents(c echo.Context) error {
|
||||
data, err, resp := api.GetRequest(
|
||||
config.Env.MSHosts.EventsHost+"/me",
|
||||
c.Request().Header, c.Request().URL.RawQuery)
|
||||
|
||||
if err != nil {
|
||||
return c.NoContent(http.StatusBadGateway)
|
||||
}
|
||||
|
||||
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
||||
}
|
||||
|
||||
func GetEvent(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user