diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java index 79f7d13..0226f44 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java @@ -11,10 +11,13 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; /** - * @Author liuxinxin - * @Date 2021/7/21 11:26 - * @Version 1.0 - **/ + *

+ * GlobalResponseHandler + *

+ * + * @author WendyYang + * @since 10:29 2023/12/29 + */ @RestControllerAdvice(basePackages = { "com.hz.pm.api.fiscal.controller", "com.hz.pm.api.organization.controller", @@ -37,6 +40,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.hz.pm.api.gov.controller", "com.hz.pm.api.dashboard.controller", "com.hz.pm.api.wps.controller", + "com.hz.pm.api.external.controller", "com.hz.pm.api.gov.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { @@ -52,16 +56,7 @@ public class GlobalResponseHandler implements ResponseBodyAdvice { public Object beforeBodyWrite(Object o, MethodParameter methodParameter, MediaType mediaType, Class> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) { - ApiResponse apiResponse = ApiResponse.ofSuccess(o); - // 处理字符串时,遇到了类型转换的问题,debug一步一步跟踪,原来是对于字符串的ContentType是“text-plain”, - // ConverterType是StringHttpMessageConverter这个类型转换, - // 由于将结果封装成了自定义的ApiResponse类型,所以有ApiResponse转换成String报错 - // 所以需要对String类型的返回值单独进行处理 -// if (o instanceof String) { -// return JSONUtil.toJsonStr(apiResponse); -// } return ApiResponse.ofSuccess(o); -// return o; } private Boolean filter(MethodParameter methodParameter) { diff --git a/hz-pm-api/src/main/resources/application-dev.yml b/hz-pm-api/src/main/resources/application-dev.yml index 4f1d3c7..c63e740 100644 --- a/hz-pm-api/src/main/resources/application-dev.yml +++ b/hz-pm-api/src/main/resources/application-dev.yml @@ -253,4 +253,5 @@ mh: # api-host: http://10.54.38.13:8081/mh-gateway/auth-single expert-qr-code-url: https://jiema.wwei.cn/uploads/2023/12/28/658d7a3f15f06.jpg file: + down-url: https://weixin.hzszxc.hzswb.cn:8443/mh-gateway/oss/oss/previewFileLogin detail-url: https://weixin.hzszxc.hzswb.cn:8443/mh-gateway/oss/ossfile/getFileInfoList \ No newline at end of file