pub.codex.apix.operation.OperationRequestParamsReader Maven / Gradle / Ivy
package pub.codex.apix.operation;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import pub.codex.apix.annotations.factory.ApiParamFactory;
import pub.codex.apix.annotations.factory.RequestParamFactory;
import pub.codex.apix.context.OperationContext;
import java.util.List;
import java.util.Map;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Maps.newHashMap;
/**
* 处理 RequestMapping 的 params
* 处理基础类型&String
*
* @see @ReqyestParam 包含必填验证
*/
@Component
@Order(Ordered.OperationRequestParamsReader)
public class OperationRequestParamsReader implements OperationBuilderPlugin {
@Override
public void apply(OperationContext context) {
// @RequestParam 处理
requestParamHandel(context);
}
/**
* {@RequestParam} 处理
*
* 1、获取mapping 基本类型或 {String}类型
*
* @param context
*/
private void requestParamHandel(OperationContext context) {
List