yujie 4 роки тому
коміт
d37b789dae
32 змінених файлів з 2814 додано та 0 видалено
  1. 33 0
      .gitignore
  2. 118 0
      .mvn/wrapper/MavenWrapperDownloader.java
  3. BIN
      .mvn/wrapper/maven-wrapper.jar
  4. 2 0
      .mvn/wrapper/maven-wrapper.properties
  5. 310 0
      mvnw
  6. 182 0
      mvnw.cmd
  7. 101 0
      pom.xml
  8. 112 0
      src/main/java/com/lala/controller/AddWechatPages.java
  9. 173 0
      src/main/java/com/lala/controller/Demo.java
  10. 77 0
      src/main/java/com/lala/controller/GetWechatPages.java
  11. 48 0
      src/main/java/com/lala/controller/PlanDto.java
  12. 82 0
      src/main/java/com/lala/controller/SSDermo.java
  13. 98 0
      src/main/java/com/lala/controller/ShellTest.java
  14. 29 0
      src/main/java/com/lala/controller/StringText.java
  15. 97 0
      src/main/java/com/lala/controller/UserController.java
  16. 14 0
      src/main/java/com/lala/yj/YjApplication.java
  17. 103 0
      src/main/java/com/lala/yj/controller/CVtest.java
  18. 146 0
      src/main/java/com/lala/yj/controller/ChromeDriverProxy.java
  19. 213 0
      src/main/java/com/lala/yj/controller/Demo.java
  20. 19 0
      src/main/java/com/lala/yj/controller/ExecuteDto.java
  21. 19 0
      src/main/java/com/lala/yj/controller/MpAccountDto.java
  22. 112 0
      src/main/java/com/lala/yj/controller/MpListHandle.java
  23. 18 0
      src/main/java/com/lala/yj/controller/MpListVo.java
  24. 48 0
      src/main/java/com/lala/yj/controller/PlanDto.java
  25. 25 0
      src/main/java/com/lala/yj/controller/PlanDtoLo.java
  26. 153 0
      src/main/java/com/lala/yj/controller/PlanHandle.java
  27. 192 0
      src/main/java/com/lala/yj/controller/PlanHandleNew.java
  28. 29 0
      src/main/java/com/lala/yj/controller/RemoteDemo.java
  29. 100 0
      src/main/java/com/lala/yj/controller/ShellTest.java
  30. 113 0
      src/main/java/com/lala/yj/controller/UserController.java
  31. 35 0
      src/main/resources/application.yml
  32. 13 0
      src/test/java/com/lala/yj/YjApplicationTests.java

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 118 - 0
.mvn/wrapper/MavenWrapperDownloader.java

@@ -0,0 +1,118 @@
+/*
+ * Copyright 2007-present 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
+ *
+ *      https://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.
+ */
+
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    private static final String WRAPPER_VERSION = "0.5.6";
+    /**
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+     */
+    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+    /**
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+     * use instead of the default one.
+     */
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+            ".mvn/wrapper/maven-wrapper.properties";
+
+    /**
+     * Path where the maven-wrapper.jar will be saved to.
+     */
+    private static final String MAVEN_WRAPPER_JAR_PATH =
+            ".mvn/wrapper/maven-wrapper.jar";
+
+    /**
+     * Name of the property which should be used to override the default download url for the wrapper.
+     */
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+    public static void main(String args[]) {
+        System.out.println("- Downloader started");
+        File baseDirectory = new File(args[0]);
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
+        // wrapperUrl parameter.
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+        String url = DEFAULT_DOWNLOAD_URL;
+        if (mavenWrapperPropertyFile.exists()) {
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
+            try {
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+                Properties mavenWrapperProperties = new Properties();
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+            } catch (IOException e) {
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+            } finally {
+                try {
+                    if (mavenWrapperPropertyFileInputStream != null) {
+                        mavenWrapperPropertyFileInputStream.close();
+                    }
+                } catch (IOException e) {
+                    // Ignore ...
+                }
+            }
+        }
+        System.out.println("- Downloading from: " + url);
+
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+        if (!outputFile.getParentFile().exists()) {
+            if (!outputFile.getParentFile().mkdirs()) {
+                System.out.println(
+                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+            }
+        }
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+        try {
+            downloadFileFromURL(url, outputFile);
+            System.out.println("Done");
+            System.exit(0);
+        } catch (Throwable e) {
+            System.out.println("- Error downloading");
+            e.printStackTrace();
+            System.exit(1);
+        }
+    }
+
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+            String username = System.getenv("MVNW_USERNAME");
+            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+            Authenticator.setDefault(new Authenticator() {
+                @Override
+                protected PasswordAuthentication getPasswordAuthentication() {
+                    return new PasswordAuthentication(username, password);
+                }
+            });
+        }
+        URL website = new URL(urlString);
+        ReadableByteChannel rbc;
+        rbc = Channels.newChannel(website.openStream());
+        FileOutputStream fos = new FileOutputStream(destination);
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+        fos.close();
+        rbc.close();
+    }
+
+}

BIN
.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 310 - 0
mvnw

@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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
+#
+#    https://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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="`which javac`"
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=`which readlink`
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
+      javaHome="`dirname \"$javaExecutable\"`"
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`which java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=`cd "$wdir/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 182 - 0
mvnw.cmd

@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%

+ 101 - 0
pom.xml

@@ -0,0 +1,101 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.3.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.lala</groupId>
+    <artifactId>yj</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>yj</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.1.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-java</artifactId>
+<!--            <version>3.4.0</version>-->
+        </dependency>
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>testcontainers</artifactId>
+            <version>1.14.3</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.ethz.ganymed</groupId>
+            <artifactId>ganymed-ssh2</artifactId>
+            <version>build210</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jodd</groupId>
+            <artifactId>jodd-core</artifactId>
+            <version>5.1.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.12</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.73</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.tencent.ads</groupId>
+            <artifactId>marketing-api-java-sdk</artifactId>
+            <version>1.1.12</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 112 - 0
src/main/java/com/lala/controller/AddWechatPages.java

@@ -0,0 +1,112 @@
+package com.lala.controller;
+
+import com.tencent.ads.ApiContextConfig;
+import com.tencent.ads.TencentAds;
+import com.tencent.ads.exception.TencentAdsResponseException;
+import com.tencent.ads.exception.TencentAdsSDKException;
+import com.tencent.ads.model.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author yj
+ * @date 2020/12/29 下午3:26
+ */
+public class AddWechatPages {
+
+    /** YOUR ACCESS TOKEN */
+    public String ACCESS_TOKEN = "ba35bab1c9bada2053b18726664daefb";
+
+    /** TencentAds */
+    public TencentAds tencentAds;
+
+    public PageElementsType elementType = PageElementsType.IMAGE;
+    public String title = "YJ_TEST_TITLE";
+    public PageElementsType elementType_1 = PageElementsType.IMAGE;
+    public PageElementsType elementType_2 = PageElementsType.ELEMENT_TYPE_UNSUPPORTED;
+    public PageElementsType elementType_3 = PageElementsType.BUTTON;
+    public String title_1 = "YJ_TEST_TEXT";
+    public WechatPagesAddRequest data = new WechatPagesAddRequest();
+    public Long accountId = 18857854L;
+    public String pageName = "YJ_TEST_TITLE_PAGE_NAME";
+    public Long pageTemplateId = 1999797287L;
+    public String shareTitle = "YJ_TEST_分享标题";
+    public String shareDescription = "YJ_TEST_分享内容";
+
+
+    public List<String> imId = Arrays.asList("331932416");
+
+    public void init() {
+        this.tencentAds = TencentAds.getInstance();
+        this.tencentAds.init(
+                new ApiContextConfig().accessToken(ACCESS_TOKEN).isDebug(true)); // debug==true 会打印请求详细信息
+        this.tencentAds.useProduction(); // 默认使用沙箱环境,如果要请求线上,这里需要设为线上环境
+        this.buildParams();
+    }
+
+    public void buildParams() {
+        PageElementsStruct pageElementsStruct = new PageElementsStruct();
+        pageElementsStruct.setElementType(elementType);
+        GoodsButtonSpec goodsButtonSpec = new GoodsButtonSpec();
+        goodsButtonSpec.setTitle(title);
+        ElementImage elementImage = new ElementImage();
+        elementImage.setImageIdList(imId);
+        pageElementsStruct.setImageSpec(elementImage);
+
+        PageElementsStruct pageElementsStruct_1 = new PageElementsStruct();
+        pageElementsStruct_1.setElementType(elementType_1);
+        ServiceSpec serviceSpec_1 = new ServiceSpec();
+        serviceSpec_1.setTitle(title_1);
+        ElementButtonRead buttonSpec_1 = new ElementButtonRead();
+        buttonSpec_1.setServiceSpec(serviceSpec_1);
+        pageElementsStruct_1.setButtonSpec(buttonSpec_1);
+
+        PageElementsStruct pageElementsStruct_2 = new PageElementsStruct();
+        pageElementsStruct_2.setElementType(elementType_2);
+
+
+
+        List<PageElementsStruct> pageElementsSpecList = new ArrayList<>();
+        pageElementsSpecList.add(pageElementsStruct);
+        pageElementsSpecList.add(pageElementsStruct_1);
+        pageElementsSpecList.add(pageElementsStruct_1);
+        pageElementsSpecList.add(pageElementsStruct_1);
+        pageElementsSpecList.add(pageElementsStruct_1);
+        pageElementsSpecList.add(pageElementsStruct);
+        pageElementsSpecList.add(pageElementsStruct);
+        data.setPageElementsSpecList(pageElementsSpecList);
+
+        data.setAccountId(accountId);
+
+        data.setPageName(pageName);
+
+        data.setPageTemplateId(pageTemplateId);
+
+        ShareContentSpec shareContentSpec = new ShareContentSpec();
+        shareContentSpec.setShareTitle(shareTitle);
+        shareContentSpec.setShareDescription(shareDescription);
+        data.setShareContentSpec(shareContentSpec);
+    }
+
+    public WechatPagesAddResponseData addWechatPages() throws Exception {
+        WechatPagesAddResponseData response = tencentAds.wechatPages().wechatPagesAdd(data);
+        return response;
+    }
+
+    public static void main(String[] args) {
+        try {
+            AddWechatPages addWechatPages = new AddWechatPages();
+            addWechatPages.init();
+            WechatPagesAddResponseData response = addWechatPages.addWechatPages();
+            System.out.println(response);
+        } catch (TencentAdsResponseException e) {
+            e.printStackTrace();
+        } catch (TencentAdsSDKException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 173 - 0
src/main/java/com/lala/controller/Demo.java

@@ -0,0 +1,173 @@
+package com.lala.controller;
+
+import org.openqa.selenium.*;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.logging.Logs;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+
+import static sun.font.FontUtilities.isWindows;
+
+/**
+ * @author yj
+ * @date 2020/10/14 10:20 上午
+ */
+public class Demo {
+
+    // 1608171135013
+
+
+    public static void main(String[] args) throws IOException, InterruptedException {
+//        System.out.println(System.currentTimeMillis());
+
+//        System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");
+//        ChromeOptions chromeOptions = new ChromeOptions();
+//        chromeOptions.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        // 1.创建webdriver驱动
+
+        ProcessBuilder builder = new ProcessBuilder();
+        String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+        if (isWindows) {
+            builder.command("cmd.exe", "/c", "dir");
+        } else {
+            builder.command("sh", "-c", cmd);
+        }
+        builder.directory(new File(System.getProperty("user.home")));
+
+
+//            String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+        String cmdarray[] = {"sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\""};
+        Process pro = builder.start();
+        ChromeOptions options = new ChromeOptions();
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        WebDriver driver = new ChromeDriver(options);
+        driver.get("https://a.weixin.qq.com/client");
+        int status = pro.waitFor();
+
+        if (status != 0)
+        {
+            System.out.println("Failed to call shell's command ");
+        }
+
+
+//        JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
+//        String token = (String) jsExecutor.executeScript("return sessionStorage.getItem('Token');");
+//        System.out.println("token=" +token);
+        //
+        driver.findElement(By.xpath("/html/body/div[1]/div/span/div/main/div/div[2]/div[2]/div[2]/div[1]/div/div[2]/table/tbody/tr[1]/td/div/a")).click();
+//        Set<String>  winHandels  =  driver .getWindowHandles();
+//        List<String> it = new ArrayList<>(winHandels);
+//        driver.switchTo().window(it.get(1));
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div[2]/div[2]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button/span")).click();
+//        winHandels = driver.getWindowHandles();
+//        it = new ArrayList<>(winHandels);
+//        System.out.println(winHandels.toString());
+//        System.out.println(it.toString());
+//        driver.switchTo().window(it.get(2));
+//        //
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[6]/button/span")).click();
+//        driver.quit();
+        //
+
+
+
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[1]/div/button/span")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[3]/ol/li[1]")).click();
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[1]/button/span")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[3]/ol/li[1]")).click();
+//
+//
+//
+//        //
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[4]/div/div[2]/button[1]/span")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[4]/div/div[3]/div[1]/div/div")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[4]/div/div[3]/div[2]/div/div[1]")).click();
+//
+//
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[5]/div[2]/div[1]/div/input")).sendKeys("1000");
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[6]/button/span")).click();
+//
+//
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[1]/div/div/label[1]/span[2]")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[2]/div/div[1]/input")).sendKeys("2020-12-15");
+//        //
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[2]/div/div[2]/input")).sendKeys("2021-01-13");
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[3]/div/div/label[1]")).click();
+//
+//
+//
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[2]/form/div/div/div/button[2]/span")).click();
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[3]/div[2]/div[2]/div[2]/div[2]/div[1]/div/div/div/input")).sendKeys("北京");
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[3]/div/div/label[1]")).click();
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[2]/div/div[1]/button")).click();
+//
+//        ///html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[5]/div[3]/div/button/span
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[5]/div[3]/div/button/span")).click();
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[5]/div[3]/div/div")).sendKeys("");
+//
+//        ///html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/label/i")).click();
+//        driver.findElement(By.xpath("")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div/button[2]")).click();
+
+
+
+//        driver.manage().window().maximize();
+//        Set<String> windows =  driver.getWindowHandles();
+//
+//        for (String temhandle : driver.getWindowHandles()) {
+//            if (!temhandle.equals(driver.getWindowHandle())){
+//                driver.close();
+//                driver.switchTo().window(temhandle);
+//            }
+//        }
+
+
+//        windows.forEach(System.out::println);
+
+
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div[2]/div[2]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button/span")).click();
+        // 3.获取输入框,输入selenium
+//        driver.findElement(By.id("kw")).sendKeys("selenium");
+        // 4.获取“百度一下”按钮,进行搜索
+//        driver.findElement(By.id("su")).click();
+        // 5.退出浏览器
+//        driver.quit();
+
+
+
+
+
+
+    }
+}

+ 77 - 0
src/main/java/com/lala/controller/GetWechatPages.java

@@ -0,0 +1,77 @@
+package com.lala.controller;
+
+import com.tencent.ads.ApiContextConfig;
+import com.tencent.ads.TencentAds;
+import com.tencent.ads.exception.TencentAdsResponseException;
+import com.tencent.ads.exception.TencentAdsSDKException;
+import com.tencent.ads.model.FilteringStruct;
+import com.tencent.ads.model.WechatPagesGetResponseData;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author yj
+ * @date 2020/12/29 下午1:32
+ */
+public class GetWechatPages {
+
+
+    /** YOUR ACCESS TOKEN */
+    public String ACCESS_TOKEN = "f4c3bb62ee6b12340381ad460b2c9d7d";
+
+    /** TencentAds */
+    public TencentAds tencentAds;
+
+    public Long accountId = 17749882L;
+
+    public List<FilteringStruct> filtering = null;
+
+    public Long page = 1L;
+
+    public Long pageSize = 10L;
+    //pageTemplateId
+    public List<String> fields =
+            Arrays.asList(
+                    "page_id",
+                    "page_name",
+                    "created_time",
+                    "last_modified_time",
+                    "page_template_id",
+                    "page_elements_spec_list",
+                    "share_content_spec",
+                    "preview_url",
+                    "page_type");
+
+    public void init() {
+        this.tencentAds = TencentAds.getInstance();
+        this.tencentAds.init(
+                new ApiContextConfig().accessToken(ACCESS_TOKEN).isDebug(true)); // debug==true 会打印请求详细信息
+        this.tencentAds.useProduction(); // 默认使用沙箱环境,如果要请求线上,这里需要设为线上环境
+        this.buildParams();
+    }
+
+    public void buildParams() {}
+
+    public WechatPagesGetResponseData getWechatPages() throws Exception {
+        WechatPagesGetResponseData response =
+                tencentAds.wechatPages().wechatPagesGet(accountId, filtering, page, pageSize, fields);
+        return response;
+    }
+
+    public static void main(String[] args) {
+        try {
+            GetWechatPages getWechatPages = new GetWechatPages();
+            getWechatPages.init();
+            WechatPagesGetResponseData response = getWechatPages.getWechatPages();
+            System.out.println(response);
+        } catch (TencentAdsResponseException e) {
+            e.printStackTrace();
+        } catch (TencentAdsSDKException e) {
+            e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 48 - 0
src/main/java/com/lala/controller/PlanDto.java

@@ -0,0 +1,48 @@
+package com.lala.controller;
+
+/**
+ * @author yj
+ * @date 2020/12/18 下午1:42
+ */
+
+public class PlanDto {
+
+
+
+    private String xpath;
+
+    private Integer type;
+
+    private String keys;
+
+
+    public String getXpath() {
+        return xpath;
+    }
+
+    public void setXpath(String xpath) {
+        this.xpath = xpath;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getKeys() {
+        return keys;
+    }
+
+    public void setKeys(String keys) {
+        this.keys = keys;
+    }
+
+    public PlanDto(String xpath, Integer type, String keys) {
+        this.xpath = xpath;
+        this.type = type;
+        this.keys = keys;
+    }
+}

+ 82 - 0
src/main/java/com/lala/controller/SSDermo.java

@@ -0,0 +1,82 @@
+package com.lala.controller;
+
+/**
+ * @author yj
+ * @date 2020/12/25 下午5:22
+ */
+public class SSDermo {
+
+
+    public static void main(String[] args) {
+        String text = "<html>\n" +
+                " <head></head>\n" +
+                " <body>\n" +
+                "  <p><br /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"http://mmbiz.qpic.cn/mmbiz_jpg/iaPIicoax5tLGlnKFdKSReu5pk8IfJpib0HJ4PVgH1s63WsraezVVQtbdHBFfoOorMRnUKRu7NsF1GpK1UD1lmLDA/0?wx_fmt=jpeg\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/04602ea7cf0bb8ab8506a8ee98badb76e07aae9a.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/67fd898a267b1a3fc3448d841c57c1688f9eb4ed.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/4edbce72b150e282b741f7075a33dd1c33e3589e.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/7f6ef526aa919f9488de89c2f24de13d0931e9e9.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/424f486f580a7f375fcc10bd947d5aa5aa03447c.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/35a7f40d66d3684fc04646eb7d208c74d6331155.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/58ec39fbcb221a5010da822e2de6b297e1756d51.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/37dad1f53470f052c7332bde39c2f8a8576bd404.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/593860f57962a685bd7ddaf81a5719f66e8f72e0.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/6825496d388d92dacd92e2f801035bbaafbd44bf.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/8e33bcdb5958749f7b6c5bd19eeec63554fcd655.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/484daed338bd817130991be51e340d91d9d600d5.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/d8fb1aebc0d6d5e3b35759bf2f12dbca0b3f7f42.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/f47577f82b8e044706875f2188fb6199c2ffda1b.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/68a10313fe254b3c6ca3f147c140f07deed6f4b4.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/0774c6293d146c45690cc92e21337ba1c5006f68.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/d5c1dea4ab8947d6eb31ac06d31e16370ef75f56.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/f1af6dc8adbedf374c1492884b4fdd2b6be66f50.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/2af9765281de2441fcbc711c2c67cf65c98650f9.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/d8f52c7bee00016b6d69a2ae19a9344ebdd56f66.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/8a86e1c185a33246f40d8678cee84b7d4ccd9bdb.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/3f5caefad29f31da06fa044b238e4ad89f75a4b8.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/614d1015f21d5e9d04e1ee411bd45aa81c7815a2.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/a4be3eba62298a3102ebf10cdfe51333a0a29070.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/0fcbb41e2fa73da36514b9a95cca0b8233ac0368.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p><br style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; max-width: 100%; overflow-wrap: break-word !important;\" /><br style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/4750d3bc14a1d48cb7d104e866d356cd5a925ab2.jpg\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/7b7230e74d01201abba3f20f3cb7f8a776578ffc.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/adc92d30f9896616a46cfc21007a4ae45a9f688d.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/eabe3c5eafc788bec45672f3e6e1e1cc43ec9d6e.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/e2e859c026dba2196c8d764d987711c321daa6d5.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/de4b81d0c1182b987d696290744a17b9d07f940a.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/ce02660f22829e34959072309f815a2f204d5863.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/76bf218ee99583090d6672b123737e2400b57bb0.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/d6d99c52a313a068b1c53a7c73c0a5b0d7759efa.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/dd33f543c657247edf2f1f3cec04b394d44728e5.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/ea43e9c42abf0d3e64ef25071d3ca3b9a7199c95.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/7b22a4bb7407fa8201dca4ced70b4de0dbdea7dd.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/19103ae3282357b91ccdc1eafe167821eb03ca54.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/fd15934cb0feb789a0e821cc81326dde525dd6df.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/8708ec60cab2bb1edd6228d287feb2cf80257d18.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/d28b8082b7a9f7b17d9047f7befcb9167fd9570b.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/7622101ef99a5addcf32dcd4b5563b4f9d401e9b.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/57190a6b62b7e5a5480891a089bac192f6e337b8.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/432a66cb739e59bf6a74d4613052162e7a95d48f.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/1eeb7d1d5399e63155a996cf806d1d7797610811.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/4e8cbf07c39e595d3f81a2c8f95e5258fb49095d.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/42453117b4c36010f917d4569e194499c7e142ae.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/1cce28f22d1d1287d378362f8bb6b2aab2583143.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/0d6a8626afb9aff2d6b1ba5f06498d8711faf59e.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/7aaa17ad6590cc4cc87862254789d468db1d84cc.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p style=\"padding: 0px; max-width: 100%; clear: both; min-height: 1em; box-sizing: border-box !important; margin-top: 0px !important; margin-bottom: 0px !important; overflow-wrap: break-word !important; line-height: 0 !important;\"><img src=\"https://qcdn.zhangzhongyun.com/render-articles/22130/10798207/797eb4bfafa17c70aecbd8c8b80581cf3fd8c941.jpg?imageView2/0/q/70\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p><br style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; max-width: 100%; overflow-wrap: break-word !important;\" /><br style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p><img src=\"https://qcdn.zhangzhongyun.com/wx_articles/templates/footer/footer1.gif\" style=\"box-sizing: border-box !important; margin: 0px; padding: 0px; border: 0px; vertical-align: middle; height: auto !important; max-width: 100%; overflow-wrap: break-word !important;\" /></p>\n" +
+                "  <p><br /></p>\n" +
+                "  <section style=\"margin: 0px; padding: 0px; max-width: 100%; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255); color: white; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\n" +
+                "   .\n" +
+                "  </section>\n" +
+                "  <p><br /></p>\n" +
+                "  <p><br /></p>\n" +
+                " </body>\n" +
+                "</html>";
+
+        String x = text.replace("https://qcdn.zhangzhongyun.com/render-articles/22130/10798206/4edbce72b150e282b741f7075a33dd1c33e3589e.jpg?imageView2/0/q/70","http://mmbiz.qpic.cn/mmbiz_jpg/iaPIicoax5tLGlnKFdKSReu5pk8IfJpib0HuSYhibsUPl0X5w0nR1mpibeb57HIyVW2ojXasIXGRaxPI3rRrVl1TKTg/0?wx_fmt=jpeg");
+        System.out.println(x);
+    }
+}

+ 98 - 0
src/main/java/com/lala/controller/ShellTest.java

@@ -0,0 +1,98 @@
+package com.lala.controller;
+
+
+
+
+import jodd.io.StreamGobbler;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.concurrent.Executors;
+
+import static sun.font.FontUtilities.isWindows;
+
+/**
+ * @author yj
+ * @date 2020/12/17 上午11:41
+ */
+public class ShellTest {
+
+    /**
+     *    String bashCommand = "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222";
+     *             String bashCommand = "chmod 777 " + "/usr/local/java/jdk1.8.0_121/lib/stopffmpeg.sh" ;
+     *             String bashCommand = "kill -9" + ip;
+     * @param args
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    public static void main(String[] args) throws IOException, InterruptedException {
+
+
+//        BufferedReader reader = null;
+        try{
+//            reader = new BufferedReader(new InputStreamReader(System.in));
+//            System.out.println("请输入IP:");
+//            String ip = reader.readLine();
+
+
+
+            ProcessBuilder builder = new ProcessBuilder();
+            String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+            if (isWindows) {
+                builder.command("cmd.exe", "/c", "dir");
+            } else {
+                builder.command("sh", "-c", cmd);
+            }
+            builder.directory(new File(System.getProperty("user.home")));
+
+//            String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+            String cmdarray[] = {"sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\""};
+            Runtime runtime = Runtime.getRuntime();
+            Process pro = builder.start();
+            int status = pro.waitFor();
+            if (status != 0)
+            {
+                System.out.println("Failed to call shell's command ");
+            }
+
+            BufferedReader br = new BufferedReader(new InputStreamReader(pro.getInputStream()));
+            StringBuffer strbr = new StringBuffer();
+            String line;
+            while ((line = br.readLine())!= null)
+            {
+                strbr.append(line).append("\n");
+            }
+
+            String result = strbr.toString();
+            System.out.println(result);
+
+        }
+        catch (IOException ec)
+        {
+            ec.printStackTrace();
+        }
+        catch (InterruptedException ex){
+            ex.printStackTrace();
+
+        }
+
+    }
+
+
+    public static void ex() throws IOException, InterruptedException {
+        ProcessBuilder builder = new ProcessBuilder();
+        if (isWindows) {
+            builder.command("cmd.exe", "/c", "dir");
+        } else {
+            builder.command("sh", "-c", "pwd");
+        }
+        builder.directory(new File(System.getProperty("user.home")));
+        Process process = builder.start();
+        int exitCode = process.waitFor();
+        assert exitCode == 0;
+    }
+
+
+}

+ 29 - 0
src/main/java/com/lala/controller/StringText.java

@@ -0,0 +1,29 @@
+package com.lala.controller;
+
+/**
+ * @author yj
+ * @date 2020/12/23 上午10:31
+ */
+public class StringText {
+
+
+    public static void main(String[] args) {
+        String l = "【福利】冬至到!#粉丝昵称#!送上书币暖暖身!" +
+                "<br/><br/>┌——❄冬至福利❄——┐<br/>" +
+                "<a href= \"https://c90003.818tu.com/pages/promotion-v0.html?pid=1395760&amp;promotion_id=1085625\\\">充15元送15,共得1500书币</a >" +
+                " <br/>└——❄点击领取❄——┘<br/><br/>\uD83D\uDD25 <a href=\\\"https://c90003.818tu.com/referrals/index/18050483\\\">《圣医下山》</a >" +
+                " <br/><br/>" +
+                "⚡ <a href=\\\"https://c90003.818tu.com/referrals/index/18050496\\\">《神眼医少》</a >" +
+                " <br/><br/>\uD83C\uDF38 <a href=\\\"https://c90003.818tu.com/referrals/index/18050543\\\">《龙婿临门》</a > 已更新!<br/><br/>↓↓更多精彩,戳菜单栏。";
+
+
+        String l1 = "【福利】冬至到!#粉丝昵称#!送上书币暖暖身!" +
+                "<br/><br/>┌——❄冬至福利❄——┐<br/>" +
+                "<a href= \"https://c90003.818tu.com/pages/promotion-v0.html?pid=1395760&amp;promotion_id=1085625\\\">充15元送15,共得1500书币</a >" +
+                " <br/>└——❄点击领取❄——┘<br/><br/>\uD83D\uDD25 <a href=\\\"https://c90003.818tu.com/referrals/index/18050483\\\">《圣医下山》</a >" +
+                " <br/><br/>" +
+                "⚡ <a href=\\\"https://c90003.818tu.com/referrals/index/18050496\\\">《神眼医少》</a >" ;
+        System.out.println(l.getBytes().length);
+        System.out.println(l1.getBytes().length);
+    }
+}

+ 97 - 0
src/main/java/com/lala/controller/UserController.java

@@ -0,0 +1,97 @@
+package com.lala.controller;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+@RestController
+@RequestMapping("/x")
+public class UserController {
+
+
+    @PostMapping("/test")
+    public Boolean ossUpload(@RequestBody List<PlanDto> dto){
+        ChromeOptions options = new ChromeOptions();
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        WebDriver driver = new ChromeDriver(options);
+//        driver.get("https://a.weixin.qq.com/client");
+        for (PlanDto d:dto){
+            if (d.getType() == 1){
+                if ("//*[@id=\"target_next_step\"]".equals(d.getXpath())){
+                    System.out.println("123123123123");
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                    Set<String> windowHandles = driver.getWindowHandles();
+                    windowHandles.forEach(System.out::println);
+                    try {
+                        driver.wait(3L);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+
+            } else {
+                driver.findElement(By.xpath(d.getXpath())).sendKeys(d.getKeys());
+            }
+        }
+        return true;
+    }
+
+
+
+
+
+
+//    @CrossOrigin
+//    @GetMapping("")
+//    public Object get(){
+//
+//        return "Hellow,nidaye";
+//    }
+//
+//    public static void main(String[] args) {
+//        int[] res = maopao(new int[]{9,2,5,1,6,88,4,35,674,2,3});
+//        System.out.println(Arrays.toString(res));
+//    }
+//
+//
+//    private static int[] maopao(int[] ints){
+//
+////        if (arr == null || arr.length < 2) {
+////            4             return arr;
+////            5         }
+////        6         int n = arr.length;
+////        7         for (int i = 0; i < n; i++) {
+////            8             for (int j = 0; j < n -i - 1; j++) {
+////                9                 if (arr[j + 1] < arr[j]) {
+////                    10                     int t = arr[j];
+////                    11                     arr[j] = arr[j+1];
+////                    12                     arr[j+1] = t;
+////                    13                 }
+////                14             }
+////            15         }
+////        16         return arr;
+//
+//        if (ints == null || ints.length < 2){
+//            return null;
+//        }
+//        int l = ints.length;
+//        for (int i = 0;i<l;i++){
+//            for (int j=0;j<l-i-1;j++){
+//                if (ints[j+1]<ints[j]){
+//                    int mid = ints[j];
+//                    ints[j]=ints[j+1];
+//                    ints[j+1] =mid;
+//                };
+//            }
+//        }
+//
+//        return ints;
+//
+//    }
+}

+ 14 - 0
src/main/java/com/lala/yj/YjApplication.java

@@ -0,0 +1,14 @@
+package com.lala.yj;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class YjApplication {
+
+    public static void main(String[] args) {
+
+        SpringApplication.run(YjApplication.class, args);
+    }
+
+}

+ 103 - 0
src/main/java/com/lala/yj/controller/CVtest.java

@@ -0,0 +1,103 @@
+package com.lala.yj.controller;
+
+import org.openqa.selenium.*;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author yj
+ * @date 2020/12/28 上午11:37
+ */
+public class CVtest {
+
+    private static WebDriver driver;
+    static final int MAX_TIMEOUT_IN_SECONDS = 5;
+
+//    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        System.setProperty("webdriver.chrome.driver",
+                System.getProperty("user.dir") + File.separator
+                        + "chromedriver.exe");
+        driver = new ChromeDriver();
+        String url = "http://cn.bing.com/";
+        driver.manage().window().maximize();
+        driver.manage().timeouts()
+                .implicitlyWait(MAX_TIMEOUT_IN_SECONDS, TimeUnit.SECONDS);
+        driver.get(url);
+    }
+
+//    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+        if (driver != null) {
+            System.out.println("运行结束!");
+            driver.quit();
+        }
+    }
+
+
+    public static void main(String[] args) {
+
+    }
+
+    public  void test() {
+
+        ChromeOptions options = new ChromeOptions();
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setJavascriptEnabled(true);
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        String queryString = "Selenium自动化测试";
+        WebDriver driver = new ChromeDriver(options);
+        WebElement element = driver.findElement(By.xpath("//input[@id='sb_form_q']"));
+        // 直接输入查询字符串
+        // element.sendKeys(queryString);
+
+        // 下面的语句模拟复制粘贴功能、copy & paste
+        // 向粘贴板中存放数据,还可以注释掉下面的语句,进行手工复制一些东西到粘贴板
+        setClipboardData(queryString);
+        // 模拟Ctrl+V,进行粘贴
+        Robot robot = null;
+        try {
+            robot = new Robot();
+        } catch (AWTException e1) {
+            e1.printStackTrace();
+        }
+        robot.keyPress(KeyEvent.VK_CONTROL);
+        robot.keyPress(KeyEvent.VK_V);
+        robot.keyRelease(KeyEvent.VK_V);
+        robot.keyRelease(KeyEvent.VK_CONTROL);
+        // 点击查询按钮
+        driver.findElement(By.xpath("//input[@id='sb_form_go']")).click();
+        // 截图函数
+        captureScreenshot("截图测试JUnit");
+
+    }
+
+    private void captureScreenshot(String fileName) {
+        String imagePath = System.getProperty("user.dir") + File.separator
+                + fileName + ".png";
+        try {
+            byte[] decodedScreenshot = ((TakesScreenshot) driver)
+                    .getScreenshotAs(OutputType.BYTES);
+            FileOutputStream fos = new FileOutputStream(new File(imagePath));
+            fos.write(decodedScreenshot);
+            fos.close();
+            System.out.println("截图保存至" + imagePath);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void setClipboardData(String string) {
+        StringSelection stringSelection = new StringSelection(string);
+        Toolkit.getDefaultToolkit().getSystemClipboard()
+                .setContents(stringSelection, null);
+    }
+}

+ 146 - 0
src/main/java/com/lala/yj/controller/ChromeDriverProxy.java

@@ -0,0 +1,146 @@
+package com.lala.yj.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import org.openqa.selenium.Cookie;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeDriverService;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.springframework.http.*;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.*;
+
+/**
+ * @author yj
+ * @date 2020/12/23 上午11:35
+ */
+public class ChromeDriverProxy extends ChromeDriver {
+    private static final int COMMAND_TIMEOUT = 5000;
+    // 必须固定端口,因为ChromeDriver没有实时获取端口的接口;
+    private static final int CHROME_DRIVER_PORT = 9999;
+    public static ChromeDriverService driverService = new ChromeDriverService.Builder().usingPort(CHROME_DRIVER_PORT).build();
+
+    private static final String mpListUrl = "https://a.weixin.qq.com/cgi-bin/agency/get_delivery_metrics?page=%s&page_size=100&ascending=1&only_collect=0&g_tk=%s&_=%s";
+
+    public static final List<MpAccountDto> mplist = new ArrayList<>(500);
+
+    public static  Integer totalMp = 0;
+
+    public static final Map<String,String> tokenMap = new HashMap<>();
+
+    public ChromeDriverProxy(ChromeOptions options) {
+        super(driverService, options);
+    }
+
+    public static MpListVo  getList(Integer page, Integer size) {
+        MpListVo mpListVo = new MpListVo();
+        mpListVo.setTotal(totalMp);
+        int total = mplist.size();
+        if (page * size > total) {
+            mpListVo.setDtos(mplist.subList((page-1)*size,total));
+
+        } else {
+            mpListVo.setDtos(mplist.subList((page-1)*size,(page-1)*size+size));
+        }
+        return mpListVo;
+    }
+
+    public static void gitUpLoad(WebDriver driver, String token) throws Exception {
+        HttpHeaders headers = getHeader(driver);//获取header
+        RestTemplate template = new RestTemplate();
+//        MultiValueMap<String,String> param = new LinkedMultiValueMap<String, String>();//参数放入一个map中,restTemplate不能用hashMap
+        HttpEntity request = new HttpEntity(headers);
+
+
+//        Map<String,Object> param = new HashMap<>();//参数放入一个map中,restTemplate不能用hashMap
+//        //将请求参数放入map中
+//        param.put("page",1);
+//        param.put("page_size",10);
+//        param.put("ascending",1);
+//        param.put("only_collect",1);
+//        param.put("g_tk",token);
+//        param.put("_",System.currentTimeMillis());
+        String realUrl = String.format(mpListUrl, String.valueOf(1), token, String.valueOf(System.currentTimeMillis()));
+        ResponseEntity<JSONObject> exchange = template.exchange(realUrl, HttpMethod.GET, request, JSONObject.class);
+        JSONObject jsonObject = exchange.getBody();
+        assert jsonObject != null;
+        List<MpAccountDto> mpAccountDtos = jsonObject.getJSONArray("list").toJavaList(MpAccountDto.class);
+        mplist.addAll(mpAccountDtos);
+        int total = jsonObject.getJSONObject("page_info").getIntValue("total");
+        totalMp = total;
+        if (total > 100) {
+            int p = total / 100 + (total % 100 > 0 ? 1 : 0);
+            for (int i = 2; i <= p; i++) {
+                String realUrl1 = String.format(mpListUrl, String.valueOf(i), token, String.valueOf(System.currentTimeMillis()));
+                ResponseEntity<JSONObject> exchange1 = template.exchange(realUrl1, HttpMethod.GET, request, JSONObject.class);
+                JSONObject jsonObject1 = exchange1.getBody();
+                assert jsonObject1 != null;
+                List<MpAccountDto> mpAccountDtos1 = jsonObject1.getJSONArray("list").toJavaList(MpAccountDto.class);
+                mplist.addAll(mpAccountDtos1);
+            }
+        }
+        System.out.println(mplist.toString());
+        System.out.println(mpAccountDtos.toString());
+        System.out.println(total);
+        System.out.println();
+        System.out.println(jsonObject.get("list"));
+    }
+
+
+    public static HttpHeaders getHeader(WebDriver driver) {
+        HttpHeaders headers = new HttpHeaders();
+        Set<Cookie> cookies = driver.manage().getCookies();//获取浏览器cookies
+        List<String> cookieList = new ArrayList<String>();
+        for (Cookie cookie : cookies) { //将浏览器cookies放入list中
+            //System.out.println("当前cookies为:" +  cookie.getDomain() + " " + cookie.getName() + ":" + cookie.getValue());
+            cookieList.add(cookie.getName() + "=" + cookie.getValue());
+        }
+        //System.out.println("cookie为:" + cookieList.toString());
+        headers.put(HttpHeaders.COOKIE, cookieList); //将cookie放入header
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); //post表单 ,如果是个json则设置为MediaType.APPLICATION_JSON
+        return headers;
+
+    }
+
+    // 根据请求ID获取返回内容
+//    public ResponseBodyVo getResponseBody(String requestId) {
+//        ResponseBodyVo result = null;
+//
+//        try {
+//            // CHROME_DRIVER_PORT chromeDriver提供的端口
+//            String url = String.format("http://localhost:%s/session/%s/goog/cdp/execute",
+//                    CHROME_DRIVER_PORT, getSessionId());
+//            RestTemplate restTemplate = new RestTemplate();
+//            HttpHeaders httpHeaders = new HttpHeaders();
+//            httpHeaders.add();
+//            restTemplate.getForEntity(url,JSONObject.class);
+//            HttpPost httpPost = new HttpPost(url);
+//            JSONObject object = new JSONObject();
+//            JSONObject params = new JSONObject();
+//            params.put("requestId", requestId);
+//            object.put("cmd", "Network.getResponseBody");
+//            object.put("params", params);
+//
+//            httpPost.setEntity(new StringEntity(object.toString()));
+//
+//            RequestConfig requestConfig = RequestConfig
+//                    .custom()
+//                    .setSocketTimeout(COMMAND_TIMEOUT)
+//                    .setConnectTimeout(COMMAND_TIMEOUT).build();
+//
+//            CloseableHttpClient httpClient = HttpClientBuilder.create()
+//                    .setDefaultRequestConfig(requestConfig).build();
+//
+//            HttpResponse response = httpClient.execute(httpPost);
+//
+//            JSONObject data = JSONObject.parseObject(EntityUtils.toString(response.getEntity()));
+//            return JSONObject.toJavaObject(data, ResponseBodyVo.class);
+//        } catch (IOException e) {
+//            logger.error("getResponseBody failed!", e);
+//        }
+//
+//        return result;
+//    }
+
+}

+ 213 - 0
src/main/java/com/lala/yj/controller/Demo.java

@@ -0,0 +1,213 @@
+package com.lala.yj.controller;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.concurrent.TimeUnit;
+
+import static sun.font.FontUtilities.isWindows;
+
+/**
+ * @author yj
+ * @date 2020/10/14 10:20 上午
+ */
+public class Demo {
+
+    // 1608171135013
+
+    public static final String first_xpath = "//*[@id=\"wxadcontainer\"]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button";
+
+    private static void sendGet(String url) throws Exception {
+
+//        String url = "http://www.google.com/search?q=mkyong";
+
+        URL obj = new URL(url);
+        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+        //默认值我GET
+        con.setRequestMethod("GET");
+
+        //添加请求头
+//        con.setRequestProperty("User-Agent", USER_AGENT);
+
+        int responseCode = con.getResponseCode();
+        System.out.println("\nSending 'GET' request to URL : " + url);
+        System.out.println("Response Code : " + responseCode);
+
+        BufferedReader in = new BufferedReader(
+                new InputStreamReader(con.getInputStream()));
+        String inputLine;
+        StringBuffer response = new StringBuffer();
+
+        while ((inputLine = in.readLine()) != null) {
+            response.append(inputLine);
+        }
+        in.close();
+
+        //打印结果
+        System.out.println(response.toString());
+
+    }
+
+
+    public static void main(String[] args) throws Exception {
+//        System.out.println(System.currentTimeMillis());
+
+//        System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");
+//        ChromeOptions chromeOptions = new ChromeOptions();
+//        chromeOptions.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        // 1.创建webdriver驱动
+
+        ProcessBuilder builder = new ProcessBuilder();
+        String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+        if (isWindows) {
+            builder.command("cmd.exe", "/c", "dir");
+        } else {
+            builder.command("sh", "-c", cmd);
+        }
+        builder.directory(new File(System.getProperty("user.home")));
+
+
+//            String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+//        String cmdarray[] = {"sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\""};
+        Process pro = builder.start();
+        ChromeOptions options = new ChromeOptions();
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+//        options.addArguments("headless");
+//        options.addArguments("no-sandbox");
+        WebDriver driver = new ChromeDriver(options);
+        TimeUnit.SECONDS.sleep(1);
+        driver.get("https://a.weixin.qq.com/client");
+        System.out.println("-----------");
+        int status = pro.waitFor();
+        if (status != 0)
+        {
+            System.out.println("Failed to call shell's command ");
+        }
+
+
+//        JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
+//        String token = (String) jsExecutor.executeScript("return sessionStorage.getItem('Token');");
+//        System.out.println("token=" +token);
+        //
+        driver.findElement(By.xpath("/html/body/div[1]/div/span/div/main/div/div[2]/div[2]/div[2]/div[1]/div/div[2]/table/tbody/tr[1]/td/div/a")).click();
+
+
+
+//        Set<String>  winHandels  =  driver .getWindowHandles();
+//        List<String> it = new ArrayList<>(winHandels);
+//        driver.switchTo().window(it.get(1));
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div[2]/div[2]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button/span")).click();
+//        winHandels = driver.getWindowHandles();
+//        it = new ArrayList<>(winHandels);
+//        System.out.println(winHandels.toString());
+//        System.out.println(it.toString());
+//        driver.switchTo().window(it.get(2));
+//        //
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[6]/button/span")).click();
+//        driver.quit();
+        //
+
+
+
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[1]/div/button/span")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[3]/ol/li[1]")).click();
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[1]/button/span")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div[3]/div[3]/ol/li[1]")).click();
+//
+//
+//
+//        //
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[4]/div/div[2]/button[1]/span")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[4]/div/div[3]/div[1]/div/div")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[4]/div/div[3]/div[2]/div/div[1]")).click();
+//
+//
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[5]/div[2]/div[1]/div/input")).sendKeys("1000");
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[6]/button/span")).click();
+//
+//
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[1]/div/div/label[1]/span[2]")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[2]/div/div[1]/input")).sendKeys("2020-12-15");
+//        //
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[2]/div/div[2]/input")).sendKeys("2021-01-13");
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[3]/div/div/label[1]")).click();
+//
+//
+//
+//
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[2]/form/div/div/div/button[2]/span")).click();
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[3]/div[2]/div[2]/div[2]/div[2]/div[1]/div/div/div/input")).sendKeys("北京");
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[3]/div/div/label[1]")).click();
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[2]/div/div[1]/button")).click();
+//
+//        ///html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[5]/div[3]/div/button/span
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[5]/div[3]/div/button/span")).click();
+//
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/div[2]/div/div[1]/div[1]/div[2]/div/form/div[5]/div[3]/div/div")).sendKeys("");
+//
+//        ///html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]
+//
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[2]/label/i")).click();
+//        driver.findElement(By.xpath("")).click();
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div/div[2]/div[1]/div/div[2]/main/div/div[3]/div/button[2]")).click();
+
+
+
+//        driver.manage().window().maximize();
+//        Set<String> windows =  driver.getWindowHandles();
+//
+//        for (String temhandle : driver.getWindowHandles()) {
+//            if (!temhandle.equals(driver.getWindowHandle())){
+//                driver.close();
+//                driver.switchTo().window(temhandle);
+//            }
+//        }
+
+
+//        windows.forEach(System.out::println);
+
+
+//        driver.findElement(By.xpath("/html/body/div[2]/div/div[2]/div[2]/div[2]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button/span")).click();
+        // 3.获取输入框,输入selenium
+//        driver.findElement(By.id("kw")).sendKeys("selenium");
+        // 4.获取“百度一下”按钮,进行搜索
+//        driver.findElement(By.id("su")).click();
+        // 5.退出浏览器
+//        driver.quit();
+
+
+
+
+
+
+    }
+}

+ 19 - 0
src/main/java/com/lala/yj/controller/ExecuteDto.java

@@ -0,0 +1,19 @@
+package com.lala.yj.controller;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author yj
+ * @date 2020/12/23 下午3:37
+ */
+
+@Data
+public class ExecuteDto {
+
+
+    private List<PlanDto> dto;
+
+    private List<String> appIds;
+}

+ 19 - 0
src/main/java/com/lala/yj/controller/MpAccountDto.java

@@ -0,0 +1,19 @@
+package com.lala.yj.controller;
+
+import lombok.Data;
+
+/**
+ * @author yj
+ * @date 2020/12/23 上午11:00
+ */
+@Data
+public class MpAccountDto {
+
+
+    private String appid;
+
+    private String mp_name;
+
+
+
+}

+ 112 - 0
src/main/java/com/lala/yj/controller/MpListHandle.java

@@ -0,0 +1,112 @@
+package com.lala.yj.controller;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author yj
+ * @date 2020/12/18 下午2:08
+ */
+public class MpListHandle implements Runnable{
+
+
+    @Override
+    public void run() {
+        ChromeOptions options = new ChromeOptions();
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setJavascriptEnabled(true);
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        WebDriver driver = new ChromeDriver(options);
+        String href = driver.findElement(By.xpath("//*[@id=\"root\"]/div/span/div/main/div/div[2]/div[2]/div[2]/div[2]/table/tbody/tr[1]/td[10]/div/div/a")).getAttribute("href");
+        String token = href.substring(href.indexOf("g_tk="),href.indexOf("&mgr_type")).substring(5);
+        ChromeDriverProxy.tokenMap.put("token",token);
+        try {
+            ChromeDriverProxy.gitUpLoad(driver,token);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+//        System.out.println(res.toString());
+//        for (PlanDto d:dto){
+//            if (d.getType() == 1){
+//                if ("//*[@id=\"target_next_step\"]".equals(d.getXpath())){
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                    System.out.println("123123123123");
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                    Set<String> windowHandles = driver.getWindowHandles();
+//                    windowHandles.forEach(System.out::println);
+//                    try {
+//                        TimeUnit.SECONDS.sleep(2);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                } else if ("//*[@id=\"test_material_container\"]/div[1]/div".equals(d.getXpath())){
+//                    try {
+//                        TimeUnit.SECONDS.sleep(1);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                } else if ("//*[@id=\"choose_template\"]".equals(d.getXpath())){
+//                    try {
+//                        TimeUnit.SECONDS.sleep(2);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                } else if ("/html/body/div[7]/div/div/div[2]/div/div[1]/div[2]/div/div/div[2]/div[2]/button[1]".equals(d.getXpath())){
+//                    try {
+//                        TimeUnit.SECONDS.sleep(2);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                } else if ("//*[@id=\"test_creative_next_step\"]".equals(d.getXpath())){
+//                    try {
+//                        TimeUnit.SECONDS.sleep(2);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                } else if ("//*[@id=\"test_creative_next_step\"]".equals(d.getXpath())){
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                    try {
+//                        TimeUnit.SECONDS.sleep(3);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+//                } else if ("//*[@id=\"test_confirmed_protocol\"]".equals(d.getXpath())){
+//                    System.out.println(111);
+//                    try {
+//                        TimeUnit.SECONDS.sleep(3);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+////                    driver.findElement(By.xpath(d.getXpath())).click();
+//                } else {
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+//                }
+//
+//                /**
+//                 *
+//                 js1="document.documentElement.scrollTop=10000"
+//                 driver.execute_script(js1)
+//                 */
+//            } else {
+//                driver.findElement(By.xpath(d.getXpath())).sendKeys(d.getKeys());
+//            }
+//        }
+    }
+}

+ 18 - 0
src/main/java/com/lala/yj/controller/MpListVo.java

@@ -0,0 +1,18 @@
+package com.lala.yj.controller;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author yj
+ * @date 2020/12/23 下午3:22
+ */
+@Data
+public class MpListVo {
+
+
+    List<MpAccountDto> dtos;
+
+    private Integer total;
+}

+ 48 - 0
src/main/java/com/lala/yj/controller/PlanDto.java

@@ -0,0 +1,48 @@
+package com.lala.yj.controller;
+
+/**
+ * @author yj
+ * @date 2020/12/18 下午1:42
+ */
+
+public class PlanDto {
+
+
+
+    private String xpath;
+
+    private Integer type;
+
+    private String keys;
+
+
+    public String getXpath() {
+        return xpath;
+    }
+
+    public void setXpath(String xpath) {
+        this.xpath = xpath;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getKeys() {
+        return keys;
+    }
+
+    public void setKeys(String keys) {
+        this.keys = keys;
+    }
+
+    public PlanDto(String xpath, Integer type, String keys) {
+        this.xpath = xpath;
+        this.type = type;
+        this.keys = keys;
+    }
+}

+ 25 - 0
src/main/java/com/lala/yj/controller/PlanDtoLo.java

@@ -0,0 +1,25 @@
+package com.lala.yj.controller;
+
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+/**
+ * @author yj
+ * @date 2020/12/18 下午6:05
+ */
+
+public class PlanDtoLo implements Runnable{
+
+    @Override
+    public void run() {
+        ChromeOptions options = new ChromeOptions();
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setJavascriptEnabled(true);
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        WebDriver driver = new ChromeDriver(options);
+        ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+    }
+}

+ 153 - 0
src/main/java/com/lala/yj/controller/PlanHandle.java

@@ -0,0 +1,153 @@
+package com.lala.yj.controller;
+
+import lombok.SneakyThrows;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author yj
+ * @date 2020/12/18 下午2:08
+ */
+public class PlanHandle implements Runnable {
+
+
+    public PlanHandle(List<PlanDto> dto) {
+        this.dto = dto;
+    }
+
+    private List<PlanDto> dto;
+
+//    public void changeWindow(WebDriver driver) {
+//        // 存储原始窗口的 ID
+//        String originalWindow = driver.getWindowHandle();
+//
+//// 检查一下,我们还没有打开其他的窗口
+//        assert driver.getWindowHandles().size() == 1;
+//
+//// 点击在新窗口中打开的链接
+//        driver.findElement(By.linkText("new window")).click();
+//
+//// 等待新窗口或标签页
+//        wait.until(numberOfWindowsToBe(2));
+//
+//// 循环执行,直到找到一个新的窗口句柄
+//        for (String windowHandle : driver.getWindowHandles()) {
+//            if (!originalWindow.contentEquals(windowHandle)) {
+//                driver.switchTo().window(windowHandle);
+//                break;
+//            }
+//        }
+//
+//// 等待新标签完成加载内容
+//        wait.until(titleIs("Selenium documentation"));
+//    }
+
+    public static String getLastHandle(WebDriver driver) {
+        //获取当前打开窗口的所有句柄
+        Set<String> Allhandles = driver.getWindowHandles();
+        ArrayList<String> lst = new ArrayList<String>(Allhandles);
+        return lst.get(lst.size()-1);
+    }
+
+    @SneakyThrows
+    @Override
+    public void run() {
+        ChromeOptions options = new ChromeOptions();
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setJavascriptEnabled(true);
+        options.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
+        WebDriver driver = new ChromeDriver(options);
+        for (PlanDto d : dto) {
+            if ("//*[@id=\"wxadcontainer\"]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button".equals(d.getXpath())) {
+                // 存储原始窗口的 ID
+                driver.findElement(By.xpath(d.getXpath())).click();
+                TimeUnit.SECONDS.sleep(1);
+                String newHandle = getLastHandle(driver);
+                // 循环执行,直到找到一个新的窗口句柄
+                driver.switchTo().window(newHandle);
+                continue;
+            }
+            if (d.getType() == 1) {
+                if ("//*[@id=\"target_next_step\"]".equals(d.getXpath())) {
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                    System.out.println("123123123123");
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                    Set<String> windowHandles = driver.getWindowHandles();
+                    windowHandles.forEach(System.out::println);
+                    try {
+                        TimeUnit.SECONDS.sleep(2);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                } else if ("//*[@id=\"test_material_container\"]/div[1]/div".equals(d.getXpath())) {
+                    try {
+                        TimeUnit.SECONDS.sleep(1);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                } else if ("//*[@id=\"choose_template\"]".equals(d.getXpath())) {
+                    try {
+                        TimeUnit.SECONDS.sleep(2);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                } else if ("/html/body/div[7]/div/div/div[2]/div/div[1]/div[2]/div/div/div[2]/div[2]/button[1]".equals(d.getXpath())) {
+                    try {
+                        TimeUnit.SECONDS.sleep(2);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                } else if ("//*[@id=\"test_creative_next_step\"]".equals(d.getXpath())) {
+                    try {
+                        TimeUnit.SECONDS.sleep(2);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                } else if ("//*[@id=\"test_creative_next_step\"]".equals(d.getXpath())) {
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                    try {
+                        TimeUnit.SECONDS.sleep(3);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+                } else if ("//*[@id=\"test_confirmed_protocol\"]".equals(d.getXpath())) {
+                    System.out.println(111);
+                    try {
+                        TimeUnit.SECONDS.sleep(3);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+                    driver.findElement(By.xpath(d.getXpath())).click();
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+                } else {
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                }
+
+                /**
+                 *
+                 js1="document.documentElement.scrollTop=10000"
+                 driver.execute_script(js1)
+                 */
+            } else {
+                driver.findElement(By.xpath(d.getXpath())).sendKeys(d.getKeys());
+            }
+        }
+
+
+    }
+}

+ 192 - 0
src/main/java/com/lala/yj/controller/PlanHandleNew.java

@@ -0,0 +1,192 @@
+package com.lala.yj.controller;
+
+import lombok.SneakyThrows;
+import org.openqa.selenium.*;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author yj
+ * @date 2020/12/23 下午3:39
+ */
+public class PlanHandleNew implements Runnable{
+
+    private List<String> appIds;
+    private List<PlanDto> dto;
+
+    private static final String firstUrl = "http://a.weixin.qq.com/cgi-bin/agency/redirect_mp?appid=%s&g_tk=%s&mgr_type=1";
+
+
+    public PlanHandleNew(List<String> appIds, List<PlanDto> dto) {
+        this.appIds = appIds;
+        this.dto = dto;
+    }
+
+    public static String getLastHandle(WebDriver driver) {
+        //获取当前打开窗口的所有句柄
+        Set<String> allHandles = driver.getWindowHandles();
+        ArrayList<String> lst = new ArrayList<String>(allHandles);
+        return lst.get(lst.size()-1);
+    }
+
+    public static void closeWindow(WebDriver driver){
+        Set<String> allHandles = driver.getWindowHandles();
+        for (String s:allHandles){
+            WebDriver driver1 = driver.switchTo().window(s);
+            if (!"微信广告服务商平台".equals(driver1.getTitle())){
+                driver1.close();
+            }
+        }
+    }
+
+    public void setAttribute(WebElement e, WebDriver d, String attributeName, String value) {
+        JavascriptExecutor js = (JavascriptExecutor) d;
+        // 执行JavaScriptdiamante修改页面元素属性。arguments[0]-[2]后面会用e,attributeName,value替换并执行
+        js.executeScript("document.getElementsByClassName(\"adui-input-base\")[0].value="+value);
+    }
+
+    public void cAndv(){
+
+    }
+
+    public static void setClipboardData(String string) {
+        StringSelection stringSelection = new StringSelection(string);
+        Toolkit.getDefaultToolkit().getSystemClipboard()
+                .setContents(stringSelection, null);
+    }
+
+
+    @SneakyThrows
+    @Override
+    public void run() {
+        ChromeOptions options = new ChromeOptions();
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setJavascriptEnabled(true);
+        options.setExperimentalOption("debuggerAddress","127.0.0.1:9222");
+        //   //*[@id="wxadcontainer"]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button
+        for (String appId:appIds){
+            WebDriver driver = new ChromeDriver(options);
+            String realUrl = String.format(firstUrl,appId,ChromeDriverProxy.tokenMap.get("token"));
+            String js = "window.open("+"\""+realUrl+"\");";
+            JavascriptExecutor driver_js= ((JavascriptExecutor) driver);
+            driver_js.executeScript(js);
+            TimeUnit.SECONDS.sleep(2);
+            String firstWindow =  getLastHandle(driver);
+            driver.switchTo().window(firstWindow);
+
+            for (PlanDto d:dto){
+                if ("//*[@id=\"wxadcontainer\"]/div[1]/div[2]/div[2]/div[4]/div[1]/div/div[2]/button".equals(d.getXpath())) {
+                    // 存储原始窗口的 ID
+                    driver.findElement(By.xpath(d.getXpath())).click();
+                    TimeUnit.SECONDS.sleep(1);
+                    String newHandle = getLastHandle(driver);
+                    // 循环执行,直到找到一个新的窗口句柄
+                    driver.switchTo().window(newHandle);
+                    continue;
+                }
+                if (d.getType() == 1){
+                    if ("//*[@id=\"target_next_step\"]".equals(d.getXpath())){
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                        System.out.println("123123123123");
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                        Set<String> windowHandles = driver.getWindowHandles();
+                        windowHandles.forEach(System.out::println);
+                        try {
+                            TimeUnit.SECONDS.sleep(2);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                    } else if ("//*[@id=\"test_material_container\"]/div[1]/div".equals(d.getXpath())){
+                        try {
+                            TimeUnit.SECONDS.sleep(1);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                    } else if ("//*[@id=\"choose_template\"]".equals(d.getXpath())){
+                        try {
+                            TimeUnit.SECONDS.sleep(2);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                    } else if ("/html/body/div[7]/div/div/div[2]/div/div[1]/div[2]/div/div/div[2]/div[2]/button[1]".equals(d.getXpath())){
+                        try {
+                            TimeUnit.SECONDS.sleep(2);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                    } else if ("//*[@id=\"test_creative_next_step\"]".equals(d.getXpath())){
+                        try {
+                            TimeUnit.SECONDS.sleep(2);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                    } else if ("//*[@id=\"test_creative_next_step\"]".equals(d.getXpath())){
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                        try {
+                            TimeUnit.SECONDS.sleep(3);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                        ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+                    } else if ("//*[@id=\"test_confirmed_protocol\"]".equals(d.getXpath())){
+                        System.out.println(111);
+                        try {
+                            TimeUnit.SECONDS.sleep(3);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                        ((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
+                        driver.findElement(By.xpath(d.getXpath())).click();
+//                    driver.findElement(By.xpath(d.getXpath())).click();
+                    } else {
+                        driver.findElement(By.xpath(d.getXpath())).click();
+                    }
+
+                    /**
+                     *
+                     js1="document.documentElement.scrollTop=10000"
+                     driver.execute_script(js1)
+                     */
+                } else {
+                    if ("//*[@id=\"wxadcontainer\"]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[2]/div/div[1]/input".equals(d.getXpath())
+                       || "//*[@id=\"wxadcontainer\"]/div[1]/div/div[2]/main/div/div[2]/div[1]/div/div[2]/div/div[1]/section[1]/div[2]/form/div[2]/div/div[2]/input".equals(d.getXpath())){
+                        for (int i = 0;i<7;i++){
+                            driver.findElement(By.xpath(d.getXpath())).sendKeys(Keys.BACK_SPACE);
+                        }
+                        driver.findElement(By.xpath(d.getXpath())).sendKeys(d.getKeys());
+//                        List<WebElement> webElement = driver.findElements(By.className("adui-date-cell"));
+//                        Integer year = Integer.parseInt(d.getKeys().substring(0,4));
+//                        Integer month = Integer.parseInt(d.getKeys().substring(5,9));
+//                        webElement.get(Integer.parseInt(d.getKeys())).click();
+//                        setAttribute(driver.findElement(By.xpath(d.getXpath())),driver,"value",d.getKeys());
+//                        JavascriptExecutor jse= ((JavascriptExecutor) driver);
+//                        jse.executeScript()
+//                        driver.findElement(By.xpath(d.getXpath())).sendKeys(Keys.DELETE);
+//                        TimeUnit.SECONDS.sleep(1);
+//                        driver.findElement(By.xpath(d.getXpath())).sendKeys(d.getKeys());
+                    } else {
+                        driver.findElement(By.xpath(d.getXpath())).sendKeys(d.getKeys());
+                    }
+
+                }
+            }
+            closeWindow(driver);
+            TimeUnit.SECONDS.sleep(1);
+        }
+
+
+
+    }
+}

+ 29 - 0
src/main/java/com/lala/yj/controller/RemoteDemo.java

@@ -0,0 +1,29 @@
+package com.lala.yj.controller;
+
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.openqa.selenium.remote.RemoteWebDriver;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @author yj
+ * @date 2020/12/25 上午11:10
+ */
+public class RemoteDemo {
+
+    public static void main(String[] args) throws InterruptedException, MalformedURLException {
+        // RemoteWebDriver的基本使用
+        //第一个参数:表示服务器的地址。第二个参数:表示预期的执行对象,其他的浏览器都可以以此类推
+        WebDriver driver = new RemoteWebDriver(new URL("http://192.168.88.110:4444/wd/hub/"), DesiredCapabilities.firefox());
+        driver.manage().window().maximize();
+        driver.get("http://www.baidu.com");
+        Thread.sleep(2000);
+        JavascriptExecutor js = (JavascriptExecutor)driver;
+        js.executeScript("alert('我现在在服务器')");
+        Thread.sleep(2000);
+        driver.quit();
+    }
+}

+ 100 - 0
src/main/java/com/lala/yj/controller/ShellTest.java

@@ -0,0 +1,100 @@
+package com.lala.yj.controller;
+
+
+
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import static sun.font.FontUtilities.isWindows;
+
+/**
+ * @author yj
+ * @date 2020/12/17 上午11:41
+ */
+public class ShellTest {
+
+    /**
+     *    String bashCommand = "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222";
+     *             String bashCommand = "chmod 777 " + "/usr/local/java/jdk1.8.0_121/lib/stopffmpeg.sh" ;
+     *             String bashCommand = "kill -9" + ip;
+     * @param args
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    public static void main(String[] args) throws IOException, InterruptedException {
+
+        System.out.println(301/100);
+        System.out.println(2/10);
+
+
+
+
+//        BufferedReader reader = null;
+//        try{
+////            reader = new BufferedReader(new InputStreamReader(System.in));
+////            System.out.println("请输入IP:");
+////            String ip = reader.readLine();
+//
+//
+//
+//            ProcessBuilder builder = new ProcessBuilder();
+//            String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+//            if (isWindows) {
+//                builder.command("cmd.exe", "/c", "dir");
+//            } else {
+//                builder.command("sh", "-c", cmd);
+//            }
+//            builder.directory(new File(System.getProperty("user.home")));
+//
+////            String cmd = "sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\"";
+//            String cmdarray[] = {"sh -c \"/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome -remote-debugging-port=9222\""};
+//            Runtime runtime = Runtime.getRuntime();
+//            Process pro = builder.start();
+//            int status = pro.waitFor();
+//            if (status != 0)
+//            {
+//                System.out.println("Failed to call shell's command ");
+//            }
+//
+//            BufferedReader br = new BufferedReader(new InputStreamReader(pro.getInputStream()));
+//            StringBuffer strbr = new StringBuffer();
+//            String line;
+//            while ((line = br.readLine())!= null)
+//            {
+//                strbr.append(line).append("\n");
+//            }
+//
+//            String result = strbr.toString();
+//            System.out.println(result);
+//
+//        }
+//        catch (IOException ec)
+//        {
+//            ec.printStackTrace();
+//        }
+//        catch (InterruptedException ex){
+//            ex.printStackTrace();
+//
+//        }
+
+    }
+
+
+    public static void ex() throws IOException, InterruptedException {
+        ProcessBuilder builder = new ProcessBuilder();
+        if (isWindows) {
+            builder.command("cmd.exe", "/c", "dir");
+        } else {
+            builder.command("sh", "-c", "pwd");
+        }
+        builder.directory(new File(System.getProperty("user.home")));
+        Process process = builder.start();
+        int exitCode = process.waitFor();
+        assert exitCode == 0;
+    }
+
+
+}

+ 113 - 0
src/main/java/com/lala/yj/controller/UserController.java

@@ -0,0 +1,113 @@
+package com.lala.yj.controller;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadPoolExecutor;
+
+@RestController
+@RequestMapping("/x")
+public class UserController {
+
+
+    @GetMapping("/mpl")
+    public Boolean mpl(){
+        MpListHandle mpListHandle = new MpListHandle();
+        Executors.newSingleThreadExecutor().execute(mpListHandle);
+        return true;
+    }
+
+
+    @PostMapping("/test")
+    public Boolean ossUpload(@RequestBody List<PlanDto> dto){
+        PlanHandle planHandle = new PlanHandle(dto);
+        Executors.newSingleThreadExecutor().execute(planHandle);
+//        driver.get("https://a.weixin.qq.com/client");
+        return true;
+    }
+
+    @PostMapping("/ex")
+    public Boolean ex(@RequestBody ExecuteDto dto){
+        PlanHandleNew planHandle = new PlanHandleNew(dto.getAppIds(),dto.getDto());
+        Executors.newSingleThreadExecutor().execute(planHandle);
+//        driver.get("https://a.weixin.qq.com/client");
+        return true;
+    }
+
+
+    @GetMapping("/list")
+    public MpListVo ossUpload(Integer page,Integer size){
+//        driver.get("https://a.weixin.qq.com/client");
+        return ChromeDriverProxy.getList(page, size);
+    }
+
+
+    @GetMapping("/test1")
+    public Boolean test1(){
+
+        PlanDtoLo planHandle = new PlanDtoLo();
+        Executors.newSingleThreadExecutor().execute(planHandle);
+//        driver.get("https://a.weixin.qq.com/client");
+        return true;
+    }
+
+
+
+
+
+//    @CrossOrigin
+//    @GetMapping("")
+//    public Object get(){
+//
+//        return "Hellow,nidaye";
+//    }
+//
+//    public static void main(String[] args) {
+//        int[] res = maopao(new int[]{9,2,5,1,6,88,4,35,674,2,3});
+//        System.out.println(Arrays.toString(res));
+//    }
+//
+//
+//    private static int[] maopao(int[] ints){
+//
+////        if (arr == null || arr.length < 2) {
+////            4             return arr;
+////            5         }
+////        6         int n = arr.length;
+////        7         for (int i = 0; i < n; i++) {
+////            8             for (int j = 0; j < n -i - 1; j++) {
+////                9                 if (arr[j + 1] < arr[j]) {
+////                    10                     int t = arr[j];
+////                    11                     arr[j] = arr[j+1];
+////                    12                     arr[j+1] = t;
+////                    13                 }
+////                14             }
+////            15         }
+////        16         return arr;
+//
+//        if (ints == null || ints.length < 2){
+//            return null;
+//        }
+//        int l = ints.length;
+//        for (int i = 0;i<l;i++){
+//            for (int j=0;j<l-i-1;j++){
+//                if (ints[j+1]<ints[j]){
+//                    int mid = ints[j];
+//                    ints[j]=ints[j+1];
+//                    ints[j+1] =mid;
+//                };
+//            }
+//        }
+//
+//        return ints;
+//
+//    }
+}

+ 35 - 0
src/main/resources/application.yml

@@ -0,0 +1,35 @@
+server:
+  port: 9899
+
+spring:
+  datasource:
+    name: yujieya
+    url: jdbc:mysql://127.0.0.1:3306/yujieya
+    username: root
+    password: 12345678
+    # 使用druid数据源
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: com.mysql.jdbc.Driver
+    filters: stat
+    maxActive: 20
+    initialSize: 1
+    maxWait: 60000
+    minIdle: 1
+    timeBetweenEvictionRunsMillis: 60000
+    minEvictableIdleTimeMillis: 300000
+    validationQuery: select 'x'
+    testWhileIdle: true
+    testOnBorrow: false
+    testOnReturn: false
+    poolPreparedStatements: true
+    maxOpenPreparedStatements: 20
+    druid:
+      filters:
+
+
+
+
+## 该配置节点为独立的节点,有很多同学容易将这个配置放在spring的节点下,导致配置无法被识别
+mybatis:
+  mapper-locations: classpath:mapping/*.xml  #注意:一定要对应mapper映射xml文件的所在路径
+  type-aliases-package: com.example.yujieya.entity  # 注意:对应实体类的路径

+ 13 - 0
src/test/java/com/lala/yj/YjApplicationTests.java

@@ -0,0 +1,13 @@
+package com.lala.yj;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class YjApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}