Ejemplo n.º 1
0
 *  resourcePath="/server",
 *  @SWG\Api(
 *    path="/server/ipBans",
 *    description="Operations on server",
 *    @SWG\Operation(
 *      summary="Get IP bans",
 *      notes="",
 *      method="GET",
 *      type="array[IpBan]",
 *      nickname="getIPBans"
 *   )
 *  )
 * )
 */
$DevAAC->get(ROUTES_API_PREFIX . '/server/ipBans', function () use($DevAAC) {
    $ipbans = IpBan::all();
    $DevAAC->response->headers->set('Content-Type', 'application/json');
    $DevAAC->response->setBody($ipbans->toJson(JSON_PRETTY_PRINT));
});
/**
 * @SWG\Resource(
 *  basePath="/api/v1",
 *  resourcePath="/server",
 *  @SWG\Api(
 *    path="/server/ipBans",
 *    description="Operations on server",
 *    @SWG\Operation(
 *      summary="Ban IP",
 *      notes="Need to have admin rights<br />
 *      Do not provide banned_at in IpBan object - it will be ignored<br />
 *      The ID of player in banned_by must be of group_id > 1<br />