master
Evan Chen 2021-12-27 02:44:47 +08:00
parent 5544627bc2
commit fad111af71
1 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"math/rand"
"time"
"github.com/gin-gonic/gin"
"kumoly.io/kumoly/app/server"
"kumoly.io/kumoly/app/store"
"kumoly.io/kumoly/app/util"
@ -38,6 +39,18 @@ func (srv Service) Load() error {
calApi.PUT("", ApiCalUpdate)
calApi.DELETE("", ApiCalDelete)
//+-30day
calApi.GET("ics/:cid", func(c *gin.Context) {
cid := c.Param("cid")
ics, err := ICS(cid,
time.Now().Add(time.Hour*-720),
time.Now().Add(time.Hour*720))
if err != nil {
panic(err)
}
c.String(200, ics)
})
eventApi := server.API.Group("event")
eventApi.GET("", ApiEventQuery)
eventApi.POST("", ApiEventNew)