package com.ruoyi.web.controller.utils;

import com.ruoyi.common.config.RuoYiConfig;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class HtmlGenerator {

    public static void writeHtmlToFile(String html, String filename) {
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(new File(filename)))) {
            writer.write(html);
            System.out.println("HTML文件已成功生成！");
        } catch (IOException e) {
            System.err.println("写入HTML文件时出现错误：" + e.getMessage());
        }
    }

    /*public static void main(String[] args) {
        String html = "<html>\n" +
                "<head>\n" +
                "<title>Java生成HTML示例</title>\n" +
                "</head>\n" +
                "<body>\n" +
                "Hello, World!\n" +
                "</body>\n" +
                "</html>";

        // 将HTML内容写入文件
        writeHtmlToFile(html, "output.html");
    }*/
}
