xyz.proteanbear.capricorn.infrastructure.GlobalResponseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pb-capricorn-base Show documentation
Show all versions of pb-capricorn-base Show documentation
Capricorn综合应用技术服务平台:基础通用模块项目,包括项目使用的基础库等内容。
The newest version!
package xyz.proteanbear.capricorn.infrastructure;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.MethodParameter;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.lang.NonNull;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import xyz.proteanbear.capricorn.infrastructure.auth.AccountAuthorityVerifier;
import xyz.proteanbear.capricorn.infrastructure.auth.Authority;
import xyz.proteanbear.capricorn.infrastructure.util.ClassAndObjectUtil;
import java.util.Objects;
/**
* Global return processor, return to unified JSON data structure after capture.
* 子项目可通过继承此类并增加ControllerAdvice注解实现通用的返回处理
*
* @author 马强
*/
public abstract class GlobalResponseHandler implements ResponseBodyAdvice