dsx 2 éve
szülő
commit
41673a8165

+ 75 - 0
4dkankan-utils-es/pom.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.fdkankan</groupId>
+  <artifactId>4dkankan-utils-es</artifactId>
+  <version>3.0.0-SNAPSHOT</version>
+
+  <name>4dkankan-utils-es</name>
+  <!-- FIXME change it to the project's website -->
+  <url>http://www.example.com</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.11</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
+      <plugins>
+        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
+        <plugin>
+          <artifactId>maven-clean-plugin</artifactId>
+          <version>3.1.0</version>
+        </plugin>
+        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.8.0</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.22.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.5.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-deploy-plugin</artifactId>
+          <version>2.8.2</version>
+        </plugin>
+        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>3.7.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-project-info-reports-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

+ 13 - 0
4dkankan-utils-es/src/main/java/com/fdkankan/App.java

@@ -0,0 +1,13 @@
+package com.fdkankan;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

+ 20 - 0
4dkankan-utils-es/src/test/java/com/fdkankan/AppTest.java

@@ -0,0 +1,20 @@
+package com.fdkankan;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+{
+    /**
+     * Rigorous Test :-)
+     */
+    @Test
+    public void shouldAnswerWithTrue()
+    {
+        assertTrue( true );
+    }
+}

+ 7 - 3
4dkankan-utils-sms/src/main/java/com/fdkankan/sms/SendMailAcceUtils.java

@@ -2,6 +2,7 @@ package com.fdkankan.sms;
 
 import cn.hutool.core.util.StrUtil;
 import com.sun.mail.util.MailSSLSocketFactory;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 
 import javax.activation.DataHandler;
@@ -13,6 +14,7 @@ import java.io.UnsupportedEncodingException;
 import java.security.GeneralSecurityException;
 import java.util.Properties;
 
+@Slf4j
 public class SendMailAcceUtils {
 
     public final static String subject = "四维看看购物发票详情  ";
@@ -79,7 +81,7 @@ public class SendMailAcceUtils {
         msg = msg.replaceAll("scene_link", "https://test.4dkankan.com/spg.html?m=KJ-sCqJv2aS").replaceAll("help_link", "https://test.4dkankan.com/spg.html?m=KJ-sCqJv2aS");
 
         SendMailAcceUtils.sendMail("4Dkankan@4dage.com", "6996790AAaa",
-                "smtp.exmail.qq.com", "879865044@qq.com", "The Scene Calculation is Now Complete.", msg, null);
+                "smtp.exmail.qq.com", "767383594@qq.com", "看看吧", msg, null);
     }
 
 
@@ -169,13 +171,15 @@ public class SendMailAcceUtils {
             message.setContent(multipart);
 
             // 发送消息
+            log.info("执行发送邮件");
             Transport.send(message);
             // System.out.println("Sent message successfully....");
+            log.info("邮件发送成功");
             return true;
         } catch (MessagingException e) {
-            e.printStackTrace();
+            log.error("发送邮件失败",e);
         } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
+            log.error("发送邮件失败",e);
         }
         return false;
     }