http://tool.bitefu.net/jiari/ //判断国家法定假日 String daysOfMonth = String.valueOf(year)+String.format("%02d",month+1);//整理接口请求数据,月份要求两位 String url = "https://tool.bitefu.net/jiari/?d=" + daysOfMonth; //处理返回的数据 try { Map m = new HashMap(); HttpUtil.Response result = HttpUtil.sendGetRequest(url, "utf-8",m); JSONObject resultarr = JSON.parseObject(result.content.toString()); Map maps = JSON.parseObject(resultarr.get(daysOfMonth).toString()); for(Object key : maps.keySet()){ holidays.add(key.toString().substring(2,4));//将法定假日添加到休息日中 } } catch (Exception e) { e.printStackTrace(); }
法定节假日接口
最新推荐文章于 2024-12-18 16:13:45 发布