| | |
| | | import org.yeshi.utils.FreemarkerUtils; |
| | | import org.yeshi.utils.generater.entity.ExceptionData; |
| | | import org.yeshi.utils.generater.entity.MongoDBDaoData; |
| | | import org.yeshi.utils.generater.entity.ServiceData; |
| | | import org.yeshi.utils.generater.vo.ServiceInfoVO; |
| | | |
| | | import java.io.File; |
| | | |
| | |
| | | * @param targetDir |
| | | * @throws Exception |
| | | */ |
| | | public static void createService(ServiceData data, String targetDir) throws Exception { |
| | | public static void createService(ServiceInfoVO data, String targetDir) throws Exception { |
| | | |
| | | FreemarkerUtils.renderingTemplateAndGenerateFile(SpringComponentGenerater.class.getClassLoader().getResourceAsStream("generater/service.template"), new File(targetDir, data.getServiceClassName() + ".java").getAbsolutePath(), data); |
| | | FreemarkerUtils.renderingTemplateAndGenerateFile(SpringComponentGenerater.class.getClassLoader().getResourceAsStream("generater/service/service.template"), new File(targetDir, data.getServiceClassName() + ".java").getAbsolutePath(), data); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param targetDir |
| | | * @throws Exception |
| | | */ |
| | | public static void createServiceImpl(ServiceData data, String targetDir) throws Exception { |
| | | public static void createServiceImpl(ServiceInfoVO data, String targetDir) throws Exception { |
| | | |
| | | FreemarkerUtils.renderingTemplateAndGenerateFile(SpringComponentGenerater.class.getClassLoader().getResourceAsStream("generater/serviceImpl.template"), new File(targetDir, data.getServiceClassName() + "Impl.java").getAbsolutePath(), data); |
| | | FreemarkerUtils.renderingTemplateAndGenerateFile(SpringComponentGenerater.class.getClassLoader().getResourceAsStream("generater/service/serviceImpl.template"), new File(targetDir, data.getServiceClassName() + "Impl.java").getAbsolutePath(), data); |
| | | } |
| | | |
| | | |