diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/DataPermission.java b/eladmin-common/src/main/java/me/zhengjie/annotation/DataPermission.java index 044d551e..e037b7eb 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/DataPermission.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/DataPermission.java @@ -28,7 +28,7 @@ import java.lang.annotation.Target; * 应该是 @DataPermission(joinName = "dept", fieldName = "id") *

* @author Zheng Jie - * @website https://eladmin.vip + * @website ... * @date 2020-05-07 **/ @Target(ElementType.TYPE) diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/AnonymousAccess.java b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousAccess.java similarity index 95% rename from eladmin-common/src/main/java/me/zhengjie/annotation/AnonymousAccess.java rename to eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousAccess.java index b2c168fe..6755eb26 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/AnonymousAccess.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousAccess.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.annotation; +package me.zhengjie.annotation.rest; import java.lang.annotation.*; diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousDeleteMapping.java b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousDeleteMapping.java index 6a81c2e9..0617e383 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousDeleteMapping.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousDeleteMapping.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import me.zhengjie.annotation.AnonymousAccess; import org.springframework.core.annotation.AliasFor; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousGetMapping.java b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousGetMapping.java index c260a71b..55cbf63b 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousGetMapping.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousGetMapping.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import me.zhengjie.annotation.AnonymousAccess; import org.springframework.core.annotation.AliasFor; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPatchMapping.java b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPatchMapping.java index 66866178..67d941c0 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPatchMapping.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPatchMapping.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import me.zhengjie.annotation.AnonymousAccess; import org.springframework.core.annotation.AliasFor; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPostMapping.java b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPostMapping.java index 8f1cdcdd..a6fe644d 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPostMapping.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPostMapping.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import me.zhengjie.annotation.AnonymousAccess; import org.springframework.core.annotation.AliasFor; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPutMapping.java b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPutMapping.java index 7c417dac..bb2d890e 100644 --- a/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPutMapping.java +++ b/eladmin-common/src/main/java/me/zhengjie/annotation/rest/AnonymousPutMapping.java @@ -22,7 +22,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import me.zhengjie.annotation.AnonymousAccess; import org.springframework.core.annotation.AliasFor; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/eladmin-common/src/main/java/me/zhengjie/config/AsyncExecutor.java b/eladmin-common/src/main/java/me/zhengjie/config/AsyncExecutor.java new file mode 100644 index 00000000..8e9ffe38 --- /dev/null +++ b/eladmin-common/src/main/java/me/zhengjie/config/AsyncExecutor.java @@ -0,0 +1,96 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package me.zhengjie.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 创建自定义的线程池 + * @author Zheng Jie + * @description + * @date 2023-06-08 + **/ +@EnableAsync +@Configuration +public class AsyncExecutor implements AsyncConfigurer { + + public static int corePoolSize; + + public static int maxPoolSize; + + public static int keepAliveSeconds; + + public static int queueCapacity; + + @Value("${task.pool.core-pool-size}") + public void setCorePoolSize(int corePoolSize) { + AsyncExecutor.corePoolSize = corePoolSize; + } + + @Value("${task.pool.max-pool-size}") + public void setMaxPoolSize(int maxPoolSize) { + AsyncExecutor.maxPoolSize = maxPoolSize; + } + + @Value("${task.pool.keep-alive-seconds}") + public void setKeepAliveSeconds(int keepAliveSeconds) { + AsyncExecutor.keepAliveSeconds = keepAliveSeconds; + } + + @Value("${task.pool.queue-capacity}") + public void setQueueCapacity(int queueCapacity) { + AsyncExecutor.queueCapacity = queueCapacity; + } + + /** + * 自定义线程池,用法 @Async + * @return Executor + */ + @Override + public Executor getAsyncExecutor() { + // 自定义工厂 + ThreadFactory factory = r -> new Thread(r, "el-async-" + new AtomicInteger(1).getAndIncrement()); + // 自定义线程池 + return new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveSeconds, + TimeUnit.SECONDS, new ArrayBlockingQueue<>(queueCapacity), factory, + new ThreadPoolExecutor.CallerRunsPolicy()); + } + + /** + * 自定义线程池,用法,注入到类中使用 + * private ThreadPoolTaskExecutor taskExecutor; + * @return ThreadPoolTaskExecutor + */ + @Bean("taskAsync") + public ThreadPoolTaskExecutor taskAsync() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(2); + executor.setMaxPoolSize(4); + executor.setQueueCapacity(20); + executor.setKeepAliveSeconds(60); + executor.setThreadNamePrefix("el-task-"); + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + return executor; + } +} diff --git a/eladmin-common/src/main/java/me/zhengjie/config/FileProperties.java b/eladmin-common/src/main/java/me/zhengjie/config/properties/FileProperties.java similarity index 97% rename from eladmin-common/src/main/java/me/zhengjie/config/FileProperties.java rename to eladmin-common/src/main/java/me/zhengjie/config/properties/FileProperties.java index 3d0a5c6a..2891e9b4 100644 --- a/eladmin-common/src/main/java/me/zhengjie/config/FileProperties.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/properties/FileProperties.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.config; +package me.zhengjie.config.properties; import lombok.Data; import me.zhengjie.utils.ElConstant; diff --git a/eladmin-common/src/main/java/me/zhengjie/config/RsaProperties.java b/eladmin-common/src/main/java/me/zhengjie/config/properties/RsaProperties.java similarity index 96% rename from eladmin-common/src/main/java/me/zhengjie/config/RsaProperties.java rename to eladmin-common/src/main/java/me/zhengjie/config/properties/RsaProperties.java index 0a4a5375..af557e32 100644 --- a/eladmin-common/src/main/java/me/zhengjie/config/RsaProperties.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/properties/RsaProperties.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.config; +package me.zhengjie.config.properties; import lombok.Data; import org.springframework.beans.factory.annotation.Value; diff --git a/eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/ConfigurerAdapter.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java rename to eladmin-common/src/main/java/me/zhengjie/config/webConfig/ConfigurerAdapter.java index a0093d68..e5792501 100644 --- a/eladmin-system/src/main/java/me/zhengjie/config/ConfigurerAdapter.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/ConfigurerAdapter.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.config; +package me.zhengjie.config.webConfig; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; +import me.zhengjie.config.properties.FileProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; diff --git a/eladmin-system/src/main/java/me/zhengjie/config/RelaxedQueryCharsConnectorCustomizer.java b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/QueryCustomizer.java similarity index 89% rename from eladmin-system/src/main/java/me/zhengjie/config/RelaxedQueryCharsConnectorCustomizer.java rename to eladmin-common/src/main/java/me/zhengjie/config/webConfig/QueryCustomizer.java index 14a6b20d..075439ff 100644 --- a/eladmin-system/src/main/java/me/zhengjie/config/RelaxedQueryCharsConnectorCustomizer.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/QueryCustomizer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.config; +package me.zhengjie.config.webConfig; import org.apache.catalina.connector.Connector; import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; @@ -23,7 +23,7 @@ import org.springframework.context.annotation.Configuration; * @author bearBoy80 */ @Configuration(proxyBeanMethods = false) -public class RelaxedQueryCharsConnectorCustomizer implements TomcatConnectorCustomizer { +public class QueryCustomizer implements TomcatConnectorCustomizer { @Override public void customize(Connector connector) { connector.setProperty("relaxedQueryChars", "[]{}"); diff --git a/eladmin-common/src/main/java/me/zhengjie/config/SwaggerConfig.java b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/SwaggerConfig.java similarity index 99% rename from eladmin-common/src/main/java/me/zhengjie/config/SwaggerConfig.java rename to eladmin-common/src/main/java/me/zhengjie/config/webConfig/SwaggerConfig.java index b1a868c4..d7f22261 100644 --- a/eladmin-common/src/main/java/me/zhengjie/config/SwaggerConfig.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/SwaggerConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.config; +package me.zhengjie.config.webConfig; import cn.hutool.core.collection.CollUtil; import com.fasterxml.classmate.TypeResolver; diff --git a/eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/WebSocketConfig.java similarity index 96% rename from eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java rename to eladmin-common/src/main/java/me/zhengjie/config/webConfig/WebSocketConfig.java index f55f5c60..1a2cdd72 100644 --- a/eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/WebSocketConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.config; +package me.zhengjie.config.webConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java index d57ebf28..9a2832de 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java @@ -15,7 +15,7 @@ */ package me.zhengjie.utils; -import me.zhengjie.annotation.AnonymousAccess; +import me.zhengjie.annotation.rest.AnonymousAccess; import me.zhengjie.utils.enums.RequestMethodEnum; import org.springframework.context.ApplicationContext; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/BigDecimalUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/BigDecimalUtils.java new file mode 100644 index 00000000..ff3d81fa --- /dev/null +++ b/eladmin-common/src/main/java/me/zhengjie/utils/BigDecimalUtils.java @@ -0,0 +1,143 @@ +/* + * Copyright 2019-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package me.zhengjie.utils; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * @author Zheng Jie + * @description 计算类 + * @date 2024-12-27 + **/ +public class BigDecimalUtils { + + /** + * 将对象转换为 BigDecimal + * @param obj 输入对象 + * @return 转换后的 BigDecimal + */ + private static BigDecimal toBigDecimal(Object obj) { + if (obj instanceof BigDecimal) { + return (BigDecimal) obj; + } else if (obj instanceof Long) { + return BigDecimal.valueOf((Long) obj); + } else if (obj instanceof Integer) { + return BigDecimal.valueOf((Integer) obj); + } else if (obj instanceof Double) { + return new BigDecimal(String.valueOf(obj)); + } else { + throw new IllegalArgumentException("Unsupported type"); + } + } + + /** + * 加法 + * @param a 加数 + * @param b 加数 + * @return 两个加数的和,保留两位小数 + */ + public static BigDecimal add(Object a, Object b) { + BigDecimal bdA = toBigDecimal(a); + BigDecimal bdB = toBigDecimal(b); + return bdA.add(bdB).setScale(2, RoundingMode.HALF_UP); + } + + /** + * 减法 + * @param a 被减数 + * @param b 减数 + * @return 两数的差,保留两位小数 + */ + public static BigDecimal subtract(Object a, Object b) { + BigDecimal bdA = toBigDecimal(a); + BigDecimal bdB = toBigDecimal(b); + return bdA.subtract(bdB).setScale(2, RoundingMode.HALF_UP); + } + + /** + * 乘法 + * @param a 乘数 + * @param b 乘数 + * @return 两个乘数的积,保留两位小数 + */ + public static BigDecimal multiply(Object a, Object b) { + BigDecimal bdA = toBigDecimal(a); + BigDecimal bdB = toBigDecimal(b); + return bdA.multiply(bdB).setScale(2, RoundingMode.HALF_UP); + } + + /** + * 除法 + * @param a 被除数 + * @param b 除数 + * @return 两数的商,保留两位小数 + */ + public static BigDecimal divide(Object a, Object b) { + BigDecimal bdA = toBigDecimal(a); + BigDecimal bdB = toBigDecimal(b); + return bdA.divide(bdB, 2, RoundingMode.HALF_UP); + } + + /** + * 除法 + * @param a 被除数 + * @param b 除数 + * @param scale 保留小数位数 + * @return 两数的商,保留两位小数 + */ + public static BigDecimal divide(Object a, Object b, int scale) { + BigDecimal bdA = toBigDecimal(a); + BigDecimal bdB = toBigDecimal(b); + return bdA.divide(bdB, scale, RoundingMode.HALF_UP); + } + + /** + * 分转元 + * @param obj 分的金额 + * @return 转换后的元,保留两位小数 + */ + public static BigDecimal centsToYuan(Object obj) { + BigDecimal cents = toBigDecimal(obj); + return cents.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP); + } + + /** + * 元转分 + * @param obj 元的金额 + * @return 转换后的分 + */ + public static Long yuanToCents(Object obj) { + BigDecimal yuan = toBigDecimal(obj); + return yuan.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.HALF_UP).longValue(); + } + + public static void main(String[] args) { + BigDecimal num1 = new BigDecimal("10.123"); + BigDecimal num2 = new BigDecimal("2.456"); + + System.out.println("加法结果: " + add(num1, num2)); + System.out.println("减法结果: " + subtract(num1, num2)); + System.out.println("乘法结果: " + multiply(num1, num2)); + System.out.println("除法结果: " + divide(num1, num2)); + + Long cents = 12345L; + System.out.println("分转元结果: " + centsToYuan(cents)); + + BigDecimal yuan = new BigDecimal("123.45"); + System.out.println("元转分结果: " + yuanToCents(yuan)); + } +} diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java b/eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java deleted file mode 100644 index 9b108127..00000000 --- a/eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package me.zhengjie.utils; - -/** - * @author: liaojinlong - * @date: 2020/6/9 17:02 - * @since: 1.0 - * @see {@link SpringContextHolder} - * 针对某些初始化方法,在SpringContextHolder 初始化前时,
- * 可提交一个 提交回调任务。
- * 在SpringContextHolder 初始化后,进行回调使用 - */ - -public interface CallBack { - /** - * 回调执行方法 - */ - void executor(); - - /** - * 本回调任务名称 - * @return / - */ - default String getCallBackName() { - return Thread.currentThread().getId() + ":" + this.getClass().getName(); - } -} - diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java index 1761fc80..1864887d 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java @@ -19,16 +19,17 @@ import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.poi.excel.BigExcelWriter; import cn.hutool.poi.excel.ExcelUtil; +import lombok.extern.slf4j.Slf4j; import me.zhengjie.exception.BadRequestException; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.web.multipart.MultipartFile; + import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.nio.file.Files; import java.security.MessageDigest; import java.text.DecimalFormat; import java.text.SimpleDateFormat; @@ -44,10 +45,9 @@ import java.util.stream.Collectors; * @author Zheng Jie * @date 2018-12-27 */ +@Slf4j public class FileUtil extends cn.hutool.core.io.FileUtil { - private static final Logger log = LoggerFactory.getLogger(FileUtil.class); - /** * 系统临时目录 *
@@ -110,7 +110,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { * 获取文件扩展名,不带 . */ public static String getExtensionName(String filename) { - if ((filename != null) && (filename.length() > 0)) { + if ((filename != null) && (!filename.isEmpty())) { int dot = filename.lastIndexOf('.'); if ((dot > -1) && (dot < (filename.length() - 1))) { return filename.substring(dot + 1); @@ -123,9 +123,9 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { * Java文件操作 获取不带扩展名的文件名 */ public static String getFileNameNoEx(String filename) { - if ((filename != null) && (filename.length() > 0)) { + if ((filename != null) && (!filename.isEmpty())) { int dot = filename.lastIndexOf('.'); - if ((dot > -1) && (dot < (filename.length()))) { + if (dot > -1) { return filename.substring(0, dot); } } @@ -162,7 +162,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { } OutputStream os = null; try { - os = new FileOutputStream(file); + os = Files.newOutputStream(file.toPath()); int bytesRead; int len = 8192; byte[] buffer = new byte[len]; @@ -170,7 +170,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { os.write(buffer, 0, bytesRead); } } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage(), e); } finally { CloseUtil.close(os); CloseUtil.close(ins); @@ -301,7 +301,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { byte[] b = new byte[(int) file.length()]; InputStream in = null; try { - in = new FileInputStream(file); + in = Files.newInputStream(file.toPath()); try { System.out.println(in.read(b)); } catch (IOException e) { @@ -407,7 +407,6 @@ public class FileUtil extends cn.hutool.core.io.FileUtil { return fileName; } - public static String getMd5(File file) { return getMd5(getByte(file)); } diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java b/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java index 0f1fdfe2..f6019cd8 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java @@ -1,16 +1,24 @@ package me.zhengjie.utils; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import java.io.Serializable; import java.util.List; -@Getter -@RequiredArgsConstructor(access = AccessLevel.PACKAGE) -public class PageResult { +/** + * 分页结果封装类 + * @author Zheng Jie + * @date 2018-11-23 + * @param + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PageResult implements Serializable { - private final List content; + private List content; - private final long totalElements; + private long totalElements; } diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java index 28e4672c..aa4e3761 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java @@ -41,7 +41,7 @@ public class SecurityUtils { * @return UserDetails */ public static UserDetails getCurrentUser() { - UserDetailsService userDetailsService = SpringContextHolder.getBean(UserDetailsService.class); + UserDetailsService userDetailsService = SpringBeanHolder.getBean(UserDetailsService.class); return userDetailsService.loadUserByUsername(getCurrentUsername()); } diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java b/eladmin-common/src/main/java/me/zhengjie/utils/SpringBeanHolder.java similarity index 81% rename from eladmin-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java rename to eladmin-common/src/main/java/me/zhengjie/utils/SpringBeanHolder.java index 41ead386..2ff3bf41 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/SpringBeanHolder.java @@ -31,10 +31,11 @@ import java.util.List; * @date 2019-01-07 */ @Slf4j -public class SpringContextHolder implements ApplicationContextAware, DisposableBean { +@SuppressWarnings("all") +public class SpringBeanHolder implements ApplicationContextAware, DisposableBean { private static ApplicationContext applicationContext = null; - private static final List CALL_BACKS = new ArrayList<>(); + private static final List CALL_BACKS = new ArrayList<>(); private static boolean addCallback = true; /** @@ -43,9 +44,9 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB * * @param callBack 回调函数 */ - public synchronized static void addCallBacks(CallBack callBack) { + public synchronized static void addCallBacks(SpringBeanHolder.CallBack callBack) { if (addCallback) { - SpringContextHolder.CALL_BACKS.add(callBack); + SpringBeanHolder.CALL_BACKS.add(callBack); } else { log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName()); callBack.executor(); @@ -55,7 +56,6 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ - @SuppressWarnings("unchecked") public static T getBean(String name) { assertContextInjected(); return (T) applicationContext.getBean(name); @@ -127,22 +127,22 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB @Override public void destroy() { - SpringContextHolder.clearHolder(); + SpringBeanHolder.clearHolder(); } @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - if (SpringContextHolder.applicationContext != null) { - log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); + if (SpringBeanHolder.applicationContext != null) { + log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringBeanHolder.applicationContext); } - SpringContextHolder.applicationContext = applicationContext; + SpringBeanHolder.applicationContext = applicationContext; if (addCallback) { - for (CallBack callBack : SpringContextHolder.CALL_BACKS) { + for (SpringBeanHolder.CallBack callBack : SpringBeanHolder.CALL_BACKS) { callBack.executor(); } CALL_BACKS.clear(); } - SpringContextHolder.addCallback = false; + SpringBeanHolder.addCallback = false; } /** @@ -153,4 +153,20 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB return new ArrayList<>(Arrays.asList(applicationContext .getBeanNamesForAnnotation(Service.class))); } + + interface CallBack { + + /** + * 回调执行方法 + */ + void executor(); + + /** + * 本回调任务名称 + * @return / + */ + default String getCallBackName() { + return Thread.currentThread().getId() + ":" + this.getClass().getName(); + } + } } diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java index a27a47a9..c10d2b53 100644 --- a/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java +++ b/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java @@ -41,7 +41,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils { /** * 注入bean */ - private final static Ip2regionSearcher IP_SEARCHER = SpringContextHolder.getBean(Ip2regionSearcher.class); + private final static Ip2regionSearcher IP_SEARCHER = SpringBeanHolder.getBean(Ip2regionSearcher.class); /** * 驼峰命名法工具 diff --git a/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java b/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java index b5fcd6b7..f65d06bf 100644 --- a/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java +++ b/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java @@ -45,7 +45,7 @@ public class ColUtil { */ public static PropertiesConfiguration getConfig() { try { - return new PropertiesConfiguration("generator.properties"); + return new PropertiesConfiguration("gen.properties"); } catch (ConfigurationException e) { log.error(e.getMessage(), e); } diff --git a/eladmin-generator/src/main/resources/generator.properties b/eladmin-generator/src/main/resources/gen.properties similarity index 100% rename from eladmin-generator/src/main/resources/generator.properties rename to eladmin-generator/src/main/resources/gen.properties diff --git a/eladmin-system/pom.xml b/eladmin-system/pom.xml index e1799196..a7b837cc 100644 --- a/eladmin-system/pom.xml +++ b/eladmin-system/pom.xml @@ -39,12 +39,6 @@ 2.7 - - - org.springframework.boot - spring-boot-starter-websocket - - org.springframework.boot diff --git a/eladmin-system/src/main/java/me/zhengjie/AppRun.java b/eladmin-system/src/main/java/me/zhengjie/AppRun.java index 8bdcd029..d4974542 100644 --- a/eladmin-system/src/main/java/me/zhengjie/AppRun.java +++ b/eladmin-system/src/main/java/me/zhengjie/AppRun.java @@ -18,7 +18,7 @@ package me.zhengjie; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; import me.zhengjie.annotation.rest.AnonymousGetMapping; -import me.zhengjie.utils.SpringContextHolder; +import me.zhengjie.utils.SpringBeanHolder; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.ApplicationPidFileWriter; @@ -56,8 +56,8 @@ public class AppRun { } @Bean - public SpringContextHolder springContextHolder() { - return new SpringContextHolder(); + public SpringBeanHolder springContextHolder() { + return new SpringBeanHolder(); } /** diff --git a/eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java b/eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java deleted file mode 100644 index 6e075eab..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019-2020 Zheng Jie - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.config.thread; - -import lombok.Data; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 线程池配置属性类 - * @author https://juejin.im/entry/5abb8f6951882555677e9da2 - * @date 2019年10月31日14:58:18 - */ -@Data -@Component -public class AsyncTaskProperties { - - public static int corePoolSize; - - public static int maxPoolSize; - - public static int keepAliveSeconds; - - public static int queueCapacity; - - @Value("${task.pool.core-pool-size}") - public void setCorePoolSize(int corePoolSize) { - AsyncTaskProperties.corePoolSize = corePoolSize; - } - - @Value("${task.pool.max-pool-size}") - public void setMaxPoolSize(int maxPoolSize) { - AsyncTaskProperties.maxPoolSize = maxPoolSize; - } - - @Value("${task.pool.keep-alive-seconds}") - public void setKeepAliveSeconds(int keepAliveSeconds) { - AsyncTaskProperties.keepAliveSeconds = keepAliveSeconds; - } - - @Value("${task.pool.queue-capacity}") - public void setQueueCapacity(int queueCapacity) { - AsyncTaskProperties.queueCapacity = queueCapacity; - } -} diff --git a/eladmin-system/src/main/java/me/zhengjie/config/thread/CustomExecutorConfig.java b/eladmin-system/src/main/java/me/zhengjie/config/thread/CustomExecutorConfig.java deleted file mode 100644 index ca8a8bc5..00000000 --- a/eladmin-system/src/main/java/me/zhengjie/config/thread/CustomExecutorConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package me.zhengjie.config.thread; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import java.util.concurrent.Executor; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * 创建自定义的线程池 - * @author Zheng Jie - * @description - * @date 2023-06-08 - **/ -@Configuration -public class CustomExecutorConfig { - - /** - * 自定义线程池,用法 @Async - * @return Executor - */ - @Bean - @Primary - public Executor elAsync() { - ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(AsyncTaskProperties.corePoolSize); - executor.setMaxPoolSize(AsyncTaskProperties.maxPoolSize); - executor.setQueueCapacity(AsyncTaskProperties.queueCapacity); - executor.setThreadNamePrefix("el-async-"); - executor.setKeepAliveSeconds(AsyncTaskProperties.keepAliveSeconds); - executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); - executor.initialize(); - return executor; - } - - /** - * 自定义线程池,用法 @Async("otherAsync") - * @return Executor - */ - @Bean - public Executor otherAsync() { - ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(15); - executor.setQueueCapacity(50); - executor.setKeepAliveSeconds(AsyncTaskProperties.keepAliveSeconds); - executor.setThreadNamePrefix("el-task-"); - executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); - executor.initialize(); - return executor; - } -} diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/App.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/App.java index cf5789c9..33110185 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/App.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.domain; +package me.zhengjie.modules.maint.domain; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.BeanUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Database.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Database.java index 6b3a68a6..cf2a7889 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Database.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.domain; +package me.zhengjie.modules.maint.domain; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.BeanUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Deploy.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Deploy.java index bcf61e54..e9c9f542 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Deploy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.domain; +package me.zhengjie.modules.maint.domain; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.BeanUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/DeployHistory.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/DeployHistory.java index b4213a41..83fb1178 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/DeployHistory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.domain; +package me.zhengjie.modules.maint.domain; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.BeanUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/ServerDeploy.java similarity index 98% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/ServerDeploy.java index f5235627..cf86dabc 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/ServerDeploy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.domain; +package me.zhengjie.modules.maint.domain; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.BeanUtil; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/AppRepository.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/AppRepository.java index 41e5f5c9..008e00f4 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/AppRepository.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.repository; +package me.zhengjie.modules.maint.repository; -import me.zhengjie.modules.mnt.domain.App; +import me.zhengjie.modules.maint.domain.App; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DatabaseRepository.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DatabaseRepository.java index 695e0adc..52fac474 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DatabaseRepository.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.repository; +package me.zhengjie.modules.maint.repository; -import me.zhengjie.modules.mnt.domain.Database; +import me.zhengjie.modules.maint.domain.Database; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployHistoryRepository.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployHistoryRepository.java index 3c8980ec..097a7acc 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployHistoryRepository.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.repository; +package me.zhengjie.modules.maint.repository; -import me.zhengjie.modules.mnt.domain.DeployHistory; +import me.zhengjie.modules.maint.domain.DeployHistory; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployRepository.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployRepository.java index 2ea44986..f01b29a2 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployRepository.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.repository; +package me.zhengjie.modules.maint.repository; -import me.zhengjie.modules.mnt.domain.Deploy; +import me.zhengjie.modules.maint.domain.Deploy; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/ServerDeployRepository.java similarity index 91% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/ServerDeployRepository.java index 4ca336c0..9926f54d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/ServerDeployRepository.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.repository; +package me.zhengjie.modules.maint.repository; -import me.zhengjie.modules.mnt.domain.ServerDeploy; +import me.zhengjie.modules.maint.domain.ServerDeploy; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/AppController.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/AppController.java index 96cfbed3..ecf04f1d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/AppController.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.rest; +package me.zhengjie.modules.maint.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.service.AppService; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria; +import me.zhengjie.modules.maint.domain.App; +import me.zhengjie.modules.maint.service.AppService; +import me.zhengjie.modules.maint.service.dto.AppDto; +import me.zhengjie.modules.maint.service.dto.AppQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DatabaseController.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DatabaseController.java index ded799d3..7201b444 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DatabaseController.java @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.rest; +package me.zhengjie.modules.maint.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import me.zhengjie.annotation.Log; import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.service.DatabaseService; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria; -import me.zhengjie.modules.mnt.util.SqlUtils; +import me.zhengjie.modules.maint.domain.Database; +import me.zhengjie.modules.maint.service.DatabaseService; +import me.zhengjie.modules.maint.service.dto.DatabaseDto; +import me.zhengjie.modules.maint.service.dto.DatabaseQueryCriteria; +import me.zhengjie.modules.maint.util.SqlUtils; import me.zhengjie.utils.FileUtil; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployController.java similarity index 94% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployController.java index 161e7b5d..346e51d1 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployController.java @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.rest; +package me.zhengjie.modules.maint.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.DeployService; -import me.zhengjie.modules.mnt.service.dto.DeployDto; -import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria; +import me.zhengjie.modules.maint.domain.Deploy; +import me.zhengjie.modules.maint.domain.DeployHistory; +import me.zhengjie.modules.maint.service.DeployService; +import me.zhengjie.modules.maint.service.dto.DeployDto; +import me.zhengjie.modules.maint.service.dto.DeployQueryCriteria; import me.zhengjie.utils.FileUtil; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployHistoryController.java similarity index 91% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployHistoryController.java index 60ee88c4..79916027 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployHistoryController.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.rest; +package me.zhengjie.modules.maint.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.service.DeployHistoryService; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria; +import me.zhengjie.modules.maint.service.DeployHistoryService; +import me.zhengjie.modules.maint.service.dto.DeployHistoryDto; +import me.zhengjie.modules.maint.service.dto.DeployHistoryQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/ServerDeployController.java similarity index 92% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/ServerDeployController.java index f4c60f42..ddbe177e 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/ServerDeployController.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.rest; +package me.zhengjie.modules.maint.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import me.zhengjie.annotation.Log; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.service.ServerDeployService; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria; +import me.zhengjie.modules.maint.domain.ServerDeploy; +import me.zhengjie.modules.maint.service.ServerDeployService; +import me.zhengjie.modules.maint.service.dto.ServerDeployDto; +import me.zhengjie.modules.maint.service.dto.ServerDeployQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/AppService.java similarity index 89% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/AppService.java index 9bded4d8..8fb56051 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/AppService.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service; +package me.zhengjie.modules.maint.service; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria; +import me.zhengjie.modules.maint.domain.App; +import me.zhengjie.modules.maint.service.dto.AppDto; +import me.zhengjie.modules.maint.service.dto.AppQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DatabaseService.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DatabaseService.java index 904f73ca..8e45afcf 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DatabaseService.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service; +package me.zhengjie.modules.maint.service; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria; +import me.zhengjie.modules.maint.domain.Database; +import me.zhengjie.modules.maint.service.dto.DatabaseDto; +import me.zhengjie.modules.maint.service.dto.DatabaseQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployHistoryService.java similarity index 88% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployHistoryService.java index 07bcb642..fb2efdb0 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployHistoryService.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service; +package me.zhengjie.modules.maint.service; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria; +import me.zhengjie.modules.maint.domain.DeployHistory; +import me.zhengjie.modules.maint.service.dto.DeployHistoryDto; +import me.zhengjie.modules.maint.service.dto.DeployHistoryQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployService.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployService.java index 7fb78f59..c6ef852b 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service; +package me.zhengjie.modules.maint.service; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.dto.DeployDto; -import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria; +import me.zhengjie.modules.maint.domain.Deploy; +import me.zhengjie.modules.maint.domain.DeployHistory; +import me.zhengjie.modules.maint.service.dto.DeployDto; +import me.zhengjie.modules.maint.service.dto.DeployQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/ServerDeployService.java similarity index 90% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/ServerDeployService.java index 6dd343fd..20590f05 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/ServerDeployService.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service; +package me.zhengjie.modules.maint.service; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria; +import me.zhengjie.modules.maint.domain.ServerDeploy; +import me.zhengjie.modules.maint.service.dto.ServerDeployDto; +import me.zhengjie.modules.maint.service.dto.ServerDeployQueryCriteria; import me.zhengjie.utils.PageResult; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppDto.java similarity index 96% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppDto.java index c6fd6f74..dbe18354 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Getter; import lombok.Setter; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppQueryCriteria.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppQueryCriteria.java index 17f358f7..a3db9884 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Data; import me.zhengjie.annotation.Query; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseDto.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseDto.java index 689b06b9..07797413 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Getter; import lombok.Setter; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseQueryCriteria.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseQueryCriteria.java index 53d619d4..e70e5d21 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Data; import me.zhengjie.annotation.Query; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployDto.java similarity index 97% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployDto.java index f3d77b8e..b9d14c85 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import cn.hutool.core.collection.CollectionUtil; import lombok.Getter; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryDto.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryDto.java index a9f480cf..8cca9d4a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Data; import java.io.Serializable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryQueryCriteria.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryQueryCriteria.java index c34f1242..87846a9a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Data; import me.zhengjie.annotation.Query; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployQueryCriteria.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployQueryCriteria.java index c404620a..fbbb3471 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Data; import me.zhengjie.annotation.Query; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployDto.java similarity index 96% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployDto.java index a49c7950..a94a41dd 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployDto.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Getter; import lombok.Setter; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployQueryCriteria.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployQueryCriteria.java index bb8bd412..814d3e8b 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployQueryCriteria.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.dto; +package me.zhengjie.modules.maint.service.dto; import lombok.Data; import me.zhengjie.annotation.Query; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/AppServiceImpl.java similarity index 91% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/AppServiceImpl.java index 7d66d0bf..32abdcb8 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/AppServiceImpl.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.impl; +package me.zhengjie.modules.maint.service.impl; import lombok.RequiredArgsConstructor; import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.repository.AppRepository; -import me.zhengjie.modules.mnt.service.AppService; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.AppMapper; +import me.zhengjie.modules.maint.domain.App; +import me.zhengjie.modules.maint.repository.AppRepository; +import me.zhengjie.modules.maint.service.AppService; +import me.zhengjie.modules.maint.service.dto.AppDto; +import me.zhengjie.modules.maint.service.dto.AppQueryCriteria; +import me.zhengjie.modules.maint.service.mapstruct.AppMapper; import me.zhengjie.utils.*; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DatabaseServiceImpl.java similarity index 89% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DatabaseServiceImpl.java index 386b4c29..3763aa4d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DatabaseServiceImpl.java @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.impl; +package me.zhengjie.modules.maint.service.impl; import cn.hutool.core.util.IdUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.repository.DatabaseRepository; -import me.zhengjie.modules.mnt.service.DatabaseService; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; -import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.DatabaseMapper; -import me.zhengjie.modules.mnt.util.SqlUtils; +import me.zhengjie.modules.maint.domain.Database; +import me.zhengjie.modules.maint.repository.DatabaseRepository; +import me.zhengjie.modules.maint.service.DatabaseService; +import me.zhengjie.modules.maint.service.dto.DatabaseDto; +import me.zhengjie.modules.maint.service.dto.DatabaseQueryCriteria; +import me.zhengjie.modules.maint.service.mapstruct.DatabaseMapper; +import me.zhengjie.modules.maint.util.SqlUtils; import me.zhengjie.utils.*; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployHistoryServiceImpl.java similarity index 88% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployHistoryServiceImpl.java index 762b783e..b50c155a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployHistoryServiceImpl.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.impl; +package me.zhengjie.modules.maint.service.impl; import cn.hutool.core.util.IdUtil; import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.repository.DeployHistoryRepository; -import me.zhengjie.modules.mnt.service.DeployHistoryService; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.DeployHistoryMapper; +import me.zhengjie.modules.maint.domain.DeployHistory; +import me.zhengjie.modules.maint.repository.DeployHistoryRepository; +import me.zhengjie.modules.maint.service.DeployHistoryService; +import me.zhengjie.modules.maint.service.dto.DeployHistoryDto; +import me.zhengjie.modules.maint.service.dto.DeployHistoryQueryCriteria; +import me.zhengjie.modules.maint.service.mapstruct.DeployHistoryMapper; import me.zhengjie.utils.*; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java similarity index 93% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java index 1c16f9c6..03ffdd1a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java @@ -13,31 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.impl; +package me.zhengjie.modules.maint.service.impl; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.zhengjie.exception.BadRequestException; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.repository.DeployRepository; -import me.zhengjie.modules.mnt.service.DeployHistoryService; -import me.zhengjie.modules.mnt.service.DeployService; -import me.zhengjie.modules.mnt.service.ServerDeployService; -import me.zhengjie.modules.mnt.service.dto.AppDto; -import me.zhengjie.modules.mnt.service.dto.DeployDto; -import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.mapstruct.DeployMapper; -import me.zhengjie.modules.mnt.util.ExecuteShellUtil; -import me.zhengjie.modules.mnt.util.ScpClientUtil; -import me.zhengjie.modules.mnt.websocket.MsgType; -import me.zhengjie.modules.mnt.websocket.SocketMsg; -import me.zhengjie.modules.mnt.websocket.WebSocketServer; +import me.zhengjie.modules.maint.domain.App; +import me.zhengjie.modules.maint.domain.Deploy; +import me.zhengjie.modules.maint.domain.DeployHistory; +import me.zhengjie.modules.maint.domain.ServerDeploy; +import me.zhengjie.modules.maint.repository.DeployRepository; +import me.zhengjie.modules.maint.service.DeployHistoryService; +import me.zhengjie.modules.maint.service.DeployService; +import me.zhengjie.modules.maint.service.ServerDeployService; +import me.zhengjie.modules.maint.service.dto.AppDto; +import me.zhengjie.modules.maint.service.dto.DeployDto; +import me.zhengjie.modules.maint.service.dto.DeployQueryCriteria; +import me.zhengjie.modules.maint.service.dto.ServerDeployDto; +import me.zhengjie.modules.maint.service.mapstruct.DeployMapper; +import me.zhengjie.modules.maint.util.ExecuteShellUtil; +import me.zhengjie.modules.maint.util.ScpClientUtil; +import me.zhengjie.modules.maint.websocket.MsgType; +import me.zhengjie.modules.maint.websocket.SocketMsg; +import me.zhengjie.modules.maint.websocket.WebSocketServer; import me.zhengjie.utils.*; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/ServerDeployServiceImpl.java similarity index 89% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/ServerDeployServiceImpl.java index 24b29e0e..ee9e5e75 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/ServerDeployServiceImpl.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.impl; +package me.zhengjie.modules.maint.service.impl; import lombok.RequiredArgsConstructor; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.repository.ServerDeployRepository; -import me.zhengjie.modules.mnt.service.ServerDeployService; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; -import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria; -import me.zhengjie.modules.mnt.service.mapstruct.ServerDeployMapper; -import me.zhengjie.modules.mnt.util.ExecuteShellUtil; +import me.zhengjie.modules.maint.domain.ServerDeploy; +import me.zhengjie.modules.maint.repository.ServerDeployRepository; +import me.zhengjie.modules.maint.service.ServerDeployService; +import me.zhengjie.modules.maint.service.dto.ServerDeployDto; +import me.zhengjie.modules.maint.service.dto.ServerDeployQueryCriteria; +import me.zhengjie.modules.maint.service.mapstruct.ServerDeployMapper; +import me.zhengjie.modules.maint.util.ExecuteShellUtil; import me.zhengjie.utils.*; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/AppMapper.java similarity index 85% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/AppMapper.java index fc39eeb2..31418b05 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/AppMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.mapstruct; +package me.zhengjie.modules.maint.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.App; -import me.zhengjie.modules.mnt.service.dto.AppDto; +import me.zhengjie.modules.maint.domain.App; +import me.zhengjie.modules.maint.service.dto.AppDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DatabaseMapper.java similarity index 85% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DatabaseMapper.java index 3cc6e8dd..e540394a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DatabaseMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.mapstruct; +package me.zhengjie.modules.maint.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.Database; -import me.zhengjie.modules.mnt.service.dto.DatabaseDto; +import me.zhengjie.modules.maint.domain.Database; +import me.zhengjie.modules.maint.service.dto.DatabaseDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployHistoryMapper.java similarity index 84% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployHistoryMapper.java index 2522ab02..f83f903b 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployHistoryMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.mapstruct; +package me.zhengjie.modules.maint.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.DeployHistory; -import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto; +import me.zhengjie.modules.maint.domain.DeployHistory; +import me.zhengjie.modules.maint.service.dto.DeployHistoryDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployMapper.java similarity index 85% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployMapper.java index cd3edee8..543043b4 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.mapstruct; +package me.zhengjie.modules.maint.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.Deploy; -import me.zhengjie.modules.mnt.service.dto.DeployDto; +import me.zhengjie.modules.maint.domain.Deploy; +import me.zhengjie.modules.maint.service.dto.DeployDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/ServerDeployMapper.java similarity index 84% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/ServerDeployMapper.java index 960b25b1..e5f859a3 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/ServerDeployMapper.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.service.mapstruct; +package me.zhengjie.modules.maint.service.mapstruct; import me.zhengjie.base.BaseMapper; -import me.zhengjie.modules.mnt.domain.ServerDeploy; -import me.zhengjie.modules.mnt.service.dto.ServerDeployDto; +import me.zhengjie.modules.maint.domain.ServerDeploy; +import me.zhengjie.modules.maint.service.dto.ServerDeployDto; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/DataTypeEnum.java similarity index 99% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/DataTypeEnum.java index e104b9ee..4fa92b4f 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/DataTypeEnum.java @@ -17,7 +17,7 @@ * */ -package me.zhengjie.modules.mnt.util; +package me.zhengjie.modules.maint.util; import lombok.extern.slf4j.Slf4j; /** diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ExecuteShellUtil.java similarity index 98% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ExecuteShellUtil.java index a5d5b599..fbe9c9df 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ExecuteShellUtil.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.util; +package me.zhengjie.modules.maint.util; import cn.hutool.core.io.IoUtil; import com.jcraft.jsch.ChannelShell; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ScpClientUtil.java similarity index 98% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ScpClientUtil.java index 7cb83aa1..134779a1 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ScpClientUtil.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.util; +package me.zhengjie.modules.maint.util; import ch.ethz.ssh2.Connection; import ch.ethz.ssh2.SCPClient; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/SqlUtils.java similarity index 99% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/SqlUtils.java index 0e867af5..fcc52166 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/SqlUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.util; +package me.zhengjie.modules.maint.util; import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.util.StringUtils; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/MsgType.java similarity index 94% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/MsgType.java index 2fc473da..79a998d1 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/MsgType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.websocket; +package me.zhengjie.modules.maint.websocket; /** * @author ZhangHouYing diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/SocketMsg.java similarity index 95% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/SocketMsg.java index ade33a24..7e6ebc63 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/SocketMsg.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.websocket; +package me.zhengjie.modules.maint.websocket; import lombok.Data; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/WebSocketServer.java similarity index 98% rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/WebSocketServer.java index 000a5158..a72fcf6f 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/WebSocketServer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.modules.mnt.websocket; +package me.zhengjie.modules.maint.websocket; import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java index e1b5da76..d6d23a19 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java @@ -26,7 +26,7 @@ import me.zhengjie.modules.quartz.domain.QuartzLog; import me.zhengjie.modules.quartz.service.QuartzJobService; import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria; import me.zhengjie.utils.PageResult; -import me.zhengjie.utils.SpringContextHolder; +import me.zhengjie.utils.SpringBeanHolder; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -134,7 +134,7 @@ public class QuartzJobController { private void checkBean(String beanName){ // 避免调用攻击者可以从SpringContextHolder获得控制jdbcTemplate类 // 并使用getDeclaredMethod调用jdbcTemplate的queryForMap函数,执行任意sql命令。 - if(!SpringContextHolder.getAllServiceBeanName().contains(beanName)){ + if(!SpringBeanHolder.getAllServiceBeanName().contains(beanName)){ throw new BadRequestException("非法的 Bean,请重新输入!"); } } diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java index 4de11205..579d61d5 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java @@ -26,7 +26,7 @@ import me.zhengjie.modules.quartz.repository.QuartzLogRepository; import me.zhengjie.modules.quartz.service.QuartzJobService; import me.zhengjie.service.EmailService; import me.zhengjie.utils.RedisUtils; -import me.zhengjie.utils.SpringContextHolder; +import me.zhengjie.utils.SpringBeanHolder; import me.zhengjie.utils.StringUtils; import me.zhengjie.utils.ThrowableUtil; import org.quartz.JobExecutionContext; @@ -49,16 +49,16 @@ public class ExecutionJob extends QuartzJobBean { private final Logger logger = LoggerFactory.getLogger(this.getClass()); // 此处仅供参考,可根据任务执行情况自定义线程池参数 - private final ThreadPoolTaskExecutor executor = SpringContextHolder.getBean("elAsync"); + private final ThreadPoolTaskExecutor executor = SpringBeanHolder.getBean("elAsync"); @Override public void executeInternal(JobExecutionContext context) { // 获取任务 QuartzJob quartzJob = (QuartzJob) context.getMergedJobDataMap().get(QuartzJob.JOB_KEY); // 获取spring bean - QuartzLogRepository quartzLogRepository = SpringContextHolder.getBean(QuartzLogRepository.class); - QuartzJobService quartzJobService = SpringContextHolder.getBean(QuartzJobService.class); - RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class); + QuartzLogRepository quartzLogRepository = SpringBeanHolder.getBean(QuartzLogRepository.class); + QuartzJobService quartzJobService = SpringBeanHolder.getBean(QuartzJobService.class); + RedisUtils redisUtils = SpringBeanHolder.getBean(RedisUtils.class); String uuid = quartzJob.getUuid(); @@ -105,7 +105,7 @@ public class ExecutionJob extends QuartzJobBean { quartzJobService.updateIsPause(quartzJob); } if(quartzJob.getEmail() != null){ - EmailService emailService = SpringContextHolder.getBean(EmailService.class); + EmailService emailService = SpringBeanHolder.getBean(EmailService.class); // 邮箱报警 if(StringUtils.isNoneBlank(quartzJob.getEmail())){ EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e)); diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java index 31c3a0f8..c75925e6 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java @@ -16,7 +16,7 @@ package me.zhengjie.modules.quartz.utils; import lombok.extern.slf4j.Slf4j; -import me.zhengjie.utils.SpringContextHolder; +import me.zhengjie.utils.SpringBeanHolder; import org.apache.commons.lang3.StringUtils; import org.springframework.util.ReflectionUtils; import java.lang.reflect.Method; @@ -35,7 +35,7 @@ public class QuartzRunnable implements Callable { QuartzRunnable(String beanName, String methodName, String params) throws NoSuchMethodException, SecurityException { - this.target = SpringContextHolder.getBean(beanName); + this.target = SpringBeanHolder.getBean(beanName); this.params = params; if (StringUtils.isNotBlank(params)) { this.method = target.getClass().getDeclaredMethod(methodName, String.class); diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java index 04476de0..4e03e577 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java @@ -25,7 +25,7 @@ import me.zhengjie.annotation.Log; import me.zhengjie.annotation.rest.AnonymousDeleteMapping; import me.zhengjie.annotation.rest.AnonymousGetMapping; import me.zhengjie.annotation.rest.AnonymousPostMapping; -import me.zhengjie.config.RsaProperties; +import me.zhengjie.config.properties.RsaProperties; import me.zhengjie.exception.BadRequestException; import me.zhengjie.modules.security.config.bean.LoginCodeEnum; import me.zhengjie.modules.security.config.bean.LoginProperties; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java index f75b8bb8..1894238d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java @@ -21,7 +21,7 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import me.zhengjie.annotation.Log; import me.zhengjie.utils.PageResult; -import me.zhengjie.config.RsaProperties; +import me.zhengjie.config.properties.RsaProperties; import me.zhengjie.modules.system.domain.Dept; import me.zhengjie.modules.system.service.DataService; import me.zhengjie.modules.system.domain.User; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java index 9a6e543b..41ae50b7 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java @@ -17,7 +17,7 @@ package me.zhengjie.modules.system.service.impl; import lombok.RequiredArgsConstructor; import me.zhengjie.utils.PageResult; -import me.zhengjie.config.FileProperties; +import me.zhengjie.config.properties.FileProperties; import me.zhengjie.exception.BadRequestException; import me.zhengjie.modules.security.service.OnlineUserService; import me.zhengjie.modules.security.service.UserCacheManager; diff --git a/eladmin-system/src/main/java/me/zhengjie/sysrunner/SystemRunner.java b/eladmin-system/src/main/java/me/zhengjie/sysrunner/SystemRunner.java new file mode 100644 index 00000000..b69aba26 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/sysrunner/SystemRunner.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package me.zhengjie.sysrunner; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +/** + * @author Zheng Jie + * @description 程序启动后处理数据 + * @date 2025-01-13 + **/ +@Slf4j +@Component +@RequiredArgsConstructor +public class SystemRunner implements ApplicationRunner { + + @Override + public void run(ApplicationArguments args) { + } +} diff --git a/eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java b/eladmin-tools/src/main/java/me/zhengjie/domain/enums/AliPayStatusEnum.java similarity index 97% rename from eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java rename to eladmin-tools/src/main/java/me/zhengjie/domain/enums/AliPayStatusEnum.java index c114fd16..5f5b042d 100644 --- a/eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java +++ b/eladmin-tools/src/main/java/me/zhengjie/domain/enums/AliPayStatusEnum.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package me.zhengjie.utils; +package me.zhengjie.domain.enums; /** * 支付状态 diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java index 0c03d0ae..fe70b04a 100644 --- a/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java +++ b/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java @@ -19,12 +19,12 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import me.zhengjie.annotation.AnonymousAccess; +import me.zhengjie.annotation.rest.AnonymousAccess; import me.zhengjie.annotation.Log; import me.zhengjie.annotation.rest.AnonymousGetMapping; import me.zhengjie.domain.vo.TradeVo; import me.zhengjie.domain.AlipayConfig; -import me.zhengjie.utils.AliPayStatusEnum; +import me.zhengjie.domain.enums.AliPayStatusEnum; import me.zhengjie.utils.AlipayUtils; import me.zhengjie.service.AliPayService; import org.springframework.http.HttpStatus; diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java b/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java index 94548538..b1fbf5f1 100644 --- a/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java +++ b/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java @@ -17,7 +17,7 @@ package me.zhengjie.service.impl; import cn.hutool.core.util.ObjectUtil; import lombok.RequiredArgsConstructor; -import me.zhengjie.config.FileProperties; +import me.zhengjie.config.properties.FileProperties; import me.zhengjie.domain.LocalStorage; import me.zhengjie.service.dto.LocalStorageDto; import me.zhengjie.service.dto.LocalStorageQueryCriteria; diff --git a/pom.xml b/pom.xml index 7df18bf4..4f741d0d 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,12 @@ spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-websocket + + org.springframework.boot diff --git a/sql/eladmin.sql b/sql/eladmin.sql index 2711d6e9..29d2d5be 100644 --- a/sql/eladmin.sql +++ b/sql/eladmin.sql @@ -412,11 +412,11 @@ INSERT INTO `sys_menu` VALUES (80, 6, 0, 1, '服务监控', 'ServerMonitor', 'mo INSERT INTO `sys_menu` VALUES (82, 36, 0, 1, '生成配置', 'GeneratorConfig', 'generator/config', 33, 'dev', 'generator/config/:tableName', b'0', b'1', b'1', '', NULL, NULL, '2019-11-17 20:08:56', NULL); INSERT INTO `sys_menu` VALUES (83, 10, 0, 1, '图表库', 'Echarts', 'components/Echarts', 50, 'chart', 'echarts', b'0', b'1', b'0', '', NULL, NULL, '2019-11-21 09:04:32', NULL); INSERT INTO `sys_menu` VALUES (90, NULL, 5, 1, '运维管理', 'Mnt', '', 20, 'mnt', 'mnt', b'0', b'0', b'0', NULL, NULL, NULL, '2019-11-09 10:31:08', NULL); -INSERT INTO `sys_menu` VALUES (92, 90, 3, 1, '服务器', 'ServerDeploy', 'mnt/server/index', 22, 'server', 'mnt/serverDeploy', b'0', b'0', b'0', 'serverDeploy:list', NULL, NULL, '2019-11-10 10:29:25', NULL); -INSERT INTO `sys_menu` VALUES (93, 90, 3, 1, '应用管理', 'App', 'mnt/app/index', 23, 'app', 'mnt/app', b'0', b'0', b'0', 'app:list', NULL, NULL, '2019-11-10 11:05:16', NULL); -INSERT INTO `sys_menu` VALUES (94, 90, 3, 1, '部署管理', 'Deploy', 'mnt/deploy/index', 24, 'deploy', 'mnt/deploy', b'0', b'0', b'0', 'deploy:list', NULL, NULL, '2019-11-10 15:56:55', NULL); -INSERT INTO `sys_menu` VALUES (97, 90, 1, 1, '部署备份', 'DeployHistory', 'mnt/deployHistory/index', 25, 'backup', 'mnt/deployHistory', b'0', b'0', b'0', 'deployHistory:list', NULL, NULL, '2019-11-10 16:49:44', NULL); -INSERT INTO `sys_menu` VALUES (98, 90, 3, 1, '数据库管理', 'Database', 'mnt/database/index', 26, 'database', 'mnt/database', b'0', b'0', b'0', 'database:list', NULL, NULL, '2019-11-10 20:40:04', NULL); +INSERT INTO `sys_menu` VALUES (92, 90, 3, 1, '服务器', 'ServerDeploy', 'maint/server/index', 22, 'server', 'maint/serverDeploy', b'0', b'0', b'0', 'serverDeploy:list', NULL, NULL, '2019-11-10 10:29:25', NULL); +INSERT INTO `sys_menu` VALUES (93, 90, 3, 1, '应用管理', 'App', 'maint/app/index', 23, 'app', 'maint/app', b'0', b'0', b'0', 'app:list', NULL, NULL, '2019-11-10 11:05:16', NULL); +INSERT INTO `sys_menu` VALUES (94, 90, 3, 1, '部署管理', 'Deploy', 'maint/deploy/index', 24, 'deploy', 'maint/deploy', b'0', b'0', b'0', 'deploy:list', NULL, NULL, '2019-11-10 15:56:55', NULL); +INSERT INTO `sys_menu` VALUES (97, 90, 1, 1, '部署备份', 'DeployHistory', 'maint/deployHistory/index', 25, 'backup', 'maint/deployHistory', b'0', b'0', b'0', 'deployHistory:list', NULL, NULL, '2019-11-10 16:49:44', NULL); +INSERT INTO `sys_menu` VALUES (98, 90, 3, 1, '数据库管理', 'Database', 'maint/database/index', 26, 'database', 'maint/database', b'0', b'0', b'0', 'database:list', NULL, NULL, '2019-11-10 20:40:04', NULL); INSERT INTO `sys_menu` VALUES (102, 97, 0, 2, '删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deployHistory:del', NULL, NULL, '2019-11-17 09:32:48', NULL); INSERT INTO `sys_menu` VALUES (103, 92, 0, 2, '服务器新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:add', NULL, NULL, '2019-11-17 11:08:33', NULL); INSERT INTO `sys_menu` VALUES (104, 92, 0, 2, '服务器编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:edit', NULL, NULL, '2019-11-17 11:08:57', NULL); diff --git a/sql/tool_picture.sql b/sql/tool_picture.sql deleted file mode 100644 index 6b36d0db..00000000 --- a/sql/tool_picture.sql +++ /dev/null @@ -1,2 +0,0 @@ --- 删除免费图床表 -DROP TABLE tool_picture; \ No newline at end of file diff --git a/sql/脚本如何选择.md b/sql/脚本如何选择.md deleted file mode 100644 index 633c8642..00000000 --- a/sql/脚本如何选择.md +++ /dev/null @@ -1,11 +0,0 @@ -## 脚本指南 -项目根目录的 sql 文件夹内提供了本次数据库变更的脚本,脚本如何选择,以及执行的顺序如下 - -::: tip 注意 -操作数据库属于危险行为,请勿用于生产库,请事先做好备份!!! -::: - -### 初次使用 -eladmin.sql 为 eladmin 项目完整的 sql 脚本,适合于初次使用的用户 - -### 更新迭代