From 3ade0af0acaa3e750f00d7a503b9d3aee37de14c Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期三, 12 六月 2024 15:40:00 +0800 Subject: [PATCH] 花城 党员详情接口 新增单位管理员电话 --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/ResultUtil.java | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/ResultUtil.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/ResultUtil.java new file mode 100644 index 0000000..32b41a0 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/ResultUtil.java @@ -0,0 +1,29 @@ +package com.panzhihua.common.utlis; + +import java.io.IOException; + +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; + +import lombok.extern.slf4j.Slf4j; + +/** + * @program: springcloud_k8s_panzhihuazhihuishequ + * @description: 返回json + * @author: huang.hongfa weixin hhf9596 qq 959656820 + * @create: 2020-11-24 16:03 + **/ +@Slf4j +public class ResultUtil { + + public static void responseJson(HttpServletResponse httpServletResponse, Object object) { + try { + httpServletResponse.setContentType("application/json;charset=utf-8"); + httpServletResponse.getWriter().write(JSONObject.toJSONString(object)); + } catch (IOException e) { + e.printStackTrace(); + log.error("返回数据到前端失败"); + } + } +} -- Gitblit v1.7.1