mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-15 19:49:53 +01:00
New log endpoint
This commit is contained in:
12
ober.go
12
ober.go
@@ -20,6 +20,7 @@ func RunWebserv() {
|
|||||||
r.GET("/api/anime/{id}", Headers(AnimeGet))
|
r.GET("/api/anime/{id}", Headers(AnimeGet))
|
||||||
r.GET("/api/animesearch", Headers(AnimeSearchGet))
|
r.GET("/api/animesearch", Headers(AnimeSearchGet))
|
||||||
r.GET("/api/appointment", Headers(AppointmentGet))
|
r.GET("/api/appointment", Headers(AppointmentGet))
|
||||||
|
r.GET("/api/log", Headers(LogGet))
|
||||||
r.GET("/api/user/{user?}", Headers(UserGet))
|
r.GET("/api/user/{user?}", Headers(UserGet))
|
||||||
r.GET("/api/watch/{user?}", Headers(WatchGet))
|
r.GET("/api/watch/{user?}", Headers(WatchGet))
|
||||||
r.GET("/api/watchext/{user?}", Headers(WatchExtendedGet))
|
r.GET("/api/watchext/{user?}", Headers(WatchExtendedGet))
|
||||||
@@ -140,6 +141,17 @@ func AppointmentGet(ctx *fasthttp.RequestCtx) {
|
|||||||
ctx.SetStatusCode(fasthttp.StatusNotImplemented)
|
ctx.SetStatusCode(fasthttp.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LogGet(ctx *fasthttp.RequestCtx) {
|
||||||
|
_, err := ctx.WriteString(logOut.String())
|
||||||
|
if err != nil {
|
||||||
|
addErrorToCtx(ctx, err)
|
||||||
|
ctx.SetStatusCode(fasthttp.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ctx.SetContentType("text/plain; charset=utf-8")
|
||||||
|
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||||
|
}
|
||||||
|
|
||||||
func UserGet(ctx *fasthttp.RequestCtx) {
|
func UserGet(ctx *fasthttp.RequestCtx) {
|
||||||
usrVal := ctx.UserValue("user")
|
usrVal := ctx.UserValue("user")
|
||||||
users := make([]User, 0)
|
users := make([]User, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user