use of com.publiccms.common.handler.HttpParameterHandler in project PublicCMS-preview by sanluan.
the class LotteryController method lottery.
/**
* @param callback
* @param request
* @param session
* @param response
*/
@RequestMapping("lottery")
public void lottery(String callback, HttpServletRequest request, HttpSession session, HttpServletResponse response) {
try {
HttpParameterHandler handler = new HttpParameterHandler(mappingJackson2HttpMessageConverter, jsonMediaType, request, callback, response);
SysUser user = getUserFromSession(session);
if (null != user) {
lotteryDirective.execute(handler, null, user);
}
handler.render();
} catch (Exception e) {
}
}
use of com.publiccms.common.handler.HttpParameterHandler in project PublicCMS-preview by sanluan.
the class AbstractTaskDirective method execute.
@Override
public void execute(HttpMessageConverter<Object> httpMessageConverter, MediaType mediaType, HttpServletRequest request, String callback, HttpServletResponse response) throws IOException, Exception {
HttpParameterHandler handler = new HttpParameterHandler(httpMessageConverter, mediaType, request, callback, response);
SysApp app = null;
if (null == (app = getApp(handler))) {
handler.put("error", ApiController.NEED_APP_TOKEN).render();
} else if (CommonUtils.empty(app.getAuthorizedApis()) || !ArrayUtils.contains(StringUtils.split(app.getAuthorizedApis(), COMMA_DELIMITED), getName())) {
handler.put("error", ApiController.UN_AUTHORIZED).render();
} else {
execute(handler);
handler.render();
}
}
Aggregations