Java实现日历、节日查询(获取农历、节日等信息)

2021/8/24 20:06:29

本文主要是介绍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;
    }
}


这篇关于Java实现日历、节日查询(获取农历、节日等信息)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程