Java实现日历、节日查询(获取农历、节日等信息)
作者:互联网
输入日期查询当天的日历含农历、节日等信息
效果图:
@RestController
@RequestMapping("opApi")
@Api(tags="日历查询")
public class WarnController {
@GetMapping("/getDate")
@ApiOperation("获取日历")
public JSONObject getWeather(@RequestParam String date){
String url = "http://www.autmone.com/openapi/icalendar/queryDate"
.concat("?date=").concat(date);
String result = HttpUtils.doGet(url, 2000);
JSONObject dataJson = JSONObject.parseObject(result);
int code = dataJson.getInteger("code");
if (code == 0) {
return dataJson.getJSONObject("data");
}
return null;
}
}
标签:节日,code,Java,String,JSONObject,日历,dataJson,date 来源: https://blog.csdn.net/weixin_44316527/article/details/119897335