use of com.duangframework.core.common.dto.result.ReturnDto in project duangframework by tcrct.
the class HttpBaseHandler method channelRead0.
@Override
public void channelRead0(final ChannelHandlerContext ctx, final FullHttpRequest request) throws Exception {
try {
RequestUtils.verificationRequest(request);
new ActionHandler(bootStrap, ctx, request).run();
} catch (VerificationException ve) {
logger.warn(ve.getMessage());
ReturnDto<String> returnDto = new ReturnDto<>();
HeadDto headDto = new HeadDto();
headDto.setUri(request.uri());
headDto.setTimestamp(System.currentTimeMillis());
headDto.setRet(500);
headDto.setMsg(ve.getMessage());
returnDto.setData(ve.getMessage());
returnDto.setHead(headDto);
ResponseUtils.buildFullHttpResponse(ctx, request, ToolsKit.toJsonString(returnDto));
}
}
Aggregations