package com.storlead.framework.common.util;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @program: storlead-storlead-centre-platform
 * @description:
 * @author: chenkq
 * @create: 2025-06-17 15:47
 */
public class SystemUtils {
    /**
     * 在filter里输出json格式
     * @param json  json的字符串
     * */
    public static void printJson(HttpServletResponse response, String json){
        try {
            response.setContentType("application/json");
            response.setCharacterEncoding("UTF-8");
            response.getWriter().print(json);
            response.getWriter().flush();
            response.getWriter().close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
