package org.springblade.common.utils;

import com.alibaba.fastjson.JSONObject;
import org.springblade.core.mp.support.Query;

import java.lang.reflect.Method;
import java.util.Map;

public class ParamsConvert {
	public static Object paramsConvert(Object proxyObject, String className, Method method, Map<String, Object> params) throws Exception {
		JSONObject jsonObject = new JSONObject();
		if (className.equals("applicationInfoController") && method.getName().equals("page")) {
			Query query = new Query();
			query.setSize(Integer.valueOf(params.get("size").toString()));
			query.setCurrent(Integer.valueOf(params.get("current").toString()));
			return method.invoke(proxyObject, params, query);
		}
		return null;
	}
}
