package com.tofly.common;

import com.tofly.common.core.entity.ResultRespone;

/**
 * @author HaiQiu
 * @date 2022-04-15
 */
public class BaseController {

    public ResultRespone decide(String msg){
        return ResultRespone.success(msg);
    }

    public ResultRespone decide(Boolean b){
        return b ? ResultRespone.success("操作成功") : ResultRespone.failed("操作失败");
    }


    public ResultRespone decide(Object o){
        return ResultRespone.success(o);
    }

    public ResultRespone decide(int i){
        return i!=0 ? ResultRespone.success("操作成功")  : ResultRespone.failed("操作失败");
    }
}
