Datacenter Update to Ws
This commit is contained in:
@@ -3,6 +3,7 @@ package controllers
|
||||
import (
|
||||
"encoding/json"
|
||||
"slices"
|
||||
"strconv"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
@@ -28,11 +29,15 @@ func isAdmin(groups []string) bool {
|
||||
|
||||
// @Title GetAll
|
||||
// @Description Retourne toutes les images autorisées à persister sur ce peer
|
||||
// @Param offset query string false
|
||||
// @Param limit query string false
|
||||
// @Success 200 {object} []allowed_image.AllowedImage
|
||||
// @router / [get]
|
||||
func (o *AllowedImageController) GetAll() {
|
||||
offset, _ := strconv.Atoi(o.Ctx.Input.Query("offset"))
|
||||
limit, _ := strconv.Atoi(o.Ctx.Input.Query("limit"))
|
||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
res := oclib.NewRequest(oclib.LibDataEnum(oclib.ALLOWED_IMAGE), user, peerID, groups, nil).LoadAll(false)
|
||||
res := oclib.NewRequest(oclib.LibDataEnum(oclib.ALLOWED_IMAGE), user, peerID, groups, nil).LoadAll(false, int64(offset), int64(limit))
|
||||
o.Data["json"] = res
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user