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

com.easy.core.controller.BaseController Maven / Gradle / Ivy

The newest version!
package com.easy.core.controller;

import com.easy.core.domain.ApiResult;
import com.easy.core.enumx.FailureEnum;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BaseController {


    public ApiResult success(){
        return ApiResult.ok();
    }

    public  ApiResult success(T t){
        return ApiResult.ok(t);
    }

    public ApiResult failure(){
        return ApiResult.error();
    }

    public ApiResult failure(FailureEnum failureEnum){
        return ApiResult.error(failureEnum);
    }

    public ApiResult failure(int code,String message){
        return ApiResult.error(code,message);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy