mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-13 17:29:54 +01:00
LastSeason
This commit is contained in:
18
ober.go
18
ober.go
@@ -20,6 +20,7 @@ func RunWebserv() {
|
||||
r.GET("/api/season", Headers(Season))
|
||||
r.GET("/api/nextseason", Headers(SeasonNext))
|
||||
r.GET("/api/nextnextseason", Headers(SeasonNextNext))
|
||||
r.GET("/api/lastseason", Headers(SeasonLast))
|
||||
r.GET("/api/auth/{user}", Headers(AuthTest))
|
||||
r.GET("/api/anime/{id}", Headers(AnimeGet))
|
||||
r.GET("/api/animesearch", Headers(AnimeSearchGet))
|
||||
@@ -128,6 +129,23 @@ func SeasonNextNext(ctx *fasthttp.RequestCtx) {
|
||||
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||
}
|
||||
|
||||
func SeasonLast(ctx *fasthttp.RequestCtx) {
|
||||
data, err := seasoncache.Get(GetLastSeasonString())
|
||||
if err != nil {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
err = writeResponseBody(ctx, data)
|
||||
if err != nil {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.SetContentType("application/json; charset=utf-8")
|
||||
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||
}
|
||||
|
||||
func AnimeGet(ctx *fasthttp.RequestCtx) {
|
||||
idVal := ctx.UserValue("id")
|
||||
if idVal == nil {
|
||||
|
||||
Reference in New Issue
Block a user