public static void main(String[] args) { HelloWorldSpark hs = new HelloWorldSpark(); Spark.get( "/", new Route() { @Override public Object handle(Request req, Response resp) throws Exception { return "hello World from Spark!"; } }); Spark.get("/test", (req, resp) -> "This is a test page!"); Spark.get("/echo/:thing", (req, resp) -> req.params(":thing")); Spark.get("/form", (req, resp) -> hs.getForm()); Spark.post( "/form", (req, resp) -> { String fruit = req.queryParams("fruit"); if (StringUtils.isNotEmpty(fruit)) { return "Your favorite fruit is " + fruit; } else { return "Your did not pick any fruit"; } }); }
/** 查询导入 */ public void onQryImp(Boolean isTruePara) { try { if (StringUtils.isNotEmpty(impDate)) { biRedPointsShowQry.setCrtDate(impDate); } biRedPointsShowQry.setOrigin(EnuOrigin.ORIGIN_1.getCode()); bpRedPointsShowList = bpPointsDtlService.selectForAddByModelShow(biRedPointsShowQry); if (isTruePara.equals(true)) { if (bpRedPointsShowList.size() == 0) { MessageUtil.addInfo("没有查询到数据。"); } } } catch (Exception e) { logger.error("查询失败!", e); MessageUtil.addError("查询失败!" + e.getMessage()); } }