public static String current(final String... formats) {
        String format = DEFAULT_FORMAT;
        if (Objects.nonNull(formats) && formats.length != 0 && Objects.nonNull(formats[0])) {
            format = formats[0];
        }
        LocalDateTime now = LocalDateTime.now();
        try {
            return DateTimeFormatter.ofPattern(format).format(now);
        } catch (DateTimeException e) {
            LOG.warn("format fail,use default format :{}", DEFAULT_FORMAT);
            return DateTimeFormatter.ofPattern(DEFAULT_FORMAT).format(now);
        }
        
    }
Generate current time.

@param formats formats
@return time
shenyu-plugin/shenyu-plugin-mock/src/main/java/org/apache/shenyu/plugin/mock/util/MockUtil.java