use of com.tvd12.ezyfoxserver.request.EzyRequestAppParams in project ezyfox-server by youngmonkeys.
the class EzyRequestAppController method handle.
@Override
public void handle(EzyServerContext ctx, EzyRequestAppRequest request) {
EzyRequestAppParams params = request.getParams();
EzyAppContext appCtx = ctx.getAppContext(params.getAppId());
EzyApplication app = appCtx.getApp();
EzyAppRequestController requestController = app.getRequestController();
// user manager for checking, user must be managed
EzyUserManager userManger = appCtx.getApp().getUserManager();
EzyUser user = request.getUser();
// check user joined app or not to prevent spam request
boolean hasAccessed = userManger.containsUser(user);
if (hasAccessed) {
// redirect handling to app
EzyUserRequestAppEvent event = newRequestAppEvent(request);
requestController.handle(appCtx, event);
} else {
EzySession session = request.getSession();
responseRequestAppError(ctx, session);
}
}
Aggregations