라벨 할당,이관 리턴형식 수정
This commit is contained in:
@@ -129,4 +129,12 @@ public class ApiLogFunction {
|
||||
|
||||
return m != null ? m.getMenuUid() : "SYSTEM";
|
||||
}
|
||||
|
||||
public static String cutRequestBody(String value) {
|
||||
int MAX_LEN = 255;
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
return value.length() <= MAX_LEN ? value : value.substring(0, MAX_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -26,6 +27,7 @@ import org.springframework.web.util.ContentCachingRequestWrapper;
|
||||
*
|
||||
* <p>createOK() → 201 CREATED ok() → 200 OK deleteOk() → 204 NO_CONTENT
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
|
||||
|
||||
@@ -110,7 +112,7 @@ public class ApiResponseAdvice implements ResponseBodyAdvice<Object> {
|
||||
ApiLogFunction.getUriMenuInfo(result, servletRequest.getRequestURI()),
|
||||
ip,
|
||||
servletRequest.getRequestURI(),
|
||||
requestBody,
|
||||
ApiLogFunction.cutRequestBody(requestBody),
|
||||
apiResponse.getErrorLogUid());
|
||||
auditLogRepository.save(log);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user