diff --git a/src/main/java/com/utils/MD5Utils.java b/src/main/java/com/utils/MD5Utils.java new file mode 100644 index 0000000..43657b0 --- /dev/null +++ b/src/main/java/com/utils/MD5Utils.java @@ -0,0 +1,28 @@ +package com.utils; + +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * @ClassName MD5Utils + * @Description TODO + * @Author YHT + * @Date 2021/5/29 19:10 + */ +public class MD5Utils { + public static String stringToMD5(String plainText) { + byte[] secretBytes = null; + try { + secretBytes = MessageDigest.getInstance("md5").digest( + plainText.getBytes()); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException("没有这个md5算法!"); + } + String md5code = new BigInteger(1, secretBytes).toString(16); + for (int i = 0; i < 32 - md5code.length(); i++) { + md5code = "0" + md5code; + } + return md5code; + } +} \ No newline at end of file diff --git a/src/main/resources/applicationContext-SpringMVC.xml b/src/main/resources/applicationContext-SpringMVC.xml new file mode 100644 index 0000000..6f26f75 --- /dev/null +++ b/src/main/resources/applicationContext-SpringMVC.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/applicationContext-mybatis.xml b/src/main/resources/applicationContext-mybatis.xml new file mode 100644 index 0000000..0096852 --- /dev/null +++ b/src/main/resources/applicationContext-mybatis.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/jdbc.properties b/src/main/resources/jdbc.properties new file mode 100644 index 0000000..4bcb7e4 --- /dev/null +++ b/src/main/resources/jdbc.properties @@ -0,0 +1,14 @@ +driver=com.mysql.jdbc.Driver +url=jdbc:mysql://127.0.0.1:3306/sp_emp +username=root +password=root +#ʼ +initialSize=0 +# +maxActive=20 +# +maxIdle=20 +#С +minIdle=1 +#ȴʱ +maxWait=60000 \ No newline at end of file diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties new file mode 100644 index 0000000..153bf09 --- /dev/null +++ b/src/main/resources/log4j.properties @@ -0,0 +1,19 @@ +#LOG +log4j.rootLogger=INFO,Console,File +#־ĿĵΪ̨ +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.Target=System.out +#ָ־ʽһָĸʽ +log4j.appender.Console.layout = org.apache.log4j.PatternLayout +log4j.appender.Console.layout.ConversionPattern=[%c] - %m%n + +#ļСָߴʱһµļ +log4j.appender.File = org.apache.log4j.RollingFileAppender +#ָĿ¼ +log4j.appender.File.File = logs/ssm.log +#ļС +log4j.appender.File.MaxFileSize = 10MB +# ־DEBUGʾDEBUGϼ־ +log4j.appender.File.Threshold = ALL +log4j.appender.File.layout = org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%c]%m%n \ No newline at end of file