21 lines
583 B
Java
21 lines
583 B
Java
package net.frozenorb.apiv3.route;
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
import io.vertx.core.Handler;
|
|
import io.vertx.ext.web.RoutingContext;
|
|
import net.frozenorb.apiv3.APIv3;
|
|
import net.frozenorb.apiv3.actor.Actor;
|
|
|
|
public final class GETWhoAmI implements Handler<RoutingContext> {
|
|
|
|
public void handle(RoutingContext ctx) {
|
|
Actor actor = ctx.get("actor");
|
|
|
|
APIv3.respondJson(ctx, ImmutableMap.of(
|
|
"name", actor.getName(),
|
|
"type", actor.getType(),
|
|
"authorized", actor.isAuthorized()
|
|
));
|
|
}
|
|
|
|
} |