黄磊的项目,分享文件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
854 B

package com.ruoyi.system.forest.interceptor;
import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.exceptions.ForestRuntimeException;
import com.dtflys.forest.http.ForestRequest;
import com.dtflys.forest.http.ForestResponse;
import com.dtflys.forest.interceptor.Interceptor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class WriteLogInterceptor implements Interceptor<Object> {
@Override
public void onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response) {
log.error("forest error",ex);
}
@Override
public void onSuccess(Object data, ForestRequest request, ForestResponse response) {
try {
log.debug("forest result content:{}", JSONObject.toJSONString(data));
}catch (Exception e){
log.warn("forest parse json fail");
}
}
}