org.chobit.spring.autoconfigure.rw.ResponseWrapperAdvice Maven / Gradle / Ivy
The newest version!
package org.chobit.spring.autoconfigure.rw;
import org.chobit.commons.model.response.Result;
import org.chobit.commons.utils.Collections2;
import org.chobit.commons.utils.JsonKit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import static org.chobit.commons.utils.StrKit.join;
/**
* 接口异常处理
*
* @author robin
*/
@RestControllerAdvice
public class ResponseWrapperAdvice implements ResponseBodyAdvice