暂时用这种方式来完成功能。
/**
* 查询业务列表
*/
@At("/graphql")
@Ok("json")
@POST
@AdaptBy(type = VoidAdaptor.class)
public Object graphql( HttpServletRequest req) {
String sql = "";
try {
InputStream is = req.getInputStream();
byte[] bb = Streams.readBytesAndClose(is);
sql = new String (bb);
} catch (IOException e) {
e.printStackTrace();
}
return Result.success("system.success",sql);
}