com.iqiny.silly.spring.spel.field.SillyCrudSerivceMethodValuesField Maven / Gradle / Ivy
/*
* Copyright iqiny.com
*
* https://gitee.com/iqiny/silly
*
* project name:silly-spring
* project description:top silly project pom.xml file
*/
package com.iqiny.silly.spring.spel.field;
import com.iqiny.silly.common.util.SillyReflectUtil;
import com.iqiny.silly.core.base.core.SillyEntity;
import com.iqiny.silly.core.common.SillyConfigUtil;
import com.iqiny.silly.core.config.property.valuesfield.BaseSillyMethodPropertyValuesField;
import com.iqiny.silly.core.savehandle.SillyOnceSourceData;
import com.iqiny.silly.core.service.crud.SillyCrudService;
import org.springframework.stereotype.Component;
/**
* 获取CRDU service操作
*/
@Component
public class SillyCrudSerivceMethodValuesField extends BaseSillyMethodPropertyValuesField {
public static final String NAME = "crudService" ;
@Override
public String fieldName() {
return NAME;
}
@Override
protected Class>[] getParameterTypes(SillyOnceSourceData data) {
return new Class[]{String.class};
}
public static SillyCrudService crudService(String className) {
Class extends SillyEntity> sillyEntityClass = SillyReflectUtil.classForName(className);
return SillyConfigUtil.getSillyConfig().getSillyContext().getSillyCrudService(sillyEntityClass);
}
}