2023-09-18 15:01:35 +08:00
|
|
|
package com.engine.recruit.factory;
|
|
|
|
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
2024-01-09 18:06:31 +08:00
|
|
|
import com.engine.recruit.exception.CustomizeRunTimeException;
|
2023-09-18 15:01:35 +08:00
|
|
|
import com.engine.recruit.service.RecruitButtonService;
|
2024-01-09 18:06:31 +08:00
|
|
|
import weaver.general.BaseBean;
|
2023-09-18 15:01:35 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <p>聚才林招聘</p>
|
|
|
|
|
* 招聘按钮工厂类
|
|
|
|
|
*
|
|
|
|
|
* @author:dxfeng
|
|
|
|
|
* @createTime: 2023/09/18
|
|
|
|
|
* @version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
public class RecruitButtonFactory {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据类的全路径获取类对象
|
|
|
|
|
*
|
|
|
|
|
* @param className 类全路径
|
|
|
|
|
* @param <T>
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static <T extends Service> Class<T> getClass(String className) {
|
|
|
|
|
Class<?> clazz;
|
|
|
|
|
try {
|
|
|
|
|
clazz = Class.forName(className);
|
|
|
|
|
if (!RecruitButtonService.class.isAssignableFrom(clazz)) {
|
|
|
|
|
throw new IllegalArgumentException("该类未实现RecruitButtonService");
|
|
|
|
|
}
|
|
|
|
|
return (Class<T>) clazz;
|
|
|
|
|
} catch (ClassNotFoundException e) {
|
2024-01-09 18:06:31 +08:00
|
|
|
new BaseBean().writeLog(e);
|
|
|
|
|
throw new CustomizeRunTimeException("操作按钮配置出错,未获取到按钮实现类[" + className + "]");
|
2023-09-18 15:01:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|