All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.hison.api.handler.ApiHandler Maven / Gradle / Ivy

Go to download

API-Link is a novel solution for Spring projects, aimed at streamlining development by eliminating the need for individual controllers. It allows developers to use a single 'cmd' value to invoke service layer methods, simplifying workflow and boosting productivity.

The newest version!
package io.github.hison.api.handler;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.ResponseEntity;

import io.github.hison.api.exception.ApiException;
import io.github.hison.api.exception.ServiceRuntimeException;
import io.github.hison.data.model.DataModel;
import io.github.hison.data.wrapper.DataWrapper;

/** 
 * @author Hani son
 * @version 1.0.0
 */
public interface ApiHandler {
    DataModel beforeHandleRequest(DataWrapper dw, HttpServletRequest req);

    DataModel handleAuthority(DataWrapper dw, HttpServletRequest req);

    void handleLog(DataWrapper dw, HttpServletRequest req);

    ResponseEntity handleApiException(ApiException e, DataWrapper dw, HttpServletRequest req);

    ResponseEntity handleServiceRuntimeException(ServiceRuntimeException e, DataWrapper dw, HttpServletRequest req);

    ResponseEntity handleException(Exception e, DataWrapper dw, HttpServletRequest req);

    ResponseEntity handleThrowable(Throwable t, DataWrapper dw, HttpServletRequest req) ;

    void afterHandleRequest(DataWrapper requestDw, DataWrapper responesDw, HttpServletRequest req);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy