package com.hx.other.service; import com.hx.auto.GeneratorUtil; import com.hx.auto.common.UrlData; import com.hx.other.service.model.*; /** * 代码自动生成工具 * @Author: cmg * @Date: 2023/4/19 17:00 */ public class AutoDomeUtil { public static void main(String[] args) throws Exception { String packageName = AutoDomeUtil.class.getPackage().getName(); String packRoot = "src.main.java"; String commonPackRootResourse = "src.main.resources"; UrlData urlData = new UrlData(); // 替换此处名字 urlData.setTotalUrl(packageName); urlData.actionUrlData(packRoot,packageName + ".controller"); urlData.daoUrlData(packRoot,packageName + ".dao.mapper"); urlData.serviceUrlData(packRoot,packageName + ".service" ); urlData.serviceImplUrlData(packRoot,packageName +".service"+".impl"); urlData.mapperUrlData(commonPackRootResourse, "mapper"); Class[] arr = new Class[]{ PerformanceInfo.class, User.class, OrdersTotal.class, Employee.class, QueryRecord.class, SqlQueryTemp.class }; for(Class clas : arr) { //dao GeneratorUtil.generatorDao(clas, urlData); //mapper GeneratorUtil.generatorMapper(clas, urlData); // 生成service GeneratorUtil.generatorService(clas, urlData); GeneratorUtil.generatorService(clas, urlData); } } }