liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/holiday/HolidayUtil.java
@@ -8,6 +8,7 @@
import com.xiaopeng.common.core.utils.HttpUtils;
import com.xiaopeng.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.time.Duration;
@@ -24,6 +25,9 @@
    @Autowired
    private RedisService redisService;
    @Value("${holiday.api.url}")
    private String holidayApiUrl;
    public  boolean isHoliday() {
        LocalDate now = LocalDate.now();
@@ -32,7 +36,7 @@
        if (redisService.getCacheObject(CacheConstants.IS_HOLIDAY+now) != null && ("1").equals(redisService.getCacheObject(CacheConstants.IS_HOLIDAY+now).toString())) {
            return true;
        }
        String result = HttpUtil.get("https://publicapi.xiaoai.me/holiday/day?date=" +now);
        String result = HttpUtil.get(holidayApiUrl + now);
        JSONObject jsonObject = JSONObject.parseObject(result);
        Object data = jsonObject.get("data");
        JSONArray parse = JSONArray.parse(data.toString());
@@ -58,7 +62,7 @@
        if (cacheObject!=null) {
            return Integer.valueOf(cacheObject.toString());
        }
        String result = HttpUtils.sendGet("https://publicapi.xiaoai.me/holiday/day?date=" +now);
        String result = HttpUtils.sendGet(holidayApiUrl + now);
//        String result = HttpUtils.sendGet("https://publicapi.xiaoai.me/holiday/day?date=2026-01-04");
        JSONObject jsonObject = JSONObject.parseObject(result);