xiexiang 1 年之前
当前提交
d0fb657e59
共有 100 个文件被更改,包括 7656 次插入0 次删除
  1. 33 0
      .gitignore
  2. 18 0
      .mvn/wrapper/maven-wrapper.properties
  3. 二进制
      Articles.docx
  4. 250 0
      mvnw
  5. 146 0
      mvnw.cmd
  6. 393 0
      pom.xml
  7. 131 0
      src/main/java/com/example/mos/MosApplication.java
  8. 47 0
      src/main/java/com/example/mos/business/exception/BusinessException.java
  9. 64 0
      src/main/java/com/example/mos/business/exception/ExceptionEnum.java
  10. 8 0
      src/main/java/com/example/mos/common/core/Convert.java
  11. 19 0
      src/main/java/com/example/mos/common/core/MybatisPlusConfig.java
  12. 22 0
      src/main/java/com/example/mos/common/core/base/RedisConf.java
  13. 29 0
      src/main/java/com/example/mos/common/model/BaseEntity.java
  14. 28 0
      src/main/java/com/example/mos/common/model/BaseVO.java
  15. 42 0
      src/main/java/com/example/mos/common/model/dto/ArticleInfoDTO.java
  16. 12 0
      src/main/java/com/example/mos/common/model/dto/CommonData.java
  17. 25 0
      src/main/java/com/example/mos/common/model/dto/FollowDTO.java
  18. 20 0
      src/main/java/com/example/mos/common/model/dto/WeChatAccountInfoDTO.java
  19. 26 0
      src/main/java/com/example/mos/common/model/dto/Web1DTO.java
  20. 24 0
      src/main/java/com/example/mos/common/model/dto/Web2DTO.java
  21. 16 0
      src/main/java/com/example/mos/common/model/dto/Web4DTO.java
  22. 52 0
      src/main/java/com/example/mos/common/model/vo/ArticleDataVO.java
  23. 16 0
      src/main/java/com/example/mos/common/model/vo/ArticleInfoVO.java
  24. 17 0
      src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/AccountInfo.java
  25. 26 0
      src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/AccountNameVO.java
  26. 16 0
      src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/ArticleVO.java
  27. 13 0
      src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/BaseResp.java
  28. 17 0
      src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/OfficalAccountVO.java
  29. 8 0
      src/main/java/com/example/mos/common/model/vo/PersonnelVO.java
  30. 19 0
      src/main/java/com/example/mos/common/model/vo/ReturnVO.java
  31. 20 0
      src/main/java/com/example/mos/common/model/vo/Web1VO/Web1InfoVO.java
  32. 17 0
      src/main/java/com/example/mos/common/model/vo/Web1VO/Web1VO.java
  33. 61 0
      src/main/java/com/example/mos/common/utils/DBUtil.java
  34. 19 0
      src/main/java/com/example/mos/common/utils/DateDeserializer.java
  35. 36 0
      src/main/java/com/example/mos/container/GetAccountController.java
  36. 13 0
      src/main/java/com/example/mos/container/GetAccountModel.java
  37. 89 0
      src/main/java/com/example/mos/container/GetAccountUI.java
  38. 61 0
      src/main/java/com/example/mos/container/JCheckBox/CheckHeaderCellRenderer.java
  39. 38 0
      src/main/java/com/example/mos/container/JCheckBox/CheckTableModle.java
  40. 563 0
      src/main/java/com/example/mos/container/MainView.java
  41. 60 0
      src/main/java/com/example/mos/container/SearchController.java
  42. 14 0
      src/main/java/com/example/mos/container/SearchModel.java
  43. 104 0
      src/main/java/com/example/mos/container/SearchUI.java
  44. 74 0
      src/main/java/com/example/mos/container/ShowArticlesController.java
  45. 11 0
      src/main/java/com/example/mos/container/ShowArticlesModel.java
  46. 118 0
      src/main/java/com/example/mos/container/ShowArticlesUI.java
  47. 38 0
      src/main/java/com/example/mos/controller/FollowController.java
  48. 40 0
      src/main/java/com/example/mos/controller/TaskController.java
  49. 184 0
      src/main/java/com/example/mos/controller/WeChatAccountController.java
  50. 65 0
      src/main/java/com/example/mos/domain/ArticleInfo.java
  51. 26 0
      src/main/java/com/example/mos/domain/Follow.java
  52. 35 0
      src/main/java/com/example/mos/domain/QuartzTask.java
  53. 23 0
      src/main/java/com/example/mos/domain/WeChatAccountInfo.java
  54. 19 0
      src/main/java/com/example/mos/domain/WebInfo.java
  55. 41 0
      src/main/java/com/example/mos/domain/quartz/QrtzTaskDTO.java
  56. 14 0
      src/main/java/com/example/mos/domain/quartz/QuartzVO.java
  57. 60 0
      src/main/java/com/example/mos/handler/FollowAccountHandler.java
  58. 23 0
      src/main/java/com/example/mos/handler/GetAllSourceHandler.java
  59. 23 0
      src/main/java/com/example/mos/handler/GetArticlesHandler.java
  60. 153 0
      src/main/java/com/example/mos/handler/MyButtonEditor.java
  61. 39 0
      src/main/java/com/example/mos/handler/MyButtonRender.java
  62. 11 0
      src/main/java/com/example/mos/handler/MyEvent.java
  63. 23 0
      src/main/java/com/example/mos/handler/OpenSearchPanelHandler.java
  64. 37 0
      src/main/java/com/example/mos/handler/SaveFileData.java
  65. 124 0
      src/main/java/com/example/mos/handler/SearchWeChatAccountHandler.java
  66. 108 0
      src/main/java/com/example/mos/handler/WeChatLoginHandler.java
  67. 16 0
      src/main/java/com/example/mos/mapper/ArticleInfoMapper.java
  68. 14 0
      src/main/java/com/example/mos/mapper/FollowMapper.java
  69. 18 0
      src/main/java/com/example/mos/mapper/QuartzTaskMapper.java
  70. 13 0
      src/main/java/com/example/mos/mapper/WeChatAccountInfoMapper.java
  71. 13 0
      src/main/java/com/example/mos/mapper/WebInfoMapper.java
  72. 136 0
      src/main/java/com/example/mos/service/ArticleInfoService.java
  73. 111 0
      src/main/java/com/example/mos/service/ExportArticleService.java
  74. 159 0
      src/main/java/com/example/mos/service/ExportToWordService.java
  75. 65 0
      src/main/java/com/example/mos/service/FollowService.java
  76. 100 0
      src/main/java/com/example/mos/service/GetWebArticle/Cnipr/GetPPHArticleService.java
  77. 106 0
      src/main/java/com/example/mos/service/GetWebArticle/GetBeiJingArticleService.java
  78. 113 0
      src/main/java/com/example/mos/service/GetWebArticle/GetChongQingArticleService.java
  79. 118 0
      src/main/java/com/example/mos/service/GetWebArticle/GetGuangDongArticleService.java
  80. 118 0
      src/main/java/com/example/mos/service/GetWebArticle/GetGuangXiArticleService.java
  81. 127 0
      src/main/java/com/example/mos/service/GetWebArticle/GetHaiNanArticleService.java
  82. 121 0
      src/main/java/com/example/mos/service/GetWebArticle/GetHeNanArticleService.java
  83. 123 0
      src/main/java/com/example/mos/service/GetWebArticle/GetHuNanArticleService.java
  84. 120 0
      src/main/java/com/example/mos/service/GetWebArticle/GetJiangSuArticleService.java
  85. 110 0
      src/main/java/com/example/mos/service/GetWebArticle/GetLiaoNingArticleService.java
  86. 114 0
      src/main/java/com/example/mos/service/GetWebArticle/GetQingHaiArticleService.java
  87. 163 0
      src/main/java/com/example/mos/service/GetWebArticle/GetShanXi1ArticleService.java
  88. 158 0
      src/main/java/com/example/mos/service/GetWebArticle/GetShanXi2ArticleService.java
  89. 110 0
      src/main/java/com/example/mos/service/GetWebArticle/GetShangHaiArticleService.java
  90. 113 0
      src/main/java/com/example/mos/service/GetWebArticle/GetTianJinArticleService.java
  91. 141 0
      src/main/java/com/example/mos/service/GetWebArticle/GetWeb1ArticleService.java
  92. 213 0
      src/main/java/com/example/mos/service/GetWebArticle/GetWeb2ArticleService.java
  93. 129 0
      src/main/java/com/example/mos/service/GetWebArticle/GetWeb3ArticleService.java
  94. 128 0
      src/main/java/com/example/mos/service/GetWebArticle/GetWeb4ArticleService.java
  95. 129 0
      src/main/java/com/example/mos/service/GetWebArticle/GetWeb5ArticleService.java
  96. 122 0
      src/main/java/com/example/mos/service/GetWebArticle/GetWeb6ArticleService.java
  97. 170 0
      src/main/java/com/example/mos/service/GetWebArticle/GetXinJiangArticleService.java
  98. 120 0
      src/main/java/com/example/mos/service/GetWebArticle/GetYunNanArticleService.java
  99. 224 0
      src/main/java/com/example/mos/service/QuartzTask/AutoGetArticleService.java
  100. 0 0
      src/main/java/com/example/mos/service/QuartzTask/AutoGetWeChatArticleService.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/

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

@@ -0,0 +1,18 @@
+# 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.
+wrapperVersion=3.3.1
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip

二进制
Articles.docx


+ 250 - 0
mvnw

@@ -0,0 +1,250 @@
+#!/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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Apache Maven Wrapper startup batch script, version 3.3.1
+#
+# Optional ENV vars
+# -----------------
+#   JAVA_HOME - location of a JDK home dir, required when download maven via java source
+#   MVNW_REPOURL - repo url base for downloading maven distribution
+#   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
+#   MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
+# ----------------------------------------------------------------------------
+
+set -euf
+[ "${MVNW_VERBOSE-}" != debug ] || set -x
+
+# OS specific support.
+native_path() { printf %s\\n "$1"; }
+case "$(uname)" in
+CYGWIN* | MINGW*)
+  [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
+  native_path() { cygpath --path --windows "$1"; }
+  ;;
+esac
+
+# set JAVACMD and JAVACCMD
+set_java_home() {
+  # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
+  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"
+      JAVACCMD="$JAVA_HOME/jre/sh/javac"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+      JAVACCMD="$JAVA_HOME/bin/javac"
+
+      if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
+        echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
+        echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
+        return 1
+      fi
+    fi
+  else
+    JAVACMD="$(
+      'set' +e
+      'unset' -f command 2>/dev/null
+      'command' -v java
+    )" || :
+    JAVACCMD="$(
+      'set' +e
+      'unset' -f command 2>/dev/null
+      'command' -v javac
+    )" || :
+
+    if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
+      echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
+      return 1
+    fi
+  fi
+}
+
+# hash string like Java String::hashCode
+hash_string() {
+  str="${1:-}" h=0
+  while [ -n "$str" ]; do
+    char="${str%"${str#?}"}"
+    h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
+    str="${str#?}"
+  done
+  printf %x\\n $h
+}
+
+verbose() { :; }
+[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
+
+die() {
+  printf %s\\n "$1" >&2
+  exit 1
+}
+
+# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
+while IFS="=" read -r key value; do
+  case "${key-}" in
+  distributionUrl) distributionUrl="${value-}" ;;
+  distributionSha256Sum) distributionSha256Sum="${value-}" ;;
+  esac
+done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
+[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
+
+case "${distributionUrl##*/}" in
+maven-mvnd-*bin.*)
+  MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
+  case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
+  *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
+  :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
+  :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
+  :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
+  *)
+    echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
+    distributionPlatform=linux-amd64
+    ;;
+  esac
+  distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
+  ;;
+maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
+*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
+esac
+
+# apply MVNW_REPOURL and calculate MAVEN_HOME
+# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
+[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
+distributionUrlName="${distributionUrl##*/}"
+distributionUrlNameMain="${distributionUrlName%.*}"
+distributionUrlNameMain="${distributionUrlNameMain%-bin}"
+MAVEN_HOME="$HOME/.m2/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
+
+exec_maven() {
+  unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
+  exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
+}
+
+if [ -d "$MAVEN_HOME" ]; then
+  verbose "found existing MAVEN_HOME at $MAVEN_HOME"
+  exec_maven "$@"
+fi
+
+case "${distributionUrl-}" in
+*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
+*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
+esac
+
+# prepare tmp dir
+if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
+  clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
+  trap clean HUP INT TERM EXIT
+else
+  die "cannot create temp dir"
+fi
+
+mkdir -p -- "${MAVEN_HOME%/*}"
+
+# Download and Install Apache Maven
+verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
+verbose "Downloading from: $distributionUrl"
+verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
+
+# select .zip or .tar.gz
+if ! command -v unzip >/dev/null; then
+  distributionUrl="${distributionUrl%.zip}.tar.gz"
+  distributionUrlName="${distributionUrl##*/}"
+fi
+
+# verbose opt
+__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
+[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
+
+# normalize http auth
+case "${MVNW_PASSWORD:+has-password}" in
+'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
+has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
+esac
+
+if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
+  verbose "Found wget ... using wget"
+  wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
+elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
+  verbose "Found curl ... using curl"
+  curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
+elif set_java_home; then
+  verbose "Falling back to use Java to download"
+  javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
+  targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
+  cat >"$javaSource" <<-END
+	public class Downloader extends java.net.Authenticator
+	{
+	  protected java.net.PasswordAuthentication getPasswordAuthentication()
+	  {
+	    return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
+	  }
+	  public static void main( String[] args ) throws Exception
+	  {
+	    setDefault( new Downloader() );
+	    java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
+	  }
+	}
+	END
+  # For Cygwin/MinGW, switch paths to Windows format before running javac and java
+  verbose " - Compiling Downloader.java ..."
+  "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
+  verbose " - Running Downloader.java ..."
+  "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
+fi
+
+# If specified, validate the SHA-256 sum of the Maven distribution zip file
+if [ -n "${distributionSha256Sum-}" ]; then
+  distributionSha256Result=false
+  if [ "$MVN_CMD" = mvnd.sh ]; then
+    echo "Checksum validation is not supported for maven-mvnd." >&2
+    echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
+    exit 1
+  elif command -v sha256sum >/dev/null; then
+    if echo "$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
+      distributionSha256Result=true
+    fi
+  elif command -v shasum >/dev/null; then
+    if echo "$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
+      distributionSha256Result=true
+    fi
+  else
+    echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
+    echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
+    exit 1
+  fi
+  if [ $distributionSha256Result = false ]; then
+    echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
+    echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
+    exit 1
+  fi
+fi
+
+# unzip and move
+if command -v unzip >/dev/null; then
+  unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
+else
+  tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
+fi
+printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
+mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
+
+clean || :
+exec_maven "$@"

+ 146 - 0
mvnw.cmd

@@ -0,0 +1,146 @@
+<# : batch portion
+@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 Apache Maven Wrapper startup batch script, version 3.3.1
+@REM
+@REM Optional ENV vars
+@REM   MVNW_REPOURL - repo url base for downloading maven distribution
+@REM   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
+@REM   MVNW_VERBOSE - true: enable verbose log; others: silence the output
+@REM ----------------------------------------------------------------------------
+
+@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
+@SET __MVNW_CMD__=
+@SET __MVNW_ERROR__=
+@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
+@SET PSModulePath=
+@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
+  IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
+)
+@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
+@SET __MVNW_PSMODULEP_SAVE=
+@SET __MVNW_ARG0_NAME__=
+@SET MVNW_USERNAME=
+@SET MVNW_PASSWORD=
+@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
+@echo Cannot start maven from wrapper >&2 && exit /b 1
+@GOTO :EOF
+: end batch / begin powershell #>
+
+$ErrorActionPreference = "Stop"
+if ($env:MVNW_VERBOSE -eq "true") {
+  $VerbosePreference = "Continue"
+}
+
+# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
+$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
+if (!$distributionUrl) {
+  Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
+}
+
+switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
+  "maven-mvnd-*" {
+    $USE_MVND = $true
+    $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
+    $MVN_CMD = "mvnd.cmd"
+    break
+  }
+  default {
+    $USE_MVND = $false
+    $MVN_CMD = $script -replace '^mvnw','mvn'
+    break
+  }
+}
+
+# apply MVNW_REPOURL and calculate MAVEN_HOME
+# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
+if ($env:MVNW_REPOURL) {
+  $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
+  $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
+}
+$distributionUrlName = $distributionUrl -replace '^.*/',''
+$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
+$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
+$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
+$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
+
+if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
+  Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
+  Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
+  exit $?
+}
+
+if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
+  Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
+}
+
+# prepare tmp dir
+$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
+$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
+$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
+trap {
+  if ($TMP_DOWNLOAD_DIR.Exists) {
+    try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
+    catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
+  }
+}
+
+New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
+
+# Download and Install Apache Maven
+Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
+Write-Verbose "Downloading from: $distributionUrl"
+Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
+
+$webclient = New-Object System.Net.WebClient
+if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
+  $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
+}
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
+
+# If specified, validate the SHA-256 sum of the Maven distribution zip file
+$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
+if ($distributionSha256Sum) {
+  if ($USE_MVND) {
+    Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
+  }
+  Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
+  if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
+    Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
+  }
+}
+
+# unzip and move
+Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
+Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
+try {
+  Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
+} catch {
+  if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
+    Write-Error "fail to move MAVEN_HOME"
+  }
+} finally {
+  try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
+  catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
+}
+
+Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

+ 393 - 0
pom.xml

@@ -0,0 +1,393 @@
+<?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>3.1.3</version>
+    </parent>
+
+    <groupId>cn.cslg</groupId>
+    <artifactId>MOS</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>MOS</name>
+    <description>常熟理工学院 专利分析系统</description>
+
+    <properties>
+        <java.version>8</java.version>
+        <jwt.version>0.9.0</jwt.version>
+        <commons.io.version>2.5</commons.io.version>
+        <mybatisplus.version>3.5.3.1</mybatisplus.version>
+        <google.code.gson.version>2.7</google.code.gson.version>
+        <hutool.version>5.6.5</hutool.version>
+        <okhttps.version>4.10.0</okhttps.version>
+        <poi.version>4.1.2</poi.version>
+        <poi-tl.version>1.10.3</poi-tl.version>
+        <druid.version>1.1.20</druid.version>
+        <fastjson.version>2.0.12</fastjson.version>
+        <sa-token.version>1.29.0</sa-token.version>
+        <springdoc.version>1.6.6</springdoc.version>
+        <elasticsearch.version>8.6.1</elasticsearch.version>
+    </properties>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-ui</artifactId>
+            <version>${springdoc.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.deepoove</groupId>
+            <artifactId>poi-tl</artifactId>
+            <version>${poi-tl.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-spring-boot-starter</artifactId>
+            <version>${sa-token.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-dao-redis-jackson</artifactId>
+            <version>${sa-token.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.15</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-compress</artifactId>
+            <version>1.21</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.6</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>${jwt.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.ejlchina</groupId>
+            <artifactId>okhttps</artifactId>
+            <version>3.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.14.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <!--            <version>${google.code.gson.version}</version>-->
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis</groupId>
+            <artifactId>mybatis-typehandlers-jsr310</artifactId>
+            <version>1.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatisplus.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <version>3.1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.6</version>
+        </dependency>
+        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <!--        <dependency>-->
+        <!--            <groupId>org.openjdk.nashorn</groupId>-->
+        <!--            <artifactId>nashorn-core</artifactId>-->
+        <!--            <version>15.3</version>-->
+        <!--        </dependency>-->
+        <!--      jdk17后需要此依赖-->
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-scratchpad</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.3.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>1.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>0.9.5.2</version>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.9.9</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr4-runtime</artifactId>
+            <version>4.12.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.pdfbox</groupId>
+            <artifactId>pdfbox</artifactId>
+            <version>2.0.16</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>jaxen</groupId>
+            <artifactId>jaxen</artifactId>
+            <version>1.2.0</version> <!-- 使用你需要的版本 -->
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <!--  poi-->
+        <dependency>
+            <groupId>io.github.draco1023</groupId>
+            <artifactId>poi-tl-ext</artifactId>
+            <version>0.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.9.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.5.3.1</version>
+        </dependency>
+        <!-- velocity -->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+            <version>2.0</version>
+        </dependency>
+
+        <!-- 短信接口 -->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>4.5.16</version>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+        <dependency>
+
+            <groupId>com.github.wechatpay-apiv3</groupId>
+
+            <artifactId>wechatpay-java</artifactId>
+
+            <version>0.2.6</version>
+
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+            <version>1.65</version>
+        </dependency>
+
+        <!-- Feb, 2011 -->
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpg-jdk16</artifactId>
+            <version>1.46</version>
+        </dependency>
+        <!-- Oct, 2019 -->
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-jdk15on</artifactId>
+            <version>1.65</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sourceforge.htmlunit</groupId>
+            <artifactId>htmlunit</artifactId>
+            <version>2.55.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jsoup</groupId>
+            <artifactId>jsoup</artifactId>
+            <version>1.8.3</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>MOS</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                    <!-- 指定该Main Class为全局的唯一入口 -->
+                    <mainClass>com.example.mos.MosApplication</mainClass>
+                    <layout>ZIP</layout>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>17</source>
+                    <target>17</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!--阿里云镜像源(因需要提交到GithubActions,会引起依赖下载过慢的问题)-->
+    <repositories>
+        <repository>
+            <id>nexus-aliyun</id>
+            <name>nexus-aliyun</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>com.e-iceblue</id>
+            <name>e-iceblue</name>
+            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
+        </repository>
+    </repositories>
+</project>

+ 131 - 0
src/main/java/com/example/mos/MosApplication.java

@@ -0,0 +1,131 @@
+package com.example.mos;
+
+import com.example.mos.container.MainView;
+import com.example.mos.service.QuartzTask.QuartzTaskService;
+import com.example.mos.weChatLogin.api.WeiXinApi;
+import com.example.mos.weChatLogin.awt.MyImageShowFrame;
+import com.example.mos.weChatLogin.model.WxResultBody;
+import com.example.mos.weChatLogin.okhttp.MyCookieStore;
+import com.example.mos.weChatLogin.utils.HttpUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+import java.util.Scanner;
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+
+@SpringBootApplication
+@EnableScheduling
+public class MosApplication {
+    //    private static MyImageShowFrame myImageShowFrame;
+    public static void main(String[] args) throws IOException {
+
+//        //图片显示控件
+//        myImageShowFrame = new MyImageShowFrame();
+//
+//        // 1. POST请求开始登录接口,初始化cookie
+//        String sessionid = "" + System.currentTimeMillis() + (int)(Math.random()*100);//生成一个包含当前时间戳以及随机数的字符串
+//        WxResultBody wxResultBody = WeiXinApi.startLogin(sessionid);
+//        System.out.println("---请求开始登录接口 返回结果:" + wxResultBody.toString());
+//        // 2. 请求获取二维码图片接口,得到流
+//        InputStream qrCodeIs = WeiXinApi.getQRCode();
+//        //转成图片显示
+//        myImageShowFrame.setTitle("请使用微信扫码登录");
+//        myImageShowFrame.showImage(qrCodeIs);
+//        myImageShowFrame.setLocation(500,100);
+//        // 3.轮询二维码状态接口
+//        FutureTask<Integer> futureTask = new FutureTask<>(new Callable<Integer>() {
+//            @Override
+//            public Integer call() throws Exception {
+//                while (true) {
+//                    WxResultBody askQRCode = WeiXinApi.askQRCode();
+//                    Integer status = askQRCode.getStatus();
+//                    if (status == 3) {
+//                        System.out.println("二维码已过期");
+//                        return 3;
+//                    } else if (status == 4) {
+//                        System.out.println("已扫码,等待确认");
+//                    } else if (status == 1) {
+//                        System.out.println("已确认登录,请稍后...");
+//                        return 1;
+//                    }
+//                    try {
+//                        Thread.sleep(1000);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                }
+//            }
+//        });
+//
+//        while (true) {
+//            Thread queryThread = new Thread(futureTask);
+//            queryThread.start();
+//            if (!futureTask.isDone()) {
+//                System.out.println("--正在查询扫码状态,请尽快扫码!");
+//            }
+//
+//            try {
+//                Integer integer = futureTask.get();
+//                if (integer == 1) {
+//                    //说明扫码确认成功,否则重新获取图片
+//                    //关闭图片显示
+//                    myImageShowFrame.close();
+//                    break;
+//                } else {
+//                    //重新获取二维码图片显示
+//                    myImageShowFrame.showImage(WeiXinApi.getQRCode());
+//                }
+//            } catch (Exception e) {
+//                System.out.println("查询接口出错了");
+//                break;
+//            }
+//        }
+//
+//        // 4.确认登录后,请求登录接口,拿到登录状态的cookie
+//        WxResultBody bizlogin = WeiXinApi.bizlogin();
+//        //重定向地址
+//        String redirect_url = bizlogin.getRedirect_url();
+//        //解析成键值对
+//        Map<String, String> loginRes = HttpUtils.parseQueryParams(redirect_url);
+//        //得到token
+//        String token = loginRes.get("token");
+//        //设置全局token值
+//        MyCookieStore.setToken(token);
+//
+//        System.out.println("---恭喜你,登录成功!");
+
+//        SpringApplication.run(MosApplication.class, args);
+//        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "后台程序已启动,请运行前台");
+//        GraphicsEnvironment.isHeadless();
+//        System.out.println(GraphicsEnvironment.isHeadless());
+//        SwingUtilities.invokeLater(() -> {
+//                new MainView();
+//        });
+
+
+        // 设置虚拟机参数允许图形界面操作
+        System.setProperty("java.awt.headless", "false");
+        // 检查系统是否支持 Headless 模式
+        if (GraphicsEnvironment.isHeadless()) {
+            System.out.println("Headless mode detected, GUI components may not work.");
+        } else {
+            SpringApplication.run(MosApplication.class, args);
+            System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "后台程序已启动,请运行前台");
+            // 在非 Headless 模式下运行 Swing GUI
+            SwingUtilities.invokeLater(() -> {
+                new MainView();
+            });
+        }
+    }
+
+}

+ 47 - 0
src/main/java/com/example/mos/business/exception/BusinessException.java

@@ -0,0 +1,47 @@
+package com.example.mos.business.exception;
+
+
+import lombok.Getter;
+
+/**
+ * @ClassName
+ * @Description 业务异常
+ * @Version TODO
+ **/
+@Getter
+public class BusinessException extends RuntimeException {
+
+	private String errorCode;// 异常代码
+	private String errorMessage;// 异常信息
+
+	public BusinessException(String errorCode, String errorMessage) {
+		super(errorMessage);
+		this.errorCode = errorCode;
+		this.errorMessage = errorMessage;
+	}
+
+	public BusinessException(ExceptionEnum e) {
+		super(e.getMessage());
+		this.errorMessage = e.getMessage();
+		this.errorCode = e.getCode();
+	}
+
+
+	public String getErrorCode() {
+		return errorCode;
+	}
+
+	public void setErrorCode(String errorCode) {
+		this.errorCode = errorCode;
+	}
+
+	public String getErrorMessage() {
+		return errorMessage;
+	}
+
+	public void setErrorMessage(String errorMessage) {
+		this.errorMessage = errorMessage;
+	}
+
+
+}

+ 64 - 0
src/main/java/com/example/mos/business/exception/ExceptionEnum.java

@@ -0,0 +1,64 @@
+package com.example.mos.business.exception;
+
+import lombok.Getter;
+
+@Getter
+public enum ExceptionEnum {
+
+    /*APP端 100000-300000*/
+    SUCCESS("000000", "调用成功"),
+    PARAMETER_VERIFICATION_ERROR("000001", "数据参数校验异常"),
+    PHONE_FORMAT_ERROR("000002","手机号格式错误"),
+
+    VERIFY_CODE("10001", "校验码失效"),
+    CODE_WRONG("10002","验证码错误"),
+    INIT_GENERICITY_BEAN_ERROR("10003","泛型实例化异常"),
+    THE_PHONE_CANNOT_BE_EXIST("10004","手机号已存在"),
+    THE_LOG_OUT("10004","未登录"),
+    THE_CODE_IS_NOT_NULL("10006","验证码不能为空"),
+
+    //异常20000
+    THE_PARAMETER_EXCEPTION("20001", "参数异常,请传入数据"),
+    THE_GET_INFORMATION_TOKEN_INVALID("20002", "获取用户信息token失效"),
+    THE_FAIL_TO_DELETE("20003", "删除失败"),
+
+    //业务异常
+    THE_PRODUCT_CATEGORY_NAME_IS_EXIST("607", "产品类别名称已存在"),
+    THE_LOG_INVALID_NEED_LOGIN_AGAIN("606","登录失效,请重新登录"),
+
+
+
+
+
+
+
+
+
+
+
+    SYSTEM_ERROR("999999", "系统异常");
+
+    private String code;// 异常代码
+    private String message;// 异常信息
+
+    ExceptionEnum(String code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+}

+ 8 - 0
src/main/java/com/example/mos/common/core/Convert.java

@@ -0,0 +1,8 @@
+package com.example.mos.common.core;
+
+/**
+ * @Author xiexiang
+ * @Date 2023/6/1
+ */
+public class Convert {
+}

+ 19 - 0
src/main/java/com/example/mos/common/core/MybatisPlusConfig.java

@@ -0,0 +1,19 @@
+package com.example.mos.common.core;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@MapperScan("com.example.mos.mapper")
+public class MybatisPlusConfig {
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor() {
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+        return interceptor;
+    }
+}

+ 22 - 0
src/main/java/com/example/mos/common/core/base/RedisConf.java

@@ -0,0 +1,22 @@
+package com.example.mos.common.core.base;
+
+/**
+ * Redis常量类
+ *
+ * @Author xiexiang
+ * @Date 2023/6/1
+ */
+public class RedisConf {
+
+    public static final String SYMBOL_COLON = ":";
+    public static final String SYMBOL_LINE = "-";
+    public final static String COMMON_DATA = "common-data";
+    public final static String LOGIN_USER = "login-user";
+    public final static String VERIFY_CODE = "verify-code";
+    public final static String SELECT_PATENT = "select-patent";
+    public final static String ANALYSIS_COUNT = "analysis-count";
+    public final static String AREA_LIST = "area-list";
+    public final static String USER_FIELD = "user-field";
+    public final static String FIELD_ORDER = "field-order";
+    public final static String USER_IMPORT = "user-import";
+}

+ 29 - 0
src/main/java/com/example/mos/common/model/BaseEntity.java

@@ -0,0 +1,29 @@
+package com.example.mos.common.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * Entity基类
+ *
+ * @Author xiexiang
+ * @Date 2023/6/12
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = true)
+public class BaseEntity<T extends Model> extends Model {
+    private static final long serialVersionUID = -4851055162892178225L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "ID", type = IdType.AUTO)
+    private Integer id;
+
+
+}

+ 28 - 0
src/main/java/com/example/mos/common/model/BaseVO.java

@@ -0,0 +1,28 @@
+package com.example.mos.common.model;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @Author xiexiang
+ * @Date 2023/5/31
+ */
+@Data
+@Accessors(chain = true)
+public class BaseVO {
+    /**
+     * 每页条数
+     */
+    private Integer size;
+
+    /**
+     * 当前页数
+     */
+    private Integer current;
+
+    /**
+     * 数据总数
+     */
+    private Integer total;
+
+}

+ 42 - 0
src/main/java/com/example/mos/common/model/dto/ArticleInfoDTO.java

@@ -0,0 +1,42 @@
+package com.example.mos.common.model.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Data
+public class ArticleInfoDTO {
+    /**
+     * 来源
+     */
+    private Integer source;
+
+    /**
+     * 全文link
+     */
+    private String link;
+
+    /**
+     * 发布时间
+     */
+    private Date time;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * id
+     */
+    private String fakeId;
+
+    private String abs;
+}

+ 12 - 0
src/main/java/com/example/mos/common/model/dto/CommonData.java

@@ -0,0 +1,12 @@
+package com.example.mos.common.model.dto;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2023/6/1
+ */
+@Data
+public class CommonData {
+
+}

+ 25 - 0
src/main/java/com/example/mos/common/model/dto/FollowDTO.java

@@ -0,0 +1,25 @@
+package com.example.mos.common.model.dto;
+
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/3
+ */
+@Data
+public class FollowDTO {
+    /**
+     * 关注类型(0微信公众号 1网页)
+     */
+    private Integer followType;
+
+    /**
+     * 公众号fakeid/网页id
+     */
+    private String followId;
+
+    private String pictureUrl;
+
+    private String name;
+}

+ 20 - 0
src/main/java/com/example/mos/common/model/dto/WeChatAccountInfoDTO.java

@@ -0,0 +1,20 @@
+package com.example.mos.common.model.dto;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/25
+ */
+@Data
+public class WeChatAccountInfoDTO {
+    private Integer id;
+
+    private String accountName;
+
+    private String pictureUrl;
+
+    private String fakeId;
+
+    private Boolean ifCancel;
+}

+ 26 - 0
src/main/java/com/example/mos/common/model/dto/Web1DTO.java

@@ -0,0 +1,26 @@
+package com.example.mos.common.model.dto;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/12
+ */
+@Data
+public class Web1DTO {
+    /**
+     *
+     * 司法解释 sfjs
+     */
+    private String type;
+    private String searchType;
+    private String sortTr;
+    private String gbrqStart;
+    private String gbrqEnd;
+    private String sxrqStart;
+    private String sxrqEnd;
+    private boolean sort;
+    private int page;
+    private int size;
+    private String timestamp;
+}

+ 24 - 0
src/main/java/com/example/mos/common/model/dto/Web2DTO.java

@@ -0,0 +1,24 @@
+package com.example.mos.common.model.dto;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/17
+ */
+@Data
+public class Web2DTO {
+    /**
+     * 法制动态新闻搜索关键词
+     */
+    private String newskeyword;
+
+    private String s;
+
+    /**
+     * 全文 qw
+     * 标题 bt
+     */
+    private String btqw;
+
+}

+ 16 - 0
src/main/java/com/example/mos/common/model/dto/Web4DTO.java

@@ -0,0 +1,16 @@
+package com.example.mos.common.model.dto;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/13
+ */
+@Data
+public class Web4DTO {
+    private String type;
+    private String sobj;
+    private String keywords;
+    private Integer page;
+}
+

+ 52 - 0
src/main/java/com/example/mos/common/model/vo/ArticleDataVO.java

@@ -0,0 +1,52 @@
+package com.example.mos.common.model.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Data
+public class ArticleDataVO {
+    private Integer id;
+    /**
+     * 来源名称
+     */
+    private String cameFrom;
+
+    /**
+     * 全文link
+     */
+    private String link;
+
+    /**
+     * 发布时间
+     */
+    private Date time;
+
+    /**
+     * 更新时间
+     */
+    private Date createTime;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    private Integer source;
+
+    /**
+     * 摘要
+     */
+    private String abs;
+
+    private Integer classify;
+
+    private String classifyName;
+}

+ 16 - 0
src/main/java/com/example/mos/common/model/vo/ArticleInfoVO.java

@@ -0,0 +1,16 @@
+package com.example.mos.common.model.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Data
+public class ArticleInfoVO {
+    private String title;
+    private String link;
+    private Date time;
+}

+ 17 - 0
src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/AccountInfo.java

@@ -0,0 +1,17 @@
+package com.example.mos.common.model.vo.OfficalAccountReVO;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/5/30
+ */
+@Data
+public class AccountInfo {
+    private String fakeid;
+    private String nickname;
+    private String alias;
+    private String round_head_img;
+    private Integer service_type;
+    private String signature;
+}

+ 26 - 0
src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/AccountNameVO.java

@@ -0,0 +1,26 @@
+package com.example.mos.common.model.vo.OfficalAccountReVO;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/5/30
+ */
+@Data
+public class AccountNameVO {
+
+    /**
+     * 微信公众号名称
+     */
+    private String accountName;
+
+    /**
+     * 微信公众号唯一id
+     */
+    private String fakeId;
+
+    /**
+     * 微信公众号头像url
+     */
+    private String pictureUrl;
+}

+ 16 - 0
src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/ArticleVO.java

@@ -0,0 +1,16 @@
+package com.example.mos.common.model.vo.OfficalAccountReVO;
+
+import com.example.mos.common.model.vo.ArticleInfoVO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Data
+public class ArticleVO {
+    private String fakeid;
+    private List<ArticleInfoVO> data;
+}

+ 13 - 0
src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/BaseResp.java

@@ -0,0 +1,13 @@
+package com.example.mos.common.model.vo.OfficalAccountReVO;
+
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/5/30
+ */
+@Data
+public class BaseResp {
+    private Integer ret;
+    private String err_msg;
+}

+ 17 - 0
src/main/java/com/example/mos/common/model/vo/OfficalAccountReVO/OfficalAccountVO.java

@@ -0,0 +1,17 @@
+package com.example.mos.common.model.vo.OfficalAccountReVO;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 查询微信公众号名称返回Json
+ * @Author xiexiang
+ * @Date 2024/5/30
+ */
+@Data
+public class OfficalAccountVO {
+    private BaseResp base_resp;
+    private List<AccountInfo> list;
+    private Integer total;
+}

+ 8 - 0
src/main/java/com/example/mos/common/model/vo/PersonnelVO.java

@@ -0,0 +1,8 @@
+package com.example.mos.common.model.vo;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/5/31
+ */
+public class PersonnelVO {
+}

+ 19 - 0
src/main/java/com/example/mos/common/model/vo/ReturnVO.java

@@ -0,0 +1,19 @@
+package com.example.mos.common.model.vo;
+
+import com.example.mos.common.model.vo.Web1VO.Web1VO;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Data
+public class ReturnVO {
+    private String code;
+    private String message;
+    private Web1VO result;
+    private Boolean success;
+    private Date timestamp;
+}

+ 20 - 0
src/main/java/com/example/mos/common/model/vo/Web1VO/Web1InfoVO.java

@@ -0,0 +1,20 @@
+package com.example.mos.common.model.vo.Web1VO;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/12
+ */
+@Data
+public class Web1InfoVO {
+    private Date expiry;
+    private String id;
+    private String office;
+    private String publish;
+    private String status;
+    private String title;
+    private String url;
+}

+ 17 - 0
src/main/java/com/example/mos/common/model/vo/Web1VO/Web1VO.java

@@ -0,0 +1,17 @@
+package com.example.mos.common.model.vo.Web1VO;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/12
+ */
+@Data
+public class Web1VO {
+    private Integer page;
+    private Integer size;
+    private Integer totalSizes;
+    private List<Web1InfoVO> data;
+}

+ 61 - 0
src/main/java/com/example/mos/common/utils/DBUtil.java

@@ -0,0 +1,61 @@
+package com.example.mos.common.utils;
+
+import java.sql.*;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/27
+ */
+public class DBUtil {
+    private static final String URL = "jdbc:mysql://192.168.2.24:3306/mos?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8";
+    private static final String DRIVER = "com.mysql.cj.jdbc.Driver";
+    private static final String USER_NAME = "root";
+    private static final String PWD = "rrzTwWAYX8Gxh5JH";
+
+    static {
+        try {
+            Class.forName(DRIVER);
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static Connection getConn() {
+        try {
+            return DriverManager.getConnection(URL, USER_NAME, PWD);
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static void closeConn(Connection connection){
+        if (connection != null) {
+            try {
+                connection.close();
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public static void closePs(PreparedStatement ps) {
+        if (ps != null) {
+            try {
+                ps.close();
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public static void closeRs (ResultSet rs) {
+        if (rs != null) {
+            try {
+                rs.close();
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

+ 19 - 0
src/main/java/com/example/mos/common/utils/DateDeserializer.java

@@ -0,0 +1,19 @@
+package com.example.mos.common.utils;
+
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import java.lang.reflect.Type;
+import java.util.Date;
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+public class DateDeserializer implements JsonDeserializer<Date> {
+    @Override
+    public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
+        long unixTime = json.getAsLong();
+        return new Date(unixTime * 1000);
+    }
+}

+ 36 - 0
src/main/java/com/example/mos/container/GetAccountController.java

@@ -0,0 +1,36 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.WeChatAccountInfoService;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/25
+ */
+public class GetAccountController {
+    private GetAccountModel accountModel;
+    private GetAccountUI accountUI;
+    private WeChatAccountInfoService weChatAccountInfoService;
+
+    public GetAccountController(GetAccountModel model, GetAccountUI ui){
+        this.accountModel = model;
+        this.accountUI = ui;
+    }
+
+    public void search() {
+        List<AccountNameVO> results = getResults();
+        accountModel.results = results;
+        accountUI.displayVOS(results);
+    }
+
+    public List<AccountNameVO> getResults() {
+        ArticleInfoService articleInfoService = new ArticleInfoService();
+        WeChatAccountInfoService service = new WeChatAccountInfoService(articleInfoService);
+        weChatAccountInfoService = service;
+        List<AccountNameVO> accountNameVOS = weChatAccountInfoService.getAllAccounts();
+        return accountNameVOS;
+    }
+}

+ 13 - 0
src/main/java/com/example/mos/container/GetAccountModel.java

@@ -0,0 +1,13 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/25
+ */
+public class GetAccountModel {
+    public List<AccountNameVO> results;
+}

+ 89 - 0
src/main/java/com/example/mos/container/GetAccountUI.java

@@ -0,0 +1,89 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.handler.FollowAccountHandler;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.WeChatAccountInfoService;
+
+import javax.swing.*;
+import java.awt.*;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/25
+ */
+public class GetAccountUI extends JPanel {
+    private JScrollPane scrollPane;
+    private JTextPane resultPane;
+    private FollowAccountHandler followAccountHandler;
+
+    public GetAccountUI() {
+        resultPane = new JTextPane();
+        resultPane.setEditable(false);
+
+        scrollPane = new JScrollPane(resultPane);
+        scrollPane.setPreferredSize(new Dimension(300, 400)); // 设置滚动窗口的大小
+        scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // 显示垂直滚动条
+        setLayout(new BorderLayout());
+
+        JPanel panel = new JPanel(new BorderLayout());
+        panel.add(scrollPane, BorderLayout.CENTER);
+
+        add(panel, BorderLayout.CENTER);
+
+        setVisible(true);
+
+        revalidate(); // 刷新窗体内容
+    }
+
+    public void displayVOS(List<AccountNameVO> accountNameVOS) {
+        resultPane.setText(""); // 清空内容
+        if (!accountNameVOS.isEmpty()) {
+            JPanel rePanel = new JPanel(new GridLayout(accountNameVOS.size(), 3));
+
+            for (AccountNameVO accountNameVO : accountNameVOS) {
+                //创建小面板来容纳图片、字符串和按钮
+                try {
+                    //创建并设置图片
+                    URL imageUrl = new URL(accountNameVO.getPictureUrl()); // 将图片链接转换为URL对象
+                    ImageIcon imageIcon = new ImageIcon(imageUrl); // 通过URL对象创建ImageIcon
+                    imageIcon.setImage(imageIcon.getImage().getScaledInstance(60,60,Image.SCALE_DEFAULT));
+                    JLabel imageLabel = new JLabel(imageIcon);
+                    rePanel.add(imageLabel);
+                } catch (MalformedURLException ex) {
+                    System.out.println("Invalid URL: " + accountNameVO.getPictureUrl());
+                }
+
+                //创建并设置名称
+                JLabel textLabel = new JLabel(accountNameVO.getAccountName());
+                Font font = new Font("SimSun", Font.BOLD, 20);
+                textLabel.setFont(font);
+                textLabel.setHorizontalAlignment(SwingConstants.CENTER);
+                rePanel.add(textLabel);
+
+                ArticleInfoService articleInfoService = new ArticleInfoService();
+                WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+                boolean isExist = weChatAccountInfoService.isExist(accountNameVO.getFakeId());
+
+                // 创建并设置按钮
+                JButton followButton = new JButton(isExist ? "已关注" : "关注");
+                followButton.setPreferredSize(new Dimension(30, 30));
+                followButton.setContentAreaFilled(false);
+                followButton.setBorderPainted(false);
+                rePanel.add(followButton);
+
+                // 为按钮添加点击事件
+                if (followAccountHandler != null) {
+                    followButton.removeActionListener(followAccountHandler);
+                }
+                followAccountHandler = new FollowAccountHandler(accountNameVO, weChatAccountInfoService);
+                followButton.addActionListener(followAccountHandler);
+            }
+            resultPane.insertComponent(rePanel);
+            resultPane.revalidate();
+        }
+    }
+}

+ 61 - 0
src/main/java/com/example/mos/container/JCheckBox/CheckHeaderCellRenderer.java

@@ -0,0 +1,61 @@
+package com.example.mos.container.JCheckBox;
+
+import javax.swing.*;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/8/2
+ */
+public class CheckHeaderCellRenderer implements TableCellRenderer {
+    CheckTableModle tableModle;
+    JTableHeader tableHeader;
+    final JCheckBox selectBox;
+
+    public CheckHeaderCellRenderer(JTable table) {
+        this.tableModle = (CheckTableModle) table.getModel();
+        this.tableHeader = table.getTableHeader();// 表头
+        selectBox = new JCheckBox(tableModle.getColumnName(0));
+        selectBox.setSelected(false);
+        tableHeader.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() > 0) {
+                    //获得选中列
+                    int selectColumn = tableHeader.columnAtPoint(e.getPoint());
+                    if (selectColumn == 0) { //如果点击位置是第一列
+                        boolean value = !selectBox.isSelected(); //切换复选框的选择状态
+                        selectBox.setSelected(value);
+                        tableModle.selectAllOrNull(value);
+                        tableHeader.repaint();
+                    }
+                }
+            }
+        });
+    }
+
+    public void setSelectBox(boolean value) {
+        selectBox.setSelected(value);
+        tableHeader.repaint();
+    }
+
+    @Override
+    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+        String valueStr = (String) value;
+        JLabel label = new JLabel(valueStr);
+        label.setHorizontalAlignment(SwingConstants.CENTER); // 表头标签剧中
+        selectBox.setHorizontalAlignment(SwingConstants.CENTER);// 表头标签剧中
+        selectBox.setBorderPainted(true);
+        JComponent component = (column == 0) ? selectBox : label;
+
+        component.setForeground(tableHeader.getForeground());
+        component.setBackground(tableHeader.getBackground());
+        component.setFont(tableHeader.getFont());
+        component.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
+
+        return component;
+    }
+}

+ 38 - 0
src/main/java/com/example/mos/container/JCheckBox/CheckTableModle.java

@@ -0,0 +1,38 @@
+package com.example.mos.container.JCheckBox;
+
+import javax.swing.table.DefaultTableModel;
+import java.util.Vector;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/8/2
+ */
+public class CheckTableModle extends DefaultTableModel {
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean isCellEditable(int row, int column) {
+        return true;
+    }
+
+    public CheckTableModle(Vector data, Vector columnNames) {
+        super(data, columnNames);
+    }
+
+    // * 根据类型返回显示空间
+    // * 布尔类型返回显示checkbox
+    public Class getColumnClass(int c) {
+        Object value = getValueAt(0, c);
+        if (value != null) {
+            return value.getClass();
+        } else {
+            // 如果值为 null,默认返回 Object.class 或其他适当的默认类型
+            return Object.class;
+        }
+    }
+    public void selectAllOrNull(boolean value) {
+        for (int i = 0; i < getRowCount(); i++) {
+            this.setValueAt(value, i, 0);
+        }
+    }
+}

+ 563 - 0
src/main/java/com/example/mos/container/MainView.java

@@ -0,0 +1,563 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.ArticleDataVO;
+import com.example.mos.container.JCheckBox.CheckHeaderCellRenderer;
+import com.example.mos.container.JCheckBox.CheckTableModle;
+import com.example.mos.handler.*;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.ExportToWordService;
+import com.example.mos.service.WeChatAccountInfoService;
+import org.apache.xpath.operations.Bool;
+
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/19
+ */
+public class MainView extends JFrame {
+
+    OpenSearchPanelHandler openSearchPanelHandler;
+    GetAllSourceHandler getAllSourceHandler;
+    GetArticlesHandler getArticlesHandler;
+    private JTable table;
+    CheckHeaderCellRenderer checkHeaderCellRenderer;
+    private DefaultTableModel tableModel;
+    private JComboBox cob;
+
+    public MainView() {
+        setTitle("知识产权资讯监控系统");
+        ArticleInfoService articleInfoService = new ArticleInfoService();
+        WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+        List<String> fakeIds = weChatAccountInfoService.getAllFakeIds();
+        if (fakeIds != null && !fakeIds.isEmpty()) {
+            JFrame weChatFrame = new JFrame();
+            WeChatLoginHandler weChatLoginHandler = new WeChatLoginHandler();
+            try {
+                weChatLoginHandler.weChatLogin();
+            } catch (Exception e) {
+                JOptionPane.showMessageDialog(weChatFrame, "微信公众平台登陆失败!");
+            }
+        }
+        //用于设置窗体关闭时的默认操作
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        setLayout(new BorderLayout());
+        setLocation(100, 100);
+        setSize(1000, 800);
+
+        openSearchPanelHandler = new OpenSearchPanelHandler(this);
+        getAllSourceHandler = new GetAllSourceHandler(this);
+        getArticlesHandler = new GetArticlesHandler(this);
+
+        JMenuBar menuBar = new JMenuBar();
+        // 检索微信公众号按钮
+        JMenu searchMenu = new JMenu("来源");
+        JMenuItem searchMI = new JMenuItem("搜索微信公众号");
+        JMenuItem allSourceMI = new JMenuItem("查看所有关注");
+        searchMenu.add(searchMI);
+        searchMenu.add(allSourceMI);
+
+        JMenu articleMenu = new JMenu("文章");
+        JMenuItem articleMI = new JMenuItem("查看文章");
+        articleMenu.add(articleMI);
+
+        searchMI.addActionListener(openSearchPanelHandler);
+        allSourceMI.addActionListener(getAllSourceHandler);
+
+        articleMI.addActionListener(getArticlesHandler);
+
+        menuBar.add(searchMenu);
+        menuBar.add(articleMenu);
+
+        setJMenuBar(menuBar);
+        setVisible(true);
+    }
+
+    public void openSearchPanel() {
+        getContentPane().removeAll();
+        SearchController controller = new SearchController();
+        getContentPane().add(controller.searchUI);
+        revalidate(); // 刷新窗体内容
+        repaint();
+    }
+
+    public void openSourcePanel() {
+        GetAccountModel model = new GetAccountModel();
+        GetAccountUI ui = new GetAccountUI();
+        GetAccountController controller = new GetAccountController(model, ui);
+
+        getContentPane().removeAll();
+        controller.search();
+
+        getContentPane().add(ui);
+        revalidate();// 刷新窗体内容
+        repaint();
+    }
+
+    public void openArticlePanel() {
+        //获取数据
+        List<ArticleDataVO> articles = getArticlesFromAPI();
+
+        JPanel mainPanel = new JPanel(new BorderLayout());
+        JPanel topPane = new JPanel(new BorderLayout());
+
+//        JComboBox<String> monthComboBox = new JComboBox<>(new String[]{"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"});
+//        // 添加监听器处理按照月份筛选的逻辑
+//        monthComboBox.addActionListener(new ActionListener() {
+//            @Override
+//            public void actionPerformed(ActionEvent actionEvent) {
+//                filterDataByMonth(monthComboBox.getSelectedItem().toString());
+//            }
+//        });
+//        topPane.add(new JLabel("月份"));
+//        topPane.add(monthComboBox);
+
+//        JComboBox<String> monthComboBox = new JComboBox<>();
+//        for (int i = 1; i <= 12; i++) {
+//            monthComboBox.addItem(String.valueOf(i));
+//        }
+//
+//        JComboBox<String> yearComboBox = new JComboBox<>();
+//        int currentYear = java.time.Year.now().getValue();
+//        for (int i = currentYear - 10; i <= currentYear + 10; i++) {
+//            yearComboBox.addItem(String.valueOf(i));
+//        }
+//
+//        // 添加¥¥¥处理按照月份筛选的逻辑
+//        yearComboBox.addActionListener(new ActionListener() {
+//            @Override
+//            public void actionPerformed(ActionEvent actionEvent) {
+//                filterDataByMonth(Integer.parseInt(yearComboBox.getSelectedItem().toString()), Integer.parseInt(monthComboBox.getSelectedItem().toString()));
+//            }
+//        });
+//
+//        monthComboBox.addActionListener(new ActionListener() {
+//            @Override
+//            public void actionPerformed(ActionEvent actionEvent) {
+//                filterDataByMonth(Integer.parseInt(yearComboBox.getSelectedItem().toString()), Integer.parseInt(monthComboBox.getSelectedItem().toString()));
+//            }
+//        });
+//        topPane.add(new JLabel("年份"));
+//        topPane.add(yearComboBox);
+//        topPane.add(new JLabel("月份"));
+//        topPane.add(monthComboBox);
+
+        JButton exportButton = new JButton("导出");
+        exportButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JFrame frame = new JFrame();
+                // 获取选定行的数据并导出为 Word 文档
+                List<ArticleDataVO> selectedArticles = new ArrayList<>();
+                for (int i = 0; i < tableModel.getRowCount(); i++) {
+                    Object value = tableModel.getValueAt(i, 0);
+                    boolean isSelected;
+                    if (value instanceof Boolean) {
+                        isSelected = (Boolean) value;
+                    } else if (value instanceof String){
+                        isSelected = Boolean.parseBoolean((String) value);
+                    } else {
+                        isSelected = false; // 或者您可以使用其他默认值
+                    }
+                    if (isSelected) {
+                        ArticleDataVO selectedArticle = articles.get(i); // 根据行索引获取对应的文章数据
+                        selectedArticles.add(selectedArticle); // 将所选数据添加到列表中
+                    }
+                }
+                if (selectedArticles.isEmpty()) {
+                    JOptionPane.showMessageDialog(frame, "请选择需要导出的文章!");
+                } else {
+                    Boolean isClassifyExist = true;
+                    System.out.println("isClassifyExist first" + isClassifyExist);
+                    for (ArticleDataVO selectedArticle : selectedArticles) {
+                        if (selectedArticle.getClassify() == null || selectedArticle.getClassify() == 0) {
+                            isClassifyExist = false;
+                            break;
+                        }
+                    }
+                    System.out.println("isClassifyExist after" + isClassifyExist);
+                    if (!isClassifyExist) {
+                        JOptionPane.showMessageDialog(frame, "所选文章中存在分类为空的文章,请填写完整分类信息!");
+                    } else {
+                        // 调用导出方法,传入选定的文章数据
+                        ExportToWordService exportToWordService = new ExportToWordService();
+                        try {
+                            byte[] data = exportToWordService.exprotArticlesToWord(selectedArticles);
+                            // 创建文件选择器并指定默认保存路径
+                            JFileChooser fileChooser = new JFileChooser();
+                            fileChooser.setDialogTitle("导出报告");
+                            fileChooser.setSelectedFile(new File("知识产权相关法律法规资讯整理.docx"));
+
+                            // 显示保存对话框并处理用户的选择
+                            int userSelection = fileChooser.showSaveDialog(frame);
+                            if (userSelection == JFileChooser.APPROVE_OPTION) {
+                                File fileToSave = fileChooser.getSelectedFile();
+
+                                try (FileOutputStream fos = new FileOutputStream(fileToSave.getAbsolutePath() + ".docx")) {
+                                    fos.write(data);
+                                    JOptionPane.showMessageDialog(frame, "文件已成功保存!");
+                                } catch (IOException ex) {
+                                    ex.printStackTrace();
+                                    JOptionPane.showMessageDialog(frame, "保存文件时出现错误!");
+                                }
+                            }
+                        } catch (Exception e2) {
+                            JOptionPane.showMessageDialog(frame, "导出时出现错误!");
+                        }
+                    }
+                }
+            }
+        });
+
+        // 将导出按钮添加到 topPane
+        topPane.add(exportButton, BorderLayout.EAST);
+
+        //创建表格的tableModel
+        Vector headerNames = new Vector();
+        headerNames.add("全选");
+        headerNames.add("标题");
+        headerNames.add("分类");
+        headerNames.add("文章来源");
+        headerNames.add("发布时间");
+        headerNames.add("更新时间");
+        headerNames.add("摘要");
+        headerNames.add("操作");
+        Vector data = this.getData(articles);
+        tableModel = new CheckTableModle(data, headerNames) {
+            @Override
+            public Class<?> getColumnClass(int columnIndex) {
+                if (columnIndex == 0) {
+                    return Boolean.class;
+                } else if (columnIndex == 7) {
+                    return JButton.class;
+                } else {
+                    return super.getColumnClass(columnIndex);
+                }
+            }
+
+            @Override
+            public boolean isCellEditable(int row, int column) {
+                return column == 0 || column == 2 || column == 7;
+            }
+        };
+
+        table = new JTable();
+        table.setModel(tableModel);
+        table.setRowHeight(40);// 行高
+        table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); // 多选
+        table.putClientProperty("terminateEditOnFocusLost", true);
+        table.getTableHeader().setReorderingAllowed(false);
+
+
+        JTableHeader header = table.getTableHeader();
+        header.setPreferredSize(new Dimension(header.getWidth(), 30));// 表头高度
+        checkHeaderCellRenderer = new CheckHeaderCellRenderer(table);
+        header.setDefaultRenderer(checkHeaderCellRenderer);
+
+        TableColumnModel columnModel = table.getColumnModel();
+        columnModel.getColumn(0).setCellRenderer(new CheckBoxRenderer());
+        columnModel.getColumn(0).setCellEditor(new CheckBoxCellEditor());
+        columnModel.getColumn(0).setPreferredWidth(30);
+        columnModel.getColumn(1).setPreferredWidth(350);
+
+        Vector<String> vector = new Vector<>();
+        vector.add(0, "");
+        vector.add("国家知识产权局");
+        vector.add("地方法规及规章");
+        vector.add("地方标准");
+        vector.add("判例");
+        vector.add("国外相关资讯");
+        vector.add("行业资讯");
+        cob = new JComboBox<>(vector);
+        cob.setSelectedIndex(-1);
+
+        cob.addItemListener(new ItemListener() {
+            @Override
+            public void itemStateChanged(ItemEvent e) {
+                if(e.getStateChange() == ItemEvent.SELECTED && table.getSelectedRow() >= 0 && table.getSelectedColumn() >= 0) {
+                    int column = table.getColumnModel().getColumnIndex("分类");
+                    int selectedColumn = table.getSelectedColumn();
+                    int selectedRow = table.getSelectedRow();
+                    int modelRow = table.convertRowIndexToModel(selectedRow);
+                    if (selectedColumn == column) {
+                        ArticleDataVO selectArticle = articles.get(modelRow);
+                        selectArticle.setClassifyName(cob.getSelectedItem().toString());
+                        Integer classify;
+                        switch (cob.getSelectedItem().toString()) {
+                            case "国家知识产权局":
+                                classify = 1;
+                                break;
+                            case "地方法规及规章":
+                                classify = 2;
+                                break;
+                            case "地方标准":
+                                classify = 3;
+                                break;
+                            case "判例":
+                                classify = 4;
+                                break;
+                            case "国外相关资讯":
+                                classify = 5;
+                                break;
+                            case "行业资讯":
+                                classify = 6;
+                                break;
+                            default:
+                                classify = 0;
+                        }
+                        if (classify != null && classify != 0) {
+                            selectArticle.setClassify(classify);
+                            ArticleInfoService articleInfoService = new ArticleInfoService();
+                            articleInfoService.updateInfo(selectArticle);
+                        }
+                    }
+                }
+            }
+        });
+        columnModel.getColumn(2).setCellEditor(new DefaultCellEditor(cob));
+
+        columnModel.getColumn(7).setCellRenderer(new MyButtonRender());
+        columnModel.getColumn(7).setCellEditor(new MyButtonEditor(table, articles));
+
+        // 创建 TableRowSorter 对象,并将其与表格模型关联
+        TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>(tableModel);
+        table.setRowSorter(sorter);
+
+        //设置鼠标点击跳转外部网页
+        table.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                // 获取标题列的索引
+                int column = table.getColumnModel().getColumnIndex("标题");
+                if (table.columnAtPoint(e.getPoint()) == column) {
+                    // 获取所点击的行和列
+                    int viewRow = table.rowAtPoint(e.getPoint());
+                    int modelRow = table.convertRowIndexToModel(viewRow);
+                    // 如果点击的是文章链接列
+                    // 获取链接的地址
+                    String link = articles.get(modelRow).getLink();
+                    try {
+                        Desktop.getDesktop().browse(new URI(link));
+                    } catch (IOException | URISyntaxException ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+        });
+
+        // 创建滚动窗格并将表格添加到其中
+        JScrollPane scrollPane = new JScrollPane(table);
+        // 添加顶部面板和滚动窗格到主面板
+        mainPanel.add(topPane, BorderLayout.NORTH);
+        mainPanel.add(scrollPane, BorderLayout.CENTER);
+        // 清空原有内容,添加主面板,重新绘制
+        getContentPane().removeAll();
+        getContentPane().add(mainPanel);
+        revalidate();
+        repaint();
+    }
+
+//    private void filterDataByMonth(String selectedMonth) {
+//        RowFilter<DefaultTableModel, Integer> filter = new RowFilter<DefaultTableModel, Integer>() {
+//            public boolean include(Entry<? extends DefaultTableModel, ? extends Integer> entry) {
+//                SimpleDateFormat sdf = new SimpleDateFormat("MMMM");
+//                Date date = (Date) entry.getValue(3);
+//                String month = sdf.format(date);
+//                return month.equals(selectedMonth);
+//            }
+//        };
+//
+//        TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>(tableModel);
+//        sorter.setRowFilter(filter);
+//        table.setRowSorter(sorter);
+//    }
+
+    private void filterDataByMonth(int selectedYear, int selectedMonth) {
+        RowFilter<DefaultTableModel, Integer> filter = new RowFilter<DefaultTableModel, Integer>() {
+            public boolean include(Entry<? extends DefaultTableModel, ? extends Integer> entry) {
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                try {
+                    Date date = sdf.parse(entry.getStringValue(3)); // Parse the String date to Date object
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.setTime(date);
+
+                    // Extracting year and month from the date
+                    int year = calendar.get(Calendar.YEAR);
+                    int month = calendar.get(Calendar.MONTH) + 1; // Adjusting month index
+
+                    // Checking if the month and year match the selected criteria
+                    return (year == selectedYear && month == selectedMonth);
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                    return false;
+                }
+            }
+        };
+
+        TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>(tableModel);
+        sorter.setRowFilter(filter);
+        table.setRowSorter(sorter);
+    }
+
+    public List<ArticleDataVO> getArticlesFromAPI() {
+        ArticleInfoService articleInfoService = new ArticleInfoService();
+        List<ArticleDataVO> articleDataVOS =  articleInfoService.getArticles();
+        for (ArticleDataVO articleDataVO : articleDataVOS) {
+            Integer classify = articleDataVO.getClassify();
+            switch (classify) {
+                case 1:
+                    articleDataVO.setClassifyName("国家知识产权局");
+                    break;
+                case 2:
+                    articleDataVO.setClassifyName("地方法规及规章");
+                    break;
+                case 3:
+                    articleDataVO.setClassifyName("地方标准");
+                    break;
+                case 4:
+                    articleDataVO.setClassifyName("判例");
+                    break;
+                case 5:
+                    articleDataVO.setClassifyName("国外相关资讯");
+                    break;
+                case 6:
+                    articleDataVO.setClassifyName("行业资讯");
+                    break;
+                default:
+                    articleDataVO.setClassifyName(" ");
+                    break;
+            }
+        }
+        return articleDataVOS;
+    }
+
+    private Vector getData(List<ArticleDataVO> articles) {
+        Vector data = new Vector();
+        for (ArticleDataVO articleDataVO : articles) {
+            Vector rowVector = new Vector();
+            rowVector.add("");
+            rowVector.add(articleDataVO.getTitle());
+            rowVector.add(articleDataVO.getClassifyName());
+            rowVector.add(articleDataVO.getCameFrom());
+            rowVector.add(articleDataVO.getTime());
+            rowVector.add(articleDataVO.getCreateTime());
+            rowVector.add(articleDataVO.getAbs());
+            data.add(rowVector);
+        }
+        return data;
+    }
+
+    class CheckBoxRenderer extends JCheckBox implements TableCellRenderer {
+        // 声明一个序列化版本标识符,用于控制对象序列化的版本一致性
+        private static final long serialVersionUID = 1L;
+        // 定义一个边框对象
+        Border border = new EmptyBorder(1, 2, 1, 2);
+
+        // CheckBoxRenderer 类的构造函数,初始化复选框渲染器
+        public CheckBoxRenderer() {
+            super();// 调用父类 JCheckBox 的构造函数
+            setOpaque(true);// 设置组件为不透明
+            setHorizontalAlignment(SwingConstants.CENTER);// 设置水平对齐方式为居中
+        }
+
+        // 实现 TableCellRenderer 接口中的 getTableCellRendererComponent 方法
+        @Override
+        public Component getTableCellRendererComponent (
+                JTable table,
+                Object value,
+                boolean isSelected,
+                boolean hasFocus,
+                int row,
+                int column) {
+            // 检查值是否为 Boolean 类型
+            if (value instanceof Boolean) {
+                // 根据 Boolean 值设置复选框选择状态
+                setSelected(((Boolean) value).booleanValue());
+                setForeground(table.getForeground());// 设置前景色
+                setBackground(table.getBackground());// 设置背景色
+            }
+            return this;// 返回渲染完成的组件
+        }
+    }
+
+    class CheckBoxCellEditor extends AbstractCellEditor implements TableCellEditor {
+        private static final long serialVersionUID = 1L;
+        // 声明一个 JCheckBox 类型的变量 checkBox
+        protected JCheckBox checkBox;
+
+        public CheckBoxCellEditor() {
+            checkBox = new JCheckBox();// 创建新的复选框实例
+            checkBox.setHorizontalAlignment(SwingConstants.CENTER);// 设置复选框水平对齐方式为居中
+            checkBox.addChangeListener(new ChangeListener() {
+                @Override
+                public void stateChanged(ChangeEvent e) {
+                    fireEditingStopped();
+
+                    if (checkBox.isSelected()) { // 勾选,判断是否已经全部勾选,如果是将header勾选
+                        int count = 0;
+                        for (int rowNo = 0; rowNo < table.getRowCount(); rowNo++) {
+                            Object value = table.getValueAt(rowNo, 0);
+                            Boolean cbx;
+                            if (value instanceof String) {
+                                String stringValue = (String) value;
+                                System.out.println("stringValue" + stringValue);
+                                cbx = Boolean.parseBoolean(stringValue);
+                            } else if (value instanceof Boolean) {
+                                cbx = (Boolean) value;
+                            } else {
+                                cbx = false;
+                            }
+//                            Boolean cbx = (Boolean) table.getValueAt(rowNo, 0);
+                            if (cbx) count++;
+                        }
+                        if (count == table.getRowCount()) {
+                            checkHeaderCellRenderer.setSelectBox(true);
+                        } else {
+                            checkHeaderCellRenderer.setSelectBox(false);
+                        }
+                    }
+                }
+            });
+        }
+
+        // 覆盖 AbstractCellEditor 类的方法,获取当前单元格编辑器的值
+        @Override
+        public Object getCellEditorValue() {
+            return Boolean.valueOf(checkBox.isSelected());// 返回当前复选框的选择状态
+        }
+
+        // 覆盖 TableCellEditor 接口的方法,返回单元格编辑器组件
+        @Override
+        public Component getTableCellEditorComponent(
+                JTable table,
+                Object value,
+                boolean isSelected,
+                int row,
+                int column) {
+            if (value instanceof Boolean) {
+                checkBox.setSelected((Boolean) value); // 如果值是布尔类型,则直接设置选中状态
+            } else if (value instanceof String) {
+                checkBox.setSelected(Boolean.parseBoolean((String) value)); // 如果值是字符串类型,则解析为布尔值后设置选中状态
+            }
+            return checkBox; // 返回复选框组件
+        }
+    }
+}

+ 60 - 0
src/main/java/com/example/mos/container/SearchController.java

@@ -0,0 +1,60 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.handler.WeChatLoginHandler;
+import com.example.mos.weChatLogin.api.WeiXinApi;
+import com.example.mos.weChatLogin.exceptions.WxApiException;
+import com.example.mos.weChatLogin.model.BizData;
+import com.example.mos.weChatLogin.model.WxResultBody;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/23
+ */
+public class SearchController {
+    SearchModel searchModel;
+    SearchUI searchUI;
+
+    public SearchController(){
+        searchModel = new SearchModel();
+        searchUI = new SearchUI(this);
+    }
+
+    public void search(String str){
+        searchModel.queryStr = str;
+        List<BizData> list = new ArrayList<>();
+        //先进行搜索
+        try {
+            WxResultBody<List<BizData>> searchBiz = WeiXinApi.searchBiz(searchModel.queryStr);
+            list = searchBiz.getList();
+        } catch (WxApiException e) {
+            if (e.getWxResultStatus().toString().equals("FAIL_STATUS")) {
+                WeChatLoginHandler weChatLoginHandler = new WeChatLoginHandler();
+                try {
+                    weChatLoginHandler.weChatLogin();
+                } catch (Exception e2) {
+                    System.out.println("login failed");
+                }
+                WxResultBody<List<BizData>> searchBiz = WeiXinApi.searchBiz(searchModel.queryStr);
+                list = searchBiz.getList();
+            }
+        }
+        searchModel.results = this.loadResults(list);
+        searchUI.displayVOS();
+    }
+
+    private List<AccountNameVO> loadResults(List<BizData> list) {
+        List<AccountNameVO> accountNameVOS = new ArrayList<>();
+        for (BizData data : list) {
+            AccountNameVO accountNameVO = new AccountNameVO();
+            accountNameVO.setAccountName(data.getNickname());
+            accountNameVO.setFakeId(data.getFakeid());
+            accountNameVO.setPictureUrl(data.getRound_head_img());
+            accountNameVOS.add(accountNameVO);
+        }
+        return accountNameVOS;
+    }
+}

+ 14 - 0
src/main/java/com/example/mos/container/SearchModel.java

@@ -0,0 +1,14 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/23
+ */
+public class SearchModel {
+    public String queryStr;
+    public List<AccountNameVO> results;
+}

+ 104 - 0
src/main/java/com/example/mos/container/SearchUI.java

@@ -0,0 +1,104 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.handler.FollowAccountHandler;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.FollowService;
+import com.example.mos.service.WeChatAccountInfoService;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/23
+ */
+public class SearchUI extends JPanel {
+    SearchController controller;
+    JTextPane resultPane;
+    private JTextField searchField;
+    private FollowAccountHandler followAccountHandler;
+
+    public SearchUI(SearchController c) {
+        controller = c;
+        this.setLayout(new BorderLayout());
+        JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        searchField = new JTextField(20);
+        searchField.setPreferredSize(new Dimension(200, 30));
+        JButton searchButton = new JButton("检索");
+        resultPane = new JTextPane();
+        resultPane.setEditable(false); // 此文本框为只读
+        searchButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent actionEvent) {
+                controller.search(searchField.getText());
+            }
+        });
+        topPanel.add(searchField);
+        topPanel.add(searchButton);
+        // 将resultTextPane添加到按钮下方
+        this.add(topPanel, BorderLayout.NORTH);
+        this.add(resultPane, BorderLayout.CENTER);
+        revalidate(); // 刷新窗体内容
+        repaint();
+    }
+
+    public void displayVOS() {
+        searchField.setText(controller.searchModel.queryStr);
+        resultPane.setText(""); // 清空内容
+        List<AccountNameVO> accountNameVOS = controller.searchModel.results;
+        if (!accountNameVOS.isEmpty()) {
+            JPanel rePanel = new JPanel(new GridLayout(accountNameVOS.size(), 3));
+
+            for (AccountNameVO accountNameVO : accountNameVOS) {
+                //创建小面板来容纳图片、字符串和按钮
+                try {
+                    //创建并设置图片
+                    URL imageUrl = new URL(accountNameVO.getPictureUrl()); // 将图片链接转换为URL对象
+                    ImageIcon imageIcon = new ImageIcon(imageUrl); // 通过URL对象创建ImageIcon
+                    imageIcon.setImage(imageIcon.getImage().getScaledInstance(60,60,Image.SCALE_DEFAULT));
+                    JLabel imageLabel = new JLabel(imageIcon);
+                    rePanel.add(imageLabel);
+                } catch (MalformedURLException ex) {
+                    System.out.println("Invalid URL: " + accountNameVO.getPictureUrl());
+                }
+
+                //创建并设置名称
+                JLabel textLabel = new JLabel(accountNameVO.getAccountName());
+                Font font = new Font("SimSun", Font.BOLD, 20);
+                textLabel.setFont(font);
+                textLabel.setHorizontalAlignment(SwingConstants.CENTER);
+                rePanel.add(textLabel);
+
+                ArticleInfoService articleInfoService = new ArticleInfoService();
+                WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+                boolean isExist = weChatAccountInfoService.isExist(accountNameVO.getFakeId());
+                // 创建并设置按钮
+                JButton followButton = new JButton(isExist ? "已关注" : "关注");
+                followButton.setPreferredSize(new Dimension(30, 30));
+                followButton.setContentAreaFilled(false);
+                followButton.setBorderPainted(false);
+                rePanel.add(followButton);
+
+                // 为按钮添加点击事件
+//                ArticleInfoService articleInfoService = new ArticleInfoService();
+//                WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+                followAccountHandler = new FollowAccountHandler(accountNameVO, weChatAccountInfoService);
+                followButton.addActionListener(followAccountHandler);
+            }
+            resultPane.insertComponent(rePanel);
+        }
+        this.add(resultPane, BorderLayout.CENTER);
+        // 更新UI以确保内容立即可见
+        this.revalidate();
+        this.repaint();
+    }
+
+}
+
+

+ 74 - 0
src/main/java/com/example/mos/container/ShowArticlesController.java

@@ -0,0 +1,74 @@
+package com.example.mos.container;
+
+import com.example.mos.common.model.vo.ArticleDataVO;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.WeChatAccountInfoService;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableModel;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/8/1
+ */
+public class ShowArticlesController {
+    private ShowArticlesModel articlesModel;
+    private ShowArticlesUI articlesUI;
+
+    public ShowArticlesController(ShowArticlesModel model, ShowArticlesUI ui){
+        this.articlesModel = model;
+        this.articlesUI = ui;
+    }
+
+    public void getArticles() {
+        List<ArticleDataVO> articles = getArticlesFromAPI();
+        // 转换文章数据为二维数组,用于填充表格模型
+        Object[][] data = convertArticleListToData(articles);
+        // 定义表头和初始数据模型
+        String[] columnNames = {"标题", "文章链接", "文章来源", "发布时间","摘要" , "操作"};
+        DefaultTableModel tableModel = new DefaultTableModel(data, columnNames) {
+            @Override
+            public Class<?> getColumnClass(int columnIndex) {
+                if (columnIndex == 3) {
+                    return JButton.class;
+                } else {
+                    return super.getColumnClass(columnIndex);
+                }
+            }
+
+            @Override
+            public boolean isCellEditable(int row, int column) {
+                return column == 4;
+            }
+        };
+        articlesModel.tableModel = tableModel;
+        articlesUI.displayVOS(tableModel, articles);
+    }
+
+    public List<ArticleDataVO> getArticlesFromAPI() {
+        ArticleInfoService articleInfoService = new ArticleInfoService();
+        List<ArticleDataVO> articleDataVOS =  articleInfoService.getArticles();
+        for (ArticleDataVO articleDataVO : articleDataVOS) {
+            if (articleDataVO.getSource().equals(0)) {
+                ArticleInfoService articleInfoService1 = new ArticleInfoService();
+                WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService1);
+                String accountName = weChatAccountInfoService.getNameByFakeId(articleDataVO.getCameFrom());
+                if (accountName != null) {
+                    articleDataVO.setCameFrom(accountName);
+                }
+            }
+        }
+        return articleDataVOS;
+    }
+
+    // 辅助方法:将文章数据转换为二维数组
+    private Object[][] convertArticleListToData(List<ArticleDataVO> articles) {
+        Object[][] data = new Object[articles.size()][3]; // 仅保留标题、来源、发布时间三个字段
+        for (int i = 0; i < articles.size(); i++) {
+            ArticleDataVO article = articles.get(i);
+            data[i] = new Object[] {article.getTitle(), article.getLink(), article.getCameFrom(), article.getTime(), article.getSource()};
+        }
+        return data;
+    }
+}

+ 11 - 0
src/main/java/com/example/mos/container/ShowArticlesModel.java

@@ -0,0 +1,11 @@
+package com.example.mos.container;
+
+import javax.swing.table.DefaultTableModel;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/8/1
+ */
+public class ShowArticlesModel {
+    public DefaultTableModel tableModel;
+}

+ 118 - 0
src/main/java/com/example/mos/container/ShowArticlesUI.java

@@ -0,0 +1,118 @@
+package com.example.mos.container;
+
+
+import com.example.mos.common.model.vo.ArticleDataVO;
+import com.example.mos.handler.MyButtonEditor;
+import com.example.mos.handler.MyButtonRender;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableColumnModel;
+import javax.swing.table.TableRowSorter;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/8/1
+ */
+public class ShowArticlesUI extends JPanel {
+    private JTable table;
+    private DefaultTableModel tableModel;
+
+    public ShowArticlesUI() {
+        setLayout(new BorderLayout());
+
+        JPanel topPane = new JPanel(new GridLayout(1, 3));
+        JComboBox<String> monthComboBox = new JComboBox<>(new String[]{"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"});
+        // 添加监听器处理按照月份筛选的逻辑
+        monthComboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent actionEvent) {
+                filterDataByMonth(monthComboBox.getSelectedItem().toString());
+            }
+        });
+        topPane.add(new JLabel("月份"));
+        topPane.add(monthComboBox);
+
+        JScrollPane scrollPane = new JScrollPane(table);
+        this.add(topPane, BorderLayout.NORTH);
+        this.add(scrollPane, BorderLayout.CENTER);
+
+    }
+
+    public void displayVOS(DefaultTableModel model,  List<ArticleDataVO> articles) {
+        tableModel = model;
+        table = new JTable(model);
+
+        table.setCellSelectionEnabled(true);
+        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        // 设置表头高度
+        JTableHeader header = table.getTableHeader();
+        header.setPreferredSize(new Dimension(header.getWidth(), 30));
+        // 设置行高
+        table.setRowHeight(40);
+        table.getColumnModel().getColumn(4).setCellRenderer(new MyButtonRender());
+        table.getColumnModel().getColumn(4).setCellEditor(new MyButtonEditor(table, articles));
+        // 设置标题列宽
+        TableColumnModel columnModel = table.getColumnModel();
+        columnModel.getColumn(0).setPreferredWidth(350);
+        // 创建 TableRowSorter 对象,并将其与表格模型关联
+        TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>(model);
+        table.setRowSorter(sorter);
+
+        // 启用表格行排序
+        List<RowSorter.SortKey> sortKeys = new ArrayList<>();
+        sortKeys.add(new RowSorter.SortKey(2, SortOrder.ASCENDING)); // 默认按第3列升序排列
+        sorter.setSortKeys(sortKeys);
+        sorter.sort();
+        table.setDefaultEditor(Object.class, null);
+        //设置鼠标点击跳转外部网页
+        table.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                // 获取标题列的索引
+                int column = table.getColumnModel().getColumnIndex("标题");
+                if (table.columnAtPoint(e.getPoint()) == column) {
+                    // 获取所点击的行和列
+                    int viewRow = table.rowAtPoint(e.getPoint());
+                    int modelRow = table.convertRowIndexToModel(viewRow);
+                    // 如果点击的是文章链接列
+                    // 获取链接的地址
+                    String link = articles.get(modelRow).getLink();
+                    try {
+                        Desktop.getDesktop().browse(new URI(link));
+                    } catch (IOException | URISyntaxException ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+        });
+    }
+
+    private void filterDataByMonth(String selectedMonth) {
+        RowFilter<DefaultTableModel, Integer> filter = new RowFilter<DefaultTableModel, Integer>() {
+            public boolean include(Entry<? extends DefaultTableModel, ? extends Integer> entry) {
+                SimpleDateFormat sdf = new SimpleDateFormat("MMMM");
+                Date date = (Date) entry.getValue(3);
+                String month = sdf.format(date);
+                return month.equals(selectedMonth);
+            }
+        };
+
+        TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>(tableModel);
+        sorter.setRowFilter(filter);
+        table.setRowSorter(sorter);
+    }
+}

+ 38 - 0
src/main/java/com/example/mos/controller/FollowController.java

@@ -0,0 +1,38 @@
+package com.example.mos.controller;
+
+import com.example.mos.common.model.dto.FollowDTO;
+import com.example.mos.service.FollowService;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/3
+ */
+
+
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/follow")
+public class FollowController {
+    private final FollowService followService;
+
+    @PostMapping("/addFollow")
+    @Operation(summary = "关注")
+    public String addFollow(@RequestBody FollowDTO followDTO) {
+        if (followDTO != null) {
+            Integer id = followService.add(followDTO);
+            return "上传成功";
+        } else {
+            return "上传失败";
+        }
+    }
+}

+ 40 - 0
src/main/java/com/example/mos/controller/TaskController.java

@@ -0,0 +1,40 @@
+package com.example.mos.controller;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.common.model.vo.OfficalAccountReVO.ArticleVO;
+import com.example.mos.domain.quartz.QrtzTaskDTO;
+import com.example.mos.service.QuartzTask.QuartzTaskService;
+import com.example.mos.service.TaskService;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/task")
+public class TaskController {
+
+    @Autowired
+    private QuartzTaskService quartzTaskService;
+
+    @Operation(summary = "添加定时任务")
+    @PostMapping("/add")
+    public String add(@RequestBody QrtzTaskDTO qrtzTaskDTO) {
+        try {
+            quartzTaskService.addQuartzTask(qrtzTaskDTO);
+        } catch (Exception e) {
+            return "failed";
+        }
+        return "success";
+    }
+}

+ 184 - 0
src/main/java/com/example/mos/controller/WeChatAccountController.java

@@ -0,0 +1,184 @@
+package com.example.mos.controller;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.common.model.vo.ArticleDataVO;
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.common.model.vo.OfficalAccountReVO.ArticleVO;
+import com.example.mos.handler.WeChatLoginHandler;
+import com.example.mos.service.*;
+import com.example.mos.service.GetWebArticle.*;
+import com.example.mos.service.GetWebArticle.Cnipr.GetPPHArticleService;
+import com.example.mos.weChatLogin.api.WeiXinApi;
+import com.example.mos.weChatLogin.exceptions.WxApiException;
+import com.example.mos.weChatLogin.model.Article;
+import com.example.mos.weChatLogin.model.WxResultBody;
+import com.example.mos.weChatLogin.okhttp.MyCookieStore;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.io.InputStreamResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.swing.*;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/5/29
+ */
+@Slf4j
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/WeChatOfficalAccount")
+public class WeChatAccountController {
+    private final WeChatAccountInfoService weChatAccountInfoService;
+    private final GetWeb1ArticleService getWeb1ArticleService;
+    private final GetHeNanArticleService getArticleService;
+    private final GetWeb4ArticleService getWeb4ArticleService;
+    private final GetPPHArticleService getPPHArticleService;
+    private final ArticleInfoService articleInfoService;
+    private final ExportArticleService exportArticleService;
+
+    @GetMapping("/getFakeId")
+    public List<AccountNameVO> getFakeId(String name) throws IOException {
+        List<AccountNameVO> accountNameVOS = weChatAccountInfoService.queryWeiXinAccountName(name);
+        return accountNameVOS;
+    }
+
+    @PostMapping("/getArticles")
+    public List<ArticleVO> getArticles(@RequestBody List<String> fakeIds) throws IOException {
+        List<ArticleVO> articleVOS = new ArrayList<>();
+        articleVOS = weChatAccountInfoService.getAccountArticles(fakeIds);
+        return articleVOS;
+    }
+
+    @GetMapping("/getWebArticles")
+    public List<String> getWebArticles() throws IOException {
+        List<String> responseBodies = new ArrayList<>();
+        // 国家法律法规数据库
+        List<String> types = new ArrayList<>();
+        types.add("dfxfg");
+//        types.add("sfjs");
+//        types.add("jcfg");
+//        types.add("xzfg");
+//        types.add("flfg");
+        for (String type : types) {
+            try {
+                System.out.println("--------------Web1---start---------------");
+                String responseBody = getWeb1ArticleService.getWeb(type);
+                responseBodies.add(responseBody);
+                System.out.println(type + "--------------success--------------");
+            } catch (Exception e) {
+                System.out.println("--------------Web1---error---------------");
+            }
+        }
+        return responseBodies;
+    }
+
+    @GetMapping("/getWeChatArticles")
+    public List<ArticleInfoDTO> getWeChatArticles() {
+        JFrame frame = new JFrame();
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        Map<String, List<Article>> stringListMap = new HashMap<>();
+        List<String> fakeIds = weChatAccountInfoService.getAllFakeIds();
+        MyCookieStore.getToken();
+        System.out.println("MyCookieStore.getToken()-----" +  MyCookieStore.getToken());
+        if (MyCookieStore.getToken() == null || MyCookieStore.getToken().equals("")) {
+            WeChatLoginHandler weChatLoginHandler = new WeChatLoginHandler();
+            try {
+                weChatLoginHandler.weChatLogin();
+            } catch (Exception e) {
+                JOptionPane.showMessageDialog(frame, "微信公众平台登陆失败!");
+            }
+        }
+        ExecutorService executor = Executors.newFixedThreadPool(5); // 建议调整线程池大小
+
+        for (String fakeId : fakeIds) {
+            executor.submit(() -> {
+                try {
+                    Thread.sleep(1000); // 在每次访问之间引入延迟(例如1秒)
+                    WxResultBody<List<Article>> findExList = WeiXinApi.findExList(fakeId);
+                    List<Article> exList = findExList.getApp_msg_list();
+
+                    List<ArticleInfoDTO> articleInfos = new ArrayList<>();
+                    for (Article article : exList) {
+                        try {
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(article.getTitle());
+                            articleInfoDTO.setLink(article.getLink());
+                            String timestampString = article.getCreate_time();
+                            long timestamp = Long.parseLong(timestampString);
+
+                            Date date = new Date(timestamp * 1000);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId(fakeId);
+                            articleInfoDTO.setSource(0);
+
+                            articleInfos.add(articleInfoDTO);
+                        } catch (Exception e) {
+                            continue;
+                        }
+                    }
+
+                    stringListMap.put(fakeId, exList);
+                    articleInfoDTOS.addAll(articleInfos);
+                } catch (InterruptedException e) {
+                    Thread.currentThread().interrupt();
+                }
+            });
+        }
+
+        executor.shutdown();
+        try {
+            executor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); // 等待所有线程执行完成
+        } catch (InterruptedException e) {
+            System.err.println("线程池被中断");
+        }
+
+        System.out.println(articleInfoDTOS);
+//        articleInfoService.addArticles(articleInfoDTOS);
+        return articleInfoDTOS;
+    }
+
+    @GetMapping("/getWeb4Articles")
+    public String getWeb4Articles() throws IOException {
+        String type = "1";
+        Integer page = 1;
+        String sobj = "content";
+        String keywords = "%B7%A8%CA%CD";
+        String html = getWeb4ArticleService.getWeb4(type, sobj, keywords, page);
+        return html;
+    }
+
+    @GetMapping("/getWeb2Articles")
+    public List<String> getWeb2Articles() throws IOException {
+        List<String> strs = getArticleService.getHeNan();
+        return strs;
+    }
+
+    @GetMapping("/getInfo")
+    public List<ArticleDataVO> getInfo() throws IOException {
+        List<ArticleDataVO> articleDataVOS = articleInfoService.getArticles();
+        return articleDataVOS;
+    }
+
+    @PostMapping("/exportArticles")
+    public ResponseEntity<InputStreamResource> exportArticles(@RequestBody ArticleInfoDTO articleInfoDTO) throws IOException {
+        byte[] fileData = exportArticleService.exportToWord(articleInfoDTO.getLink());
+        //保存生成excel的地址
+        String fileName = articleInfoDTO.getTitle()+ ".doc";
+        //文件原始名中的中文字符可能会乱码,对文件名进行URL编码
+        String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.toString());
+        return ResponseEntity.ok().contentLength(fileData.length)
+                .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + encodedFileName + "\"")
+                .contentType(MediaType.parseMediaType("application/octet-stream"))
+                .body(new InputStreamResource(new ByteArrayInputStream(fileData)));
+    }
+}

+ 65 - 0
src/main/java/com/example/mos/domain/ArticleInfo.java

@@ -0,0 +1,65 @@
+package com.example.mos.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 文章信息
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Data
+@TableName("article_info")
+public class ArticleInfo extends BaseEntity<ArticleInfo> {
+    /**
+     * 来源
+     */
+    @TableField("source")
+    private Integer source;
+
+    /**
+     * 全文link
+     */
+    @TableField("link")
+    private String link;
+
+    /**
+     * 发布时间
+     */
+    @TableField("publish_time")
+    private Date time;
+
+    /**
+     * 标题
+     */
+    @TableField("title")
+    private String title;
+
+    /**
+     * fakeId
+     */
+    @TableField("fake_id")
+    private String fakeId;
+
+    /**
+     * 摘要
+     */
+    @TableField("abs")
+    private String abs;
+
+    /**
+     * 分类
+     */
+    @TableField("classify")
+    private Integer classify;
+
+    /**
+     * 入库时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+}

+ 26 - 0
src/main/java/com/example/mos/domain/Follow.java

@@ -0,0 +1,26 @@
+package com.example.mos.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/5/30
+ */
+@Data
+@TableName("follow_account")
+public class Follow extends BaseEntity<Follow> {
+    /**
+     * 关注类型(0微信公众号 1网页)
+     */
+    @TableField("follow_type")
+    private Integer followType;
+
+    /**
+     * 公众号fakeid/网页id
+     */
+    @TableField("follow_id")
+    private String followId;
+}

+ 35 - 0
src/main/java/com/example/mos/domain/QuartzTask.java

@@ -0,0 +1,35 @@
+package com.example.mos.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+/**
+ * 定时任务
+ * @TableName quartz_task
+ */
+@TableName(value ="quartz_task")
+@Data
+public class QuartzTask extends BaseEntity<QuartzTask> {
+    /**
+     * 任务类型 0专利导入定时任务
+     */
+    private Integer taskType;
+
+    /**
+     * 参数
+     */
+    private String parameter;
+
+    /**
+     * 
+     */
+    private String cron;
+
+    /**
+     * 是否运行
+     */
+    private Integer ifRun;
+
+    private String jobClass;
+}

+ 23 - 0
src/main/java/com/example/mos/domain/WeChatAccountInfo.java

@@ -0,0 +1,23 @@
+package com.example.mos.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/25
+ */
+@Data
+@TableName("wechat_account_info")
+public class WeChatAccountInfo extends BaseEntity<WeChatAccountInfo> {
+    @TableField("account_name")
+    private String accountName;
+    @TableField("picture_url")
+    private String pictureUrl;
+    @TableField("fake_id")
+    private String fakeId;
+    @TableField("if_cancel")
+    private Boolean ifCancel;
+}

+ 19 - 0
src/main/java/com/example/mos/domain/WebInfo.java

@@ -0,0 +1,19 @@
+package com.example.mos.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.example.mos.common.model.BaseEntity;
+import lombok.Data;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/26
+ */
+@Data
+@TableName("web_info")
+public class WebInfo extends BaseEntity<WebInfo> {
+    @TableField("web_url")
+    private String webUrl;
+    @TableField("web_name")
+    private String webName;
+}

+ 41 - 0
src/main/java/com/example/mos/domain/quartz/QrtzTaskDTO.java

@@ -0,0 +1,41 @@
+package com.example.mos.domain.quartz;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 任务条件表的实体类
+ *
+ * @Author chenyu
+ * @Date 2023/3/27
+ */
+@Data
+public class QrtzTaskDTO  implements Serializable {
+    /**
+     * ID
+     */
+    private Integer id;
+
+    /**
+     *
+     */
+    private Integer taskType;
+
+    /**
+     *
+     */
+    private String parameter;
+
+    /**
+     *
+     */
+    private String cron;
+
+    /**
+     * 是否运行
+     */
+    private Integer ifRun;
+
+    private String jobClass;
+}

+ 14 - 0
src/main/java/com/example/mos/domain/quartz/QuartzVO.java

@@ -0,0 +1,14 @@
+package com.example.mos.domain.quartz;
+
+import lombok.Data;
+
+@Data
+public class QuartzVO {
+    /**
+     * 任务名称
+     */
+    private String jobName;
+    private String jobGroupName;
+    private String triggerName;
+    private String triggerGroupName;
+}

+ 60 - 0
src/main/java/com/example/mos/handler/FollowAccountHandler.java

@@ -0,0 +1,60 @@
+package com.example.mos.handler;
+
+import com.example.mos.common.model.dto.FollowDTO;
+import com.example.mos.common.model.dto.WeChatAccountInfoDTO;
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.service.FollowService;
+import com.example.mos.service.WeChatAccountInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/25
+ */
+public class FollowAccountHandler implements ActionListener {
+    private String accountName;
+    private String fakeId;
+    private String pictureUrl;
+//    private FollowService followService;
+    private WeChatAccountInfoService weChatAccountInfoService;
+
+    public FollowAccountHandler(AccountNameVO accountNameVO, WeChatAccountInfoService weChatAccountInfoService) {
+        this.accountName = accountNameVO.getAccountName();
+        this.fakeId = accountNameVO.getFakeId();
+        this.pictureUrl = accountNameVO.getPictureUrl();
+//        this.followService = followService;
+        this.weChatAccountInfoService = weChatAccountInfoService;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent actionEvent) {
+        JButton button = (JButton) actionEvent.getSource(); // 获取触发事件的按钮
+        String buttonText = button.getText();
+        if (buttonText.equals("关注")) {
+//            FollowDTO followDTO = new FollowDTO();
+//            followDTO.setFollowId(fakeId);
+//            followDTO.setFollowType(0);
+//            followDTO.setPictureUrl(pictureUrl);
+//            followDTO.setName(accountName);
+//            followService.add(followDTO);
+
+            WeChatAccountInfoDTO weChatAccountInfoDTO = new WeChatAccountInfoDTO();
+            weChatAccountInfoDTO.setAccountName(accountName);
+            weChatAccountInfoDTO.setFakeId(fakeId);
+            weChatAccountInfoDTO.setPictureUrl(pictureUrl);
+            weChatAccountInfoDTO.setIfCancel(false);
+            weChatAccountInfoService.add(weChatAccountInfoDTO);
+
+            // 按钮的文本设置为 已关注
+            button.setText("已关注");
+        } else {
+            weChatAccountInfoService.cancelFollow(fakeId);
+            button.setText("关注");
+        }
+    }
+}

+ 23 - 0
src/main/java/com/example/mos/handler/GetAllSourceHandler.java

@@ -0,0 +1,23 @@
+package com.example.mos.handler;
+
+import com.example.mos.container.MainView;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/20
+ */
+public class GetAllSourceHandler implements ActionListener {
+    private MainView mainView;
+    public GetAllSourceHandler(MainView mainView) {
+        this.mainView = mainView;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        mainView.openSourcePanel();
+    }
+
+}

+ 23 - 0
src/main/java/com/example/mos/handler/GetArticlesHandler.java

@@ -0,0 +1,23 @@
+package com.example.mos.handler;
+
+import com.example.mos.container.MainView;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/26
+ */
+public class GetArticlesHandler implements ActionListener {
+    private MainView mainView;
+
+    public GetArticlesHandler (MainView mainView ) {
+        this.mainView = mainView;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent actionEvent) {
+        mainView.openArticlePanel();
+    }
+}

+ 153 - 0
src/main/java/com/example/mos/handler/MyButtonEditor.java

@@ -0,0 +1,153 @@
+package com.example.mos.handler;
+
+import com.example.mos.common.model.vo.ArticleDataVO;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.ExportArticleService;
+
+import javax.swing.*;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/3
+ */
+public class MyButtonEditor extends DefaultCellEditor {
+    private static final long serialVersionUID = -6546334664166791132L;
+    private JPanel panel;
+    private JButton button;
+    private JTable table;
+    private List<ArticleDataVO> articles;
+    private int clickCount;// 记录按钮点击次数
+    private final int requiredClicks = 1;// 设置按钮所需的点击次数
+
+    //初始化按钮
+    public MyButtonEditor(JTable tab, List<ArticleDataVO> articles) {
+        super(new JTextField());
+        table = tab;
+        this.articles = articles;
+        initPanel(table);
+        clickCount = 0;
+    }
+
+//    // 初始化按钮和鼠标监听事件
+//    private void initButton(JTable tab) {
+//        this.button = new JButton("编辑摘要");//创建按钮实例
+//        this.table = tab;
+//        System.out.println("table2" + table);
+//        this.button.setBounds(0, 0, 15 ,15);//设置按钮位置和大小
+//
+//        this.button.addMouseListener(new MouseAdapter() {
+//            @Override
+//            public void mouseClicked(MouseEvent e) {
+//                MyButtonEditor.this.fireEditingCanceled(); // 取消编辑状态
+//                int column = table.getColumnModel().getColumnIndex("操作");
+//
+//                int selectedColumn = table.getSelectedColumn();
+//                System.out.println("selectedColumn------" + selectedColumn);
+//                int selectedRow = table.getSelectedRow();
+//
+//                int modelRow = table.convertRowIndexToModel(selectedRow);
+//                System.out.println("modelRow------" + modelRow);
+//
+//                // 判断是否为操作列并执行相应逻辑
+//                if (selectedColumn == column) {
+//                    ArticleDataVO selectArticle = articles.get(modelRow);
+//                    System.out.println(selectArticle.getSource());
+//                    if (selectArticle.getSource().equals(0)) {
+//                        String link = selectArticle.getLink();
+//                        try {
+//                            ExportArticleService exportArticleService = new ExportArticleService();
+//                            byte[] data = exportArticleService.exportToWord(link);
+//                            // 创建一个新文件选择器
+//                            JFileChooser fileChooser = new JFileChooser();
+//                            int returnValue = fileChooser.showSaveDialog(null);
+//                            if (returnValue == JFileChooser.APPROVE_OPTION) {
+//                                File selectedFile = fileChooser.getSelectedFile();
+//                                // 写入 byte[] 数据到选定的文件
+//                                OutputStream os = new FileOutputStream(selectedFile);
+//                                os.write(data);
+//                                os.close();
+//                                JOptionPane.showMessageDialog(null, "文件已成功导出到: " + selectedFile.getAbsolutePath());
+//                            }
+//                        } catch (Exception exception) {
+//                            exception.printStackTrace();
+//                        }
+//                    }
+//                }
+//            }
+//        });
+//    }
+
+    // 初始化面板
+    private void initPanel(JTable tab) {
+        panel = new JPanel(new BorderLayout());
+        button = new JButton("编辑摘要");//创建按钮实例
+        table = tab;
+        button.setHorizontalAlignment(SwingConstants.CENTER);
+        panel.add(button, BorderLayout.CENTER);
+        button.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                clickCount++;
+                if (clickCount == requiredClicks) {
+                    int column = table.getColumnModel().getColumnIndex("操作");
+
+                    int selectedColumn = table.getSelectedColumn();
+                    System.out.println("selectedColumn------" + selectedColumn);
+                    int selectedRow = table.getSelectedRow();
+
+                    int modelRow = table.convertRowIndexToModel(selectedRow);
+                    System.out.println("modelRow------" + modelRow);
+
+                    // 判断是否为操作列并执行相应逻辑
+                    if (selectedColumn == column) {
+                        ArticleDataVO selectArticle = articles.get(modelRow);
+                        JTextArea textArea = new JTextArea(selectArticle.getAbs()); // 创建文本区域
+                        JScrollPane scrollPane = new JScrollPane(textArea); // 将文本区域放入滚动面板
+
+                        // 设置对话框宽度和高度
+                        Dimension size = new Dimension(400, 200);
+                        scrollPane.setPreferredSize(size);
+
+                        JOptionPane optionPane = new JOptionPane(scrollPane, JOptionPane.PLAIN_MESSAGE,
+                                JOptionPane.OK_CANCEL_OPTION);
+
+                        JDialog dialog = optionPane.createDialog("编辑摘要");
+                        dialog.setVisible(true);
+
+                        // 确认对话框按钮被选择
+                        if (optionPane.getValue() != null && (Integer) optionPane.getValue() == JOptionPane.OK_OPTION) {
+                            String editedText = textArea.getText();
+                            selectArticle.setAbs(editedText);
+                            ArticleInfoService articleInfoService = new ArticleInfoService();
+                            articleInfoService.updateInfo(selectArticle);
+                        }
+                        clickCount = 0;
+                    }
+                }
+            }
+        });
+    }
+
+    // 获取用于编辑的组件
+    @Override
+    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
+        return panel; // 返回面板作为编辑组件
+    }
+
+    // 获取单元格编辑器的值
+    @Override
+    public Object getCellEditorValue() {
+        return this.button.getText(); // 返回按钮文本作为值
+    }
+}

+ 39 - 0
src/main/java/com/example/mos/handler/MyButtonRender.java

@@ -0,0 +1,39 @@
+package com.example.mos.handler;
+
+import javax.swing.*;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/3
+ */
+public class MyButtonRender implements TableCellRenderer {
+    private JPanel panel;
+    private JButton button;
+
+    public MyButtonRender() {
+//        this.initButton();
+        initPanel();
+//        this.panel.add(this.button);
+    }
+
+    private void initButton() {
+        button = new JButton("编辑摘要");
+        button.setHorizontalAlignment(SwingConstants.CENTER);
+        button.setMargin(new Insets(0, 5, 0, 5)); // 设置按钮内边距,调整按钮大小
+//        this.button.setBounds(0, 0, 50, 15);
+    }
+
+    private void initPanel() {
+        panel = new JPanel(new BorderLayout());
+        button = new JButton("编辑摘要");
+        button.setHorizontalAlignment(SwingConstants.CENTER);
+        panel.add(button, BorderLayout.CENTER);
+    }
+
+    @Override
+    public Component getTableCellRendererComponent(JTable jTable, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+        return button;
+    }
+}

+ 11 - 0
src/main/java/com/example/mos/handler/MyEvent.java

@@ -0,0 +1,11 @@
+package com.example.mos.handler;
+
+import java.awt.event.ActionEvent;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/3
+ */
+public abstract class MyEvent {
+    public abstract void invoke(ActionEvent e);
+}

+ 23 - 0
src/main/java/com/example/mos/handler/OpenSearchPanelHandler.java

@@ -0,0 +1,23 @@
+package com.example.mos.handler;
+
+import com.example.mos.container.MainView;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/20
+ */
+public class OpenSearchPanelHandler implements ActionListener {
+    private MainView mainView;
+    public OpenSearchPanelHandler (MainView mainView) {
+        this.mainView = mainView;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        mainView.openSearchPanel();
+    }
+
+}

+ 37 - 0
src/main/java/com/example/mos/handler/SaveFileData.java

@@ -0,0 +1,37 @@
+package com.example.mos.handler;
+
+import javax.swing.*;
+import javax.swing.filechooser.FileNameExtensionFilter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/3
+ */
+public class SaveFileData {
+
+    public void saveExportData(byte[] exportData) {
+        JFileChooser fileChooser = new JFileChooser();
+        FileNameExtensionFilter filter = new FileNameExtensionFilter("Custom File Format", "dat");
+        fileChooser.setFileFilter(filter);
+
+        int returnValue = fileChooser.showSaveDialog(null);
+
+        if (returnValue == JFileChooser.APPROVE_OPTION) {
+            File selectedFile = fileChooser.getSelectedFile();
+
+            try {
+                FileOutputStream fos = new FileOutputStream(selectedFile);
+                fos.write(exportData);
+                fos.close();
+
+                JOptionPane.showMessageDialog(null, "导出数据成功保存到: " + selectedFile.getAbsolutePath());
+            } catch (IOException e) {
+                e.printStackTrace();
+                JOptionPane.showMessageDialog(null, "保存文件时出现错误");
+            }
+        }
+    }
+}

+ 124 - 0
src/main/java/com/example/mos/handler/SearchWeChatAccountHandler.java

@@ -0,0 +1,124 @@
+package com.example.mos.handler;
+
+import com.example.mos.common.model.vo.OfficalAccountReVO.AccountNameVO;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.FollowService;
+import com.example.mos.service.WeChatAccountInfoService;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/20
+ */
+public class SearchWeChatAccountHandler extends JFrame implements ActionListener {
+    private JPanel mainPanel;
+    private JTextField searchField;
+    private JTextPane resultPane;
+    private FollowAccountHandler followAccountHandler;
+
+    public SearchWeChatAccountHandler(JPanel mainPanel, JTextField searchField, JTextPane resultPane) {
+        this.mainPanel = mainPanel;
+        this.searchField = searchField;
+        this.resultPane = resultPane;
+        this.resultPane.setEditable(false);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+
+        String searchContent = searchField.getText();
+        // 模拟调用后端检索API并获取数据
+        List<AccountNameVO> accountNameVOS = queryWeChatAccount(searchContent);
+        // 将返回的数据显示在文本框下方
+        displayVOS(resultPane, accountNameVOS);
+    }
+
+    /**
+     * 调用后端检索API
+     */
+    public List<AccountNameVO> queryWeChatAccount(String searchContent) {
+        List<AccountNameVO> accountNameVOS = new ArrayList<>();
+        try {
+            ArticleInfoService articleInfoService = new ArticleInfoService();
+            WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+            accountNameVOS = weChatAccountInfoService.queryWeiXinAccountName(searchContent);
+        } catch (Exception e) {
+            System.out.println(e);
+        }
+        // 实现调用后端检索API的逻辑,并返回结果字符串
+        return accountNameVOS;
+    }
+
+    private void displayVOS(JTextPane resultPane, List<AccountNameVO> accountNameVOS) {
+        resultPane.setText("");
+        if (!accountNameVOS.isEmpty()) {
+            JPanel rePanel = new JPanel(new GridLayout(accountNameVOS.size(), 3));
+            for (AccountNameVO accountNameVO : accountNameVOS) {
+                //创建小面板来容纳图片、字符串和按钮
+                try {
+                    //创建并设置图片
+                    URL imageUrl = new URL(accountNameVO.getPictureUrl()); // 将图片链接转换为URL对象
+                    ImageIcon imageIcon = new ImageIcon(imageUrl); // 通过URL对象创建ImageIcon
+                    imageIcon.setImage(imageIcon.getImage().getScaledInstance(60,60,Image.SCALE_DEFAULT));
+                    JLabel imageLabel = new JLabel(imageIcon);
+                    rePanel.add(imageLabel);
+                } catch (MalformedURLException ex) {
+                    System.out.println("Invalid URL: " + accountNameVO.getPictureUrl());
+                }
+
+                //创建并设置名称
+                JLabel textLabel = new JLabel(accountNameVO.getAccountName());
+                Font font = new Font("SimSun", Font.BOLD, 20);
+                textLabel.setFont(font);
+                textLabel.setHorizontalAlignment(SwingConstants.CENTER);
+                rePanel.add(textLabel);
+                ArticleInfoService articleInfoService = new ArticleInfoService();
+                WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+                String fakeId = accountNameVO.getFakeId();
+                boolean isExist = weChatAccountInfoService.isExist(fakeId);
+                if (!isExist) {
+                    //创建并设置按钮
+                    JButton followButton = new JButton("关注");
+                    followButton.setPreferredSize(new Dimension(30, 30));
+                    followButton.setContentAreaFilled(false);
+                    followButton.setBorderPainted(false);
+                    rePanel.add(followButton);
+                    // 为按钮添加点击事件
+//                    ArticleInfoService articleInfoService = new ArticleInfoService();
+//                    WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+                    followAccountHandler = new FollowAccountHandler(accountNameVO, weChatAccountInfoService);
+                    followButton.addActionListener(followAccountHandler);
+                } else {
+                    JButton followButton = new JButton("已关注");
+                    followButton.setPreferredSize(new Dimension(30, 30));
+                    followButton.setContentAreaFilled(false);
+                    followButton.setBorderPainted(false);
+                    rePanel.add(followButton);
+                    // 为按钮添加点击事件
+//                    ArticleInfoService articleInfoService = new ArticleInfoService();
+//                    WeChatAccountInfoService weChatAccountInfoService = new WeChatAccountInfoService(articleInfoService);
+                    followAccountHandler = new FollowAccountHandler(accountNameVO, weChatAccountInfoService);
+                    followButton.addActionListener(followAccountHandler);
+                }
+            }
+            rePanel.revalidate();
+            rePanel.repaint();
+            resultPane.insertComponent(rePanel);
+        }
+        // 添加JTextPane到mainView的CENTER位置
+        mainPanel.add(resultPane, BorderLayout.CENTER);
+
+        // 更新UI以确保内容立即可见
+        mainPanel.revalidate();
+        mainPanel.repaint();
+    }
+
+}

+ 108 - 0
src/main/java/com/example/mos/handler/WeChatLoginHandler.java

@@ -0,0 +1,108 @@
+package com.example.mos.handler;
+
+import com.example.mos.weChatLogin.api.WeiXinApi;
+import com.example.mos.weChatLogin.awt.MyImageShowFrame;
+import com.example.mos.weChatLogin.model.WxResultBody;
+import com.example.mos.weChatLogin.okhttp.MyCookieStore;
+import com.example.mos.weChatLogin.utils.HttpUtils;
+
+import javax.swing.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.concurrent.*;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/31
+ */
+public class WeChatLoginHandler {
+
+    public void weChatLogin() throws IOException, ExecutionException, TimeoutException {
+        //图片显示控件
+        MyImageShowFrame myImageShowFrame = new MyImageShowFrame();
+        // 1. POST请求开始登录接口,初始化cookie
+        String sessionid = "" + System.currentTimeMillis() + (int)(Math.random()*100); //生成一个包含当前时间戳以及随机数的字符串
+        WxResultBody wxResultBody = WeiXinApi.startLogin(sessionid);
+        System.out.println("---请求开始登录接口 返回结果:" + wxResultBody.toString());
+        // 2. 请求获取二维码图片接口,得到流
+        InputStream qrCodeIs = WeiXinApi.getQRCode();
+        //转成图片显示
+        myImageShowFrame.setTitle("请使用微信扫码登录微信公众平台");
+        myImageShowFrame.showImage(qrCodeIs);
+        myImageShowFrame.setLocation(500,100);
+        SwingUtilities.invokeLater(() -> {
+            // 3.轮询二维码状态接口
+            FutureTask<Integer> futureTask = new FutureTask<>(new Callable<Integer>() {
+                @Override
+                public Integer call() throws Exception {
+                    while (true) {
+                        WxResultBody askQRCode = WeiXinApi.askQRCode();
+                        Integer status = askQRCode.getStatus();
+                        if (status == 3) {
+                            System.out.println("二维码已过期");
+                            return 3;
+                        } else if (status == 4) {
+                            System.out.println("已扫码,等待确认");
+                        } else if (status == 1) {
+                            System.out.println("已确认登录,请稍后...");
+                            return 1;
+                        }
+                        try {
+                            Thread.sleep(1000);// 线程休眠一秒
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            });
+            while (true) {
+                //创建一个新的线程 将FutureTask对象作为参数传递给这个线程
+                Thread queryThread = new Thread(futureTask);
+                queryThread.start();
+
+                if (!futureTask.isDone()) {
+                    System.out.println("--正在查询扫码状态,请尽快扫码!");
+                }
+
+                try {
+                    Integer integer = futureTask.get();
+                    if (integer == 1) {
+                        //说明扫码确认成功,否则重新获取图片
+                        //关闭图片显示
+                        SwingUtilities.invokeLater(() -> {
+                            // 关闭图片显示等操作
+                            myImageShowFrame.close();
+                        });
+                        break;
+                    } else {
+                        SwingUtilities.invokeLater(() -> {
+                            // 重新获取二维码图片显示等操作
+                            try {
+                                myImageShowFrame.showImage(WeiXinApi.getQRCode());
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                        });
+                    }
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    break;
+                }
+            }
+            // 4.确认登录后,请求登录接口,拿到登录状态的cookie
+            WxResultBody bizlogin = WeiXinApi.bizlogin();
+            //重定向地址
+            String redirect_url = bizlogin.getRedirect_url();
+            //解析成键值对
+            Map<String, String> loginRes = HttpUtils.parseQueryParams(redirect_url);
+            //得到token
+            String token = loginRes.get("token");
+            //设置全局token值
+            MyCookieStore.setToken(token);
+            System.out.println("---login success!");
+        });
+    }
+
+}

+ 16 - 0
src/main/java/com/example/mos/mapper/ArticleInfoMapper.java

@@ -0,0 +1,16 @@
+package com.example.mos.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.mos.domain.ArticleInfo;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Repository
+public interface ArticleInfoMapper extends BaseMapper<ArticleInfo> {
+    List<ArticleInfo> selectList();
+}

+ 14 - 0
src/main/java/com/example/mos/mapper/FollowMapper.java

@@ -0,0 +1,14 @@
+package com.example.mos.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.mos.domain.Follow;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/3
+ */
+@Repository
+public interface FollowMapper extends BaseMapper<Follow> {
+}

+ 18 - 0
src/main/java/com/example/mos/mapper/QuartzTaskMapper.java

@@ -0,0 +1,18 @@
+package com.example.mos.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.mos.domain.QuartzTask;
+
+/**
+* @author admin
+* @description 针对表【quartz_task(定时任务)】的数据库操作Mapper
+* @createDate 2024-05-06 13:58:36
+* @Entity xiaoshiweixinback.domain.QuartzTask
+*/
+public interface QuartzTaskMapper extends BaseMapper<QuartzTask> {
+
+}
+
+
+
+

+ 13 - 0
src/main/java/com/example/mos/mapper/WeChatAccountInfoMapper.java

@@ -0,0 +1,13 @@
+package com.example.mos.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.mos.domain.WeChatAccountInfo;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/25
+ */
+@Repository
+public interface WeChatAccountInfoMapper extends BaseMapper<WeChatAccountInfo> {
+}

+ 13 - 0
src/main/java/com/example/mos/mapper/WebInfoMapper.java

@@ -0,0 +1,13 @@
+package com.example.mos.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.mos.domain.WebInfo;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/26
+ */
+@Repository
+public interface WebInfoMapper extends BaseMapper<WebInfo> {
+}

+ 136 - 0
src/main/java/com/example/mos/service/ArticleInfoService.java

@@ -0,0 +1,136 @@
+package com.example.mos.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.common.model.vo.ArticleDataVO;
+import com.example.mos.common.utils.DBUtil;
+import com.example.mos.domain.ArticleInfo;
+import com.example.mos.mapper.ArticleInfoMapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/4
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class ArticleInfoService extends ServiceImpl<ArticleInfoMapper, ArticleInfo> {
+
+    public List<Integer> addArticles(List<ArticleInfoDTO> articleInfoDTOS) {
+        List<Integer> ids = new ArrayList<>();
+        if (articleInfoDTOS != null && !articleInfoDTOS.isEmpty()) {
+            List<ArticleInfo> articleInfos = new ArrayList<>();
+            for (ArticleInfoDTO articleInfoDTO : articleInfoDTOS) {
+                String title = articleInfoDTO.getTitle();
+                if (!isArticleExists(title)) {
+                    ArticleInfo articleInfo = new ArticleInfo();
+                    BeanUtils.copyProperties(articleInfoDTO, articleInfo);
+                    articleInfos.add(articleInfo);
+                }
+            }
+            if (!articleInfos.isEmpty()) {
+                this.saveBatch(articleInfos);
+                ids = articleInfos.stream().map(ArticleInfo::getId).collect(Collectors.toList());
+            }
+        }
+        return ids;
+    }
+
+//    public List<Integer> addArticles(List<ArticleInfoDTO> articleInfoDTOS) {
+//        // 构建要保存的 ArticleInfo 列表
+//        List<ArticleInfo> articleInfos = articleInfoDTOS.stream()
+//                .filter(articleInfoDTO -> !isArticleExists(articleInfoDTO.getTitle()))
+//                .map(articleInfoDTO -> {
+//                    ArticleInfo articleInfo = new ArticleInfo();
+//                    BeanUtils.copyProperties(articleInfoDTO, articleInfo);
+//                    return articleInfo;
+//                })
+//                .collect(Collectors.toList());
+//
+//        if (!articleInfos.isEmpty()) {
+//            this.saveBatch(articleInfos); // 批量保存 ArticleInfo 实体
+//        }
+//
+//        return articleInfos.stream().map(ArticleInfo::getId).collect(Collectors.toList());
+//    }
+
+    private boolean isArticleExists(String title) {
+        // 添加查询数据库检查是否已存在相同数据的逻辑,返回 true 表示已存在,false 表示不存在
+        // 这里假设是 ArticleService 中的一个方法来检查文章是否已经存在
+        LambdaQueryWrapper<ArticleInfo> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(ArticleInfo::getTitle, title);
+        // 假设 articleInfoMapper 是 MyBatis Mapper 接口类用于数据库查询
+        long count = this.count(queryWrapper);
+        return count > 0;
+    }
+
+    public List<ArticleDataVO> getArticles() {
+        List<ArticleDataVO> articleDataVOS = new ArrayList<>();
+        String sql = "SELECT ai.id, ai.title, ai.link, ai.source, ai.fake_id, ai.publish_time, ai.create_time, ai.abs, ai.classify, CONCAT(IFNULL(a.account_name, ''), IFNULL(b.web_name, '')) AS fakeName FROM article_info ai LEFT JOIN wechat_account_info a ON ai.fake_id = a.fake_id LEFT JOIN web_info b ON ai.fake_id = b.id";
+        Connection conn = null;
+        PreparedStatement ps = null;
+        try {
+            conn = DBUtil.getConn();
+            ps = conn.prepareStatement(sql);
+            ResultSet resultSet = ps.executeQuery();
+            while (resultSet.next()) {
+                ArticleDataVO articleDataVO = new ArticleDataVO();
+                articleDataVO.setId(resultSet.getInt("id"));
+                articleDataVO.setTitle(resultSet.getString("title"));
+                articleDataVO.setLink(resultSet.getString("link"));
+                articleDataVO.setSource(resultSet.getInt("source"));
+                articleDataVO.setCameFrom(resultSet.getString("fakeName"));
+                articleDataVO.setTime(resultSet.getDate("publish_time"));
+                articleDataVO.setCreateTime(resultSet.getDate("create_time"));
+                articleDataVO.setAbs(resultSet.getString("abs"));
+                articleDataVO.setClassify(resultSet.getInt("classify"));
+                articleDataVOS.add(articleDataVO);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            DBUtil.closeConn(conn);
+            DBUtil.closePs(ps);
+        }
+        return articleDataVOS;
+    }
+
+    //更新
+    public void updateInfo(ArticleDataVO articleDataVO) {
+        Connection conn = null;
+        PreparedStatement ps = null;
+
+        try {
+            conn = DBUtil.getConn();
+
+            // 更新 article_info 表中对应 ID 的文章信息
+            String sql = "UPDATE article_info SET abs=? , classify=? WHERE id=?";
+            ps = conn.prepareStatement(sql);
+
+            // 设置要更新的字段值
+            ps.setString(1, articleDataVO.getAbs());
+            ps.setInt(2, articleDataVO.getClassify());
+            ps.setInt(3, articleDataVO.getId());
+            // 执行更新
+            ps.executeUpdate();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            DBUtil.closeConn(conn);
+            DBUtil.closePs(ps);
+        }
+    }
+}

+ 111 - 0
src/main/java/com/example/mos/service/ExportArticleService.java

@@ -0,0 +1,111 @@
+package com.example.mos.service;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.util.StringUtil;
+import org.apache.poi.util.Units;
+import org.apache.poi.xwpf.usermodel.*;
+import org.jsoup.nodes.Document;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Element;
+import org.jsoup.nodes.Node;
+import org.jsoup.nodes.TextNode;
+import org.jsoup.select.Elements;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Service;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/7/1
+ */
+@Service
+@Slf4j
+public class ExportArticleService {
+
+    public byte[] exportToWord(String link) throws IOException {
+        try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
+            XWPFDocument docx = processDocument(link);
+            docx.write(outputStream); // 将文档写入到输出流中
+            return outputStream.toByteArray(); // 返回输出流的字节数组
+        } catch (FileNotFoundException e) {
+            throw new FileNotFoundException();
+        }
+    }
+
+    private XWPFDocument processDocument(String link) throws IOException {
+        Document doc = Jsoup.connect(link).get();  // 使用 connect 方法获取网页内容
+        Elements paragraphs = doc.select("p");
+
+        XWPFDocument docx = new XWPFDocument();
+        XWPFParagraph paragraph;
+        XWPFRun run;
+        for (Element element : paragraphs) {
+            String text = element.text();
+
+            if (element.getElementsByTag("a").isEmpty()) {
+                paragraph = docx.createParagraph();
+                run = paragraph.createRun();
+                run.setText(text);
+            } else {
+                String href = element.getElementsByTag("a").attr("href");
+                paragraph = docx.createParagraph();
+                run = paragraph.createRun();
+                run.setText(text);
+                run.setColor("0000FF"); // 设置蓝色
+                run.setUnderline(UnderlinePatterns.SINGLE); // 设置下划线
+
+                XWPFHyperlinkRun xwpfHyperlink = paragraph.createHyperlinkRun(href);
+                xwpfHyperlink.setText(text);
+            }
+        }
+
+        Elements images = doc.select("img");
+        for (Element image : images) {
+            String imageUrl = image.hasAttr("src") ? image.attr("src") : image.attr("data-src");
+            if(imageUrl.startsWith("http")) {
+                // 如果图片链接是通过网络获取的,请使用网络请求来获取输入流
+                try (InputStream inputStream = new URL(imageUrl).openStream()) {
+                    XWPFParagraph imagePara = docx.createParagraph();
+                    imagePara.setAlignment(ParagraphAlignment.CENTER);
+                    XWPFRun run2 = imagePara.createRun();
+                    int width = 200; // 图片宽度
+                    int height = 200; // 图片高度
+                    run2.addPicture(inputStream, XWPFDocument.PICTURE_TYPE_JPEG, "image.jpg", Units.toEMU(width), Units.toEMU(height));
+                } catch (MalformedURLException e) {
+                    e.printStackTrace();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                } catch (InvalidFormatException e) {
+                    e.printStackTrace();
+                }
+            } else {
+                if (imageUrl != null && !imageUrl.isEmpty()) {
+                    // 如果图片是本地路径,则直接读取本地文件
+                    try (FileInputStream imageStream = new FileInputStream(imageUrl)) {
+                        XWPFParagraph imagePara = docx.createParagraph();
+                        imagePara.setAlignment(ParagraphAlignment.CENTER);
+                        XWPFRun run2 = imagePara.createRun();
+                        int width = 200; // 图片宽度
+                        int height = 200; // 图片高度
+                        run2.addPicture(imageStream, XWPFDocument.PICTURE_TYPE_JPEG, "image.jpg", Units.toEMU(width), Units.toEMU(height));
+                    } catch (IOException | InvalidFormatException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        return docx;
+    }
+}

+ 159 - 0
src/main/java/com/example/mos/service/ExportToWordService.java

@@ -0,0 +1,159 @@
+package com.example.mos.service;
+
+import com.example.mos.common.model.vo.ArticleDataVO;
+import org.apache.poi.xwpf.usermodel.*;
+
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/8/13
+ */
+public class ExportToWordService {
+
+
+    public byte[] exprotArticlesToWord(List<ArticleDataVO> articles) throws IOException {
+        try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
+            XWPFDocument docx = processDocument(articles);
+            docx.write(outputStream); // 将文档写入到输出流中
+            return outputStream.toByteArray(); // 返回输出流的字节数组
+        } catch (FileNotFoundException e) {
+            throw new FileNotFoundException();
+        }
+    }
+
+    private XWPFDocument processDocument(List<ArticleDataVO> articles) {
+        XWPFDocument document = new XWPFDocument();
+
+        // 创建用于存储分类数据的map
+        Map<Integer, List<ArticleDataVO>> classifiedArticlesMap = new HashMap<>();
+        for (ArticleDataVO article : articles) {
+            int classify = article.getClassify();
+            if (!classifiedArticlesMap.containsKey(classify)) {
+                classifiedArticlesMap.put(classify, new ArrayList<>());
+            }
+            classifiedArticlesMap.get(classify).add(article);
+        }
+
+        // 遍历分类后的map进行绘制操作
+        for (Map.Entry<Integer, List<ArticleDataVO>> entry : classifiedArticlesMap.entrySet()) {
+            int classify = entry.getKey();
+            List<ArticleDataVO> classifiedArticles = entry.getValue();
+            // 绘制该分类下的文章
+            XWPFParagraph categoryTitle = document.createParagraph();
+            XWPFRun categoryRun = categoryTitle.createRun();
+            categoryRun.setBold(true);
+            categoryRun.setColor("FF0000"); // 红色
+            categoryRun.setFontFamily("楷体");
+            categoryRun.setFontSize(16);
+            String categoryName = getCategoryNameFromClassify(classify); // 根据 classify 获取分类名称
+            categoryRun.setText(categoryName);
+
+            categoryRun.addBreak();
+
+            for (int i = 0; i < classifiedArticles.size(); i++) {
+                ArticleDataVO article = classifiedArticles.get(i);
+                XWPFParagraph paragraph = document.createParagraph();
+                XWPFRun run = paragraph.createRun();
+
+                // 设置字体样式为宋体四号
+                run.setFontFamily("楷体");
+                run.setFontSize(13);
+
+                XWPFRun titleRun = paragraph.createRun();
+                titleRun.setBold(true);
+                titleRun.setFontFamily("楷体");
+                titleRun.setFontSize(13);
+                titleRun.setText((i + 1) + "、" + article.getTitle());
+                titleRun.addBreak();
+
+                XWPFRun absRun = paragraph.createRun();
+                absRun.addTab();
+                absRun.setText(article.getAbs());
+                absRun.setFontFamily("宋体");
+                absRun.setFontSize(13);
+                absRun.addBreak();
+
+                // 添加超链接
+                String link = article.getLink();
+                if (link != null && !link.trim().isEmpty()) {
+                    XWPFHyperlinkRun hyperlinkRun = run.getParagraph().createHyperlinkRun(link);
+                    run.addTab();
+                    hyperlinkRun.setFontSize(13);
+                    hyperlinkRun.setColor("0000FF");
+                    hyperlinkRun.setUnderline(UnderlinePatterns.SINGLE);
+                    hyperlinkRun.setText(link);
+                }
+
+                run.addBreak();
+            }
+        }
+
+//        for(int i = 0; i < articles.size(); i++) {
+//            ArticleDataVO article = articles.get(i);
+//            XWPFParagraph paragraph = document.createParagraph();
+//            XWPFRun run = paragraph.createRun();
+//
+//            // 设置字体样式为宋体四号
+//            run.setFontFamily("宋体");
+//            run.setFontSize(13);
+//
+//            // 将标题设为加粗
+//            XWPFRun titleRun = paragraph.createRun();
+//            titleRun.setBold(true); // 设置标题加粗
+//            titleRun.setFontFamily("宋体");
+//            titleRun.setFontSize(13);
+//            titleRun.setText((i + 1) + "、" + article.getTitle());
+//            titleRun.addBreak();
+//
+//            // 摘要
+//            XWPFRun absRun = paragraph.createRun();
+//            absRun.addTab();
+//            absRun.setText(article.getAbs());
+//            absRun.setFontFamily("宋体");
+//            absRun.setFontSize(13);
+//            absRun.addBreak();
+//
+//            // 为链接字段添加超链接功能
+//            String link = article.getLink();
+//            if (link != null && !link.trim().isEmpty()) {
+//                XWPFHyperlinkRun hyperlinkRun = run.getParagraph().createHyperlinkRun(link);
+//                run.addTab();
+//                hyperlinkRun.setFontSize(13);
+//                hyperlinkRun.setColor("0000FF"); // 设置超链接颜色为蓝色
+//                hyperlinkRun.setUnderline(UnderlinePatterns.SINGLE); // 设置下划线
+//                hyperlinkRun.setText(link);
+//            }
+//
+//            run.addBreak();
+//        }
+
+        return document;
+    }
+
+    // 根据 classify 值获取相应的分类名称(可根据实际情况扩展)
+    private String getCategoryNameFromClassify(int classify) {
+        switch (classify) {
+            case 1:
+                return "一 国家知识产权局";
+            case 2:
+                return "二 地方法规及规章";
+            case 3:
+                return "三 地方标准";
+            case 4:
+                return "四 判例";
+            case 5:
+                return "五 国外相关资讯";
+            case 6:
+                return "六 行业资讯";
+            default:
+                return "";
+        }
+    }
+}

+ 65 - 0
src/main/java/com/example/mos/service/FollowService.java

@@ -0,0 +1,65 @@
+package com.example.mos.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.mos.common.model.dto.FollowDTO;
+import com.example.mos.common.model.dto.WeChatAccountInfoDTO;
+import com.example.mos.common.utils.DBUtil;
+import com.example.mos.domain.ArticleInfo;
+import com.example.mos.domain.Follow;
+import com.example.mos.mapper.FollowMapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/3
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class FollowService extends ServiceImpl<FollowMapper, Follow> {
+
+    public Integer add(FollowDTO followDTO){
+        Follow follow = new Follow();
+        BeanUtils.copyProperties(followDTO, follow);
+        follow.insert();
+        return follow.getId();
+    }
+
+    public boolean isExist(String fakeId){
+        String sql = "SELECT CASE WHEN COUNT(*) > 0 THEN 'true' ELSE 'false' END AS result FROM follow_account WHERE follow_id LIKE ?";
+        Connection conn = null;
+        PreparedStatement ps = null;
+        boolean exist = false;
+        try {
+            conn = DBUtil.getConn();
+            ps = conn.prepareStatement(sql);
+            ps.setString(1, "%" + fakeId + "%");
+            ResultSet resultSet = ps.executeQuery();
+            while (resultSet.next()) {
+                String result = resultSet.getString("result");
+                if (result.equals("true")) {
+                    exist = true;
+                    break;
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            DBUtil.closeConn(conn);
+            DBUtil.closePs(ps);
+        }
+        return exist;
+    }
+
+    
+}

+ 100 - 0
src/main/java/com/example/mos/service/GetWebArticle/Cnipr/GetPPHArticleService.java

@@ -0,0 +1,100 @@
+package com.example.mos.service.GetWebArticle.Cnipr;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.XmlParseService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 国家知识产权局
+ * @Author xiexiang
+ * @Date 2024/7/12
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetPPHArticleService {
+    private final ArticleInfoService articleInfoService;
+    private final XmlParseService xmlParseService;
+
+    public void getPPH(){
+        Map<String , String> urlMap = new HashMap<>();
+        // 首页 - 专题 - 专利审查高速路(PPH)专栏 - 通知  669
+        urlMap.put("https://www.cnipa.gov.cn/col/col340/index.html", "669");
+        // 政务 - 政策文件 - 公告   485
+        urlMap.put("https://www.cnipa.gov.cn/col/col74/index.html", "485");
+        // 政务 - 政策文件 - 通知   485
+        urlMap.put("https://www.cnipa.gov.cn/col/col75/index.html", "485");
+        // 新闻 - 局要闻
+        urlMap.put("https://www.cnipa.gov.cn/col/col53/index.html", "669");
+        // 新闻 - 地方动态 - 动态信息
+        urlMap.put("https://www.cnipa.gov.cn/col/col57/index.html", "485");
+
+        for (Map.Entry<String, String> entry : urlMap.entrySet()) {
+            String url = entry.getKey();
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity());
+                httpClient.close();
+                if (responseBody != null) {
+                    String key = entry.getValue();
+                    this.readJson(key, responseBody);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public void readJson(String key, String responseBody) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+            //使用JSoup解析HTML
+            Document doc = Jsoup.parse(responseBody);
+            Element div = doc.getElementById(key);
+            Element scriptElement = div.select("script").first();
+            String contentText = scriptElement.html();
+            List<String> reStrs = xmlParseService.xmlParse(contentText, "record");
+            for (String reStr : reStrs) {
+                Document document = Jsoup.parse(reStr);
+                Element linkElement = document.getElementsByTag("a").first();
+                String link = linkElement.attr("href");
+                String title = linkElement.text();
+                String dateStr = document.getElementsByTag("span").text().trim();
+                Date date = new Date();
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                try {
+                    date = dateFormat.parse(dateStr);
+                } catch (ParseException e) {
+                    System.out.println(dateStr);
+                }
+                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                articleInfoDTO.setSource(1);
+                articleInfoDTO.setLink(link);
+                articleInfoDTO.setTitle(title);
+                articleInfoDTO.setFakeId("3");
+                articleInfoDTO.setTime(date);
+                articleInfoDTOS.add(articleInfoDTO);
+            }
+            articleInfoService.addArticles(articleInfoDTOS);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 106 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetBeiJingArticleService.java

@@ -0,0 +1,106 @@
+package com.example.mos.service.GetWebArticle;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 北京市知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetBeiJingArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getBeiJing() {
+        String responseStr = "success";
+        String url = "https://zscqj.beijing.gov.cn/zscqj/zwgk/tzgg/index.html";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            HttpGet request = new HttpGet(url);
+            request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+            request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+
+            HttpResponse response = httpClient.execute(request);
+            String responseBody = EntityUtils.toString(response.getEntity());
+            httpClient.close();
+            if (responseBody != null) {
+                this.readJson(responseBody);
+                responseStr = responseBody;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void readJson(String responseBody) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+
+            // 解析包含 JSON 数据的 <abbr> 标签
+            Document doc = Jsoup.parse(responseBody);
+            Element abbrElement = doc.getElementById("json");
+            if (abbrElement != null) {
+                String jsonContent = abbrElement.text();
+                JSONArray jsonArray = new JSONArray(jsonContent);
+
+                // 遍历 JSON 数组以提取所需信息
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    JSONObject jsonObject = jsonArray.getJSONObject(i);
+                    String title = jsonObject.getStr("title");
+                    String time = jsonObject.getStr("time");
+                    String url = jsonObject.getStr("url");
+
+                    if (!time.isEmpty() && !url.isEmpty()) {
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date date = new Date();
+                        if (!time.isEmpty()) {
+                            try {
+                                date = dateFormat.parse(time);
+                            } catch (ParseException e) {
+                                System.out.println("time parse error");
+                                continue;
+                            }
+                        }
+                        ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                        articleInfoDTO.setTitle(title);
+                        articleInfoDTO.setLink(url);
+                        articleInfoDTO.setTime(date);
+                        articleInfoDTO.setFakeId("6");
+                        articleInfoDTO.setSource(1);
+                        // 添加到列表
+                        articleInfoDTOList.add(articleInfoDTO);
+                    }
+                }
+                // 将提取的信息添加到数据库或进行其他操作
+                articleInfoService.addArticles(articleInfoDTOList);
+            } else {
+                System.out.println("No valid JSON data found in the HTML content");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 113 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetChongQingArticleService.java

@@ -0,0 +1,113 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 重庆市知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetChongQingArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getChongQing() {
+        String responseStr = "success";
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        urls.add("https://zscqj.cq.gov.cn/zwxx_232/tzgg/");
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                responseStr = responseBody;
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                // 解析包含 JSON 数据的 <abbr> 标签
+                Document doc = Jsoup.parse(responseBody);
+                Elements liElements = doc.select("div.gl-con.rt ul.gl-list li");
+                if (liElements != null && !liElements.isEmpty()) {
+                    for (Element li : liElements) {
+                        String title = li.select("a").attr("title");
+                        String url = li.select("a").attr("href");
+                        String time = li.select("span").text();
+                        if (!time.isEmpty() && !url.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!time.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(time);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            if (url.contains("https")) {
+                                articleInfoDTO.setLink(url);
+                            } else {
+                                articleInfoDTO.setLink("https://zscqj.cq.gov.cn/zwxx_232/tzgg/" + url.substring(2));
+                            }
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("8");
+                            articleInfoDTO.setSource(1);
+                            // 添加到列表
+                            articleInfoDTOList.add(articleInfoDTO);
+
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 118 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetGuangDongArticleService.java

@@ -0,0 +1,118 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 广东省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetGuangDongArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getGuangDong() {
+        String responseStr = "success";
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        // 新闻动态
+        urls.add("https://www.gippc.com.cn/ippc/xwdt/common_list.shtml");
+        // 通知公告
+        urls.add("https://www.gippc.com.cn/ippc/tzgg/common_list.shtml");
+        // 政策法规
+        urls.add("https://www.gippc.com.cn/ippc/zcfg/common_list.shtml");
+
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(),  StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                responseStr = responseBodies.get(0);
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                Document doc = Jsoup.parse(responseBody);
+                Elements newsItems = doc.select(".list_div .news_list li");
+                if (newsItems != null && !newsItems.isEmpty()) {
+                    for (Element item : newsItems) {
+                        Element link = item.select("a").first();
+                        Element time = item.select(".time").first();
+
+                        if (link != null && time != null) {
+                            String href = link.attr("href");
+                            String text = link.text();
+                            String timestamp = time.text().trim();
+
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                Date date = new Date();
+                                if (!timestamp.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(timestamp);
+                                    } catch (ParseException e) {
+                                        System.out.println("time parse error");
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(text);
+                                articleInfoDTO.setLink("https://www.gippc.com.cn" + href);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("13");
+                                articleInfoDTO.setSource(1);
+                                // 添加到列表
+                                articleInfoDTOList.add(articleInfoDTO);
+                            }
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 118 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetGuangXiArticleService.java

@@ -0,0 +1,118 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 广西壮族自治区知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetGuangXiArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getGuangXi() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        // 通知公告
+        urls.add("http://www.gxipo.net/gx/zs/tzgg/");
+        // 市县动态
+        urls.add("http://www.gxipo.net/gx/zs/sxdt/");
+        // 广西动态
+        urls.add("http://www.gxipo.net/gx/zs/gxdt/");
+        // 统计信息
+        urls.add("http://www.gxipo.net/gx/zs/tjxx2/");
+        for (String url : urls) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                if (responseBodies != null && !responseBodies.isEmpty()) {
+                    List<ArticleInfoDTO> articleInfoDTOList = this.readJson(responseBodies);
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select("#main_right_content ul li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select("span").first();
+                        if (dateElement != null) {
+                            String timestamp = dateElement.text();
+                            Element urlElement = item.select("a").first();
+                            String href = urlElement.attr("href");
+                            String title = urlElement.text();
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                Date date = new Date();
+                                if (!timestamp.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(timestamp);
+                                    } catch (ParseException e) {
+                                        System.out.println("time parse error");
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(title);
+                                articleInfoDTO.setLink("http://www.gxipo.net" + href);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("18");
+                                articleInfoDTO.setSource(1);
+                                articleInfoDTOList.add(articleInfoDTO);
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 127 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetHaiNanArticleService.java

@@ -0,0 +1,127 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 海南省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetHaiNanArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getHaiNan() {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        // 信息公开 -> 通知公告
+        urls.add("https://amr.hainan.gov.cn/szscqj/xxgk/tzgg/");
+        // 信息公开 -> 政策文件 -> 部门文件
+        urls.add("https://amr.hainan.gov.cn/szscqj/xxgk/zcwj/bmwj/");
+        // 要闻动态 -> 工作动态
+        urls.add("https://amr.hainan.gov.cn/szscqj/ywdt/gzdt/");
+        for (String url : urls) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                List<ArticleInfoDTO> articleInfoDTOS = this.readJson(url, responseBody);
+                articleInfoDTOList.addAll(articleInfoDTOS);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOList.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOList);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(String link, String responseBody) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            Document doc = Jsoup.parse(responseBody);
+            Elements items = doc.select("div.gly-r-nr2 ul li");
+            if (items != null && !items.isEmpty()) {
+                for (Element item : items) {
+                    Element dateElement = item.select("em").first();
+                    String timestamp = dateElement.text();
+                    Element titleElement = item.select("a").first();
+                    String title = titleElement.attr("title");
+                    String href = titleElement.attr("href");
+                    String hrefSub = "";
+                    if (href.startsWith("./")) {
+                        hrefSub = href.substring(2);
+                    } else if (href.startsWith("../")) {
+                        if (href.startsWith("../../")) {
+                            hrefSub = href.substring(6);
+                        } else {
+                            hrefSub = href.substring(3);
+                        }
+                    } else if (href.startsWith("http")) {
+                        hrefSub = href;
+                    }
+                    String url = link;
+                    if (hrefSub.startsWith("2024") || hrefSub.startsWith("2023")) {
+                        url = url + hrefSub;
+                    } else if (hrefSub.startsWith("http")) {
+                        url = hrefSub;
+                    } else {
+                        url = "https://amr.hainan.gov.cn/szscqj/xxgk/" + hrefSub;
+                    }
+                    if (!timestamp.isEmpty() && !url.isEmpty()) {
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date date = new Date();
+                        if (!timestamp.isEmpty()) {
+                            try {
+                                date = dateFormat.parse(timestamp);
+                            } catch (ParseException e) {
+                                System.out.println("time parse error");
+                                continue;
+                            }
+                        }
+                        ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                        articleInfoDTO.setTitle(title);
+                        articleInfoDTO.setLink(url);
+                        articleInfoDTO.setTime(date);
+                        articleInfoDTO.setFakeId("16");
+                        articleInfoDTO.setSource(1);
+                        articleInfoDTOList.add(articleInfoDTO);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 121 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetHeNanArticleService.java

@@ -0,0 +1,121 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 河南省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetHeNanArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getHeNan() {
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        //时政要闻
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-1.shtml");
+        //通知公告
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-2.shtml");
+        //省局动态
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-3.shtml");
+        //外省动态
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-4.shtml");
+        //市县动态
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-5.shtml");
+        //媒体聚焦
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-6.shtml");
+        //重要文件
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-8.shtml");
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity());
+                responseBodies.add(responseBody);
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                // 解析包含 JSON 数据的 <abbr> 标签
+                Document doc = Jsoup.parse(responseBody);
+                Elements liElements = doc.select("ul li");
+                if (liElements != null && !liElements.isEmpty()) {
+                    for (Element li : liElements) {
+                        Element span = li.select("span").first();
+                        if (span != null) {
+                            String time = span.text().replace("[", "").replace("]", "");
+                            Element a = li.select("a").first();
+                            String title = a.text();
+                            String url = a.attr("href");
+
+                            if (!time.isEmpty() && !url.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                Date date = new Date();
+                                if (!time.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(time);
+                                    } catch (ParseException e) {
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(title);
+                                articleInfoDTO.setLink("http://zjxx.hnpatent.gov.cn" + url);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("11");
+                                articleInfoDTO.setSource(1);
+                                // 添加到列表
+                                articleInfoDTOList.add(articleInfoDTO);
+                            }
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 123 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetHuNanArticleService.java

@@ -0,0 +1,123 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 湖南省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetHuNanArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getHeNan() {
+        String responseStr = "success";
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        //时政要闻
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-1.shtml");
+        //通知公告
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-2.shtml");
+        //省局动态
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-3.shtml");
+        //外省动态
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-4.shtml");
+        //市县动态
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-5.shtml");
+        //媒体聚焦
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-6.shtml");
+        //重要文件
+        urls.add("http://zjxx.hnpatent.gov.cn/home/list-1-8.shtml");
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity());
+                responseBodies.add(responseBody);
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                // 解析包含 JSON 数据的 <abbr> 标签
+                Document doc = Jsoup.parse(responseBody);
+                Elements liElements = doc.select("ul li");
+                if (liElements != null && !liElements.isEmpty()) {
+                    for (Element li : liElements) {
+                        Element span = li.select("span").first();
+                        if (span != null) {
+                            String time = span.text().replace("[", "").replace("]", "");
+                            Element a = li.select("a").first();
+                            String title = a.text();
+                            String url = a.attr("href");
+
+                            if (!time.isEmpty() && !url.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                Date date = new Date();
+                                if (!time.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(time);
+                                    } catch (ParseException e) {
+                                        System.out.println("time parse error");
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(title);
+                                articleInfoDTO.setLink("http://zjxx.hnpatent.gov.cn" + url);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("11");
+                                articleInfoDTO.setSource(1);
+                                // 添加到列表
+                                articleInfoDTOList.add(articleInfoDTO);
+                            }
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 120 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetJiangSuArticleService.java

@@ -0,0 +1,120 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.XmlParseService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 江苏省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetJiangSuArticleService {
+    private final XmlParseService xmlParseService;
+    private final ArticleInfoService articleInfoService;
+
+    public String getJiangSu() {
+        String responseStr = "success";
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        Map<String, String> urlMap = new HashMap<>();
+        //要闻动态
+        urlMap.put("https://jsip.jiangsu.gov.cn/col/col75877/index.html", "305425");
+        //省局动态
+        urlMap.put("https://jsip.jiangsu.gov.cn/col/col75875/index.html", "305425");
+        //市县动态
+        urlMap.put("https://jsip.jiangsu.gov.cn/col/col75876/index.html", "305425");
+        //政府信息公开制度
+        urlMap.put("https://jsip.jiangsu.gov.cn/col/col85024/index.html", "359986");
+        //通知公告
+        urlMap.put("https://jsip.jiangsu.gov.cn/col/col85036/index.html", "360321");
+        //规范性文件
+        urlMap.put("https://jsip.jiangsu.gov.cn/col/col87144/index.html", "360321");
+        for (Map.Entry<String, String> entry : urlMap.entrySet()) {
+            String url = entry.getKey();
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                httpClient.close();
+                if (responseBody != null) {
+                    String key = entry.getValue();
+                    List<ArticleInfoDTO> articleInfoDTOS = this.readJson(key, responseBody);
+                    articleInfoDTOList.addAll(articleInfoDTOS);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOList.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOList);
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(String key, String responseBody) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            // 解析包含 JSON 数据的 <abbr> 标签
+            Document doc = Jsoup.parse(responseBody);
+            Element div = doc.getElementById(key);
+            Element scriptElement = div.select("script").first();
+            String contentText = scriptElement.html();
+            List<String> reStrs = xmlParseService.xmlParse(contentText, "record");
+            for (String reStr : reStrs) {
+                Document document = Jsoup.parse(reStr);
+                Element linkElement = document.getElementsByTag("a").first();
+                String link = linkElement.attr("href");
+                String title = linkElement.text();
+                String dateStr = document.getElementsByTag("span").text().trim();
+                Date date = new Date();
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                try {
+                    date = dateFormat.parse(dateStr);
+                } catch (ParseException e) {
+                    System.out.println(dateStr);
+                }
+                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                articleInfoDTO.setSource(1);
+                if (link.contains("http")) {
+                    articleInfoDTO.setLink(link);
+                } else {
+                    articleInfoDTO.setLink("https://jsip.jiangsu.gov.cn" + link);
+                }
+                articleInfoDTO.setTitle(title);
+                articleInfoDTO.setFakeId("10");
+                articleInfoDTO.setTime(date);
+                articleInfoDTOList.add(articleInfoDTO);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 110 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetLiaoNingArticleService.java

@@ -0,0 +1,110 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 辽宁省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetLiaoNingArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getLiaoNing() {
+        String responseStr = "success";
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        //
+        urls.add("https://zscq.ln.gov.cn/zscq/zscqdt/index.shtml");
+        //通知公告
+        urls.add("https://zscq.ln.gov.cn/zscq/tzgg/index.shtml");
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                // 解析包含 JSON 数据的 <abbr> 标签
+                Document doc = Jsoup.parse(responseBody);
+                Elements liElements = doc.select(".list-modelone .article-li");
+                if (liElements != null && !liElements.isEmpty()) {
+                    for (Element li : liElements) {
+                        Element link = li.select(".article-title a").first();
+                        String title = link.text();
+                        String url = link.attr("href");
+                        String time = li.select(".article-time").first().text();
+                        if (!time.isEmpty() && !url.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!time.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(time);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            articleInfoDTO.setLink("https://zscq.ln.gov.cn" + url);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("12");
+                            articleInfoDTO.setSource(1);
+                            // 添加到列表
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 114 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetQingHaiArticleService.java

@@ -0,0 +1,114 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 青海省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetQingHaiArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getQingHai() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        // 通知公告
+        urls.add("http://www.qhzlxx.net/index.php?m=content&c=index&a=lists&catid=33");
+
+        for (String url : urls) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                if (responseBodies != null && !responseBodies.isEmpty()) {
+                    List<ArticleInfoDTO> articleInfoDTOList = this.readJson(responseBodies);
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select("#myTabContent ul.list_ul li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select("span").first();
+                        if (dateElement != null) {
+                            String timestamp = dateElement.text();
+                            timestamp = timestamp.replaceAll("\\[|\\]", ""); // Removing brackets in the string
+                            Element urlElement = item.select("a").first();
+                            String href = urlElement.attr("href");
+                            String title = urlElement.text();
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd");
+                                Date date = new Date();
+                                if (!timestamp.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(timestamp);
+                                    } catch (ParseException e) {
+                                        System.out.println("time parse error");
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(title);
+                                articleInfoDTO.setLink(href);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("17");
+                                articleInfoDTO.setSource(1);
+                                articleInfoDTOList.add(articleInfoDTO);
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 163 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetShanXi1ArticleService.java

@@ -0,0 +1,163 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 陕西省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetShanXi1ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getShanXi() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        Map<String, Boolean> urlMap = new HashMap<>();
+        // 通知公告
+        urlMap.put("https://snipa.shaanxi.gov.cn/newstyle/pub_newschannel.asp?chid=100360", true);
+        // 会议、政策文件
+        urlMap.put("https://snipa.shaanxi.gov.cn/newstyle/pub_newschannel.asp?chid=100405", true);
+        // 执行公开
+        urlMap.put("https://snipa.shaanxi.gov.cn/newstyle/pub_newschannel.asp?chid=100401", true);
+        // 局务要闻
+        urlMap.put("https://snipa.shaanxi.gov.cn/newstyle/pub_newschannel.asp?chid=100356", false);
+        for (Map.Entry<String, Boolean> entry : urlMap.entrySet()) {
+            String url = entry.getKey();
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), "GB2312");
+                if (entry.getValue()) {
+                    responseBodies.add(responseBody);
+                    if (responseBodies != null && !responseBodies.isEmpty()) {
+                        List<ArticleInfoDTO> articleInfoDTOList = this.readJson1(responseBodies);
+                        articleInfoDTOS.addAll(articleInfoDTOList);
+                    }
+                } else {
+                    List<ArticleInfoDTO> articleInfoDTOList = this.readJson(responseBody);
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson1(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select("div.scroll_cont li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element link = item.select("a").first();
+                        String href = link.attr("href");
+                        String title = link.select("span").text();
+                        String timestamp = item.select(".tim").text();
+                        if (!timestamp.isEmpty() && !href.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!timestamp.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(timestamp);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            articleInfoDTO.setLink("https://snipa.shaanxi.gov.cn/" + href);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("14");
+                            articleInfoDTO.setSource(1);
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+
+    private List<ArticleInfoDTO> readJson(String responseBody) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            Document doc = Jsoup.parse(responseBody);
+            Elements items = doc.select("div.content_c ul li");
+            if (items != null && !items.isEmpty()) {
+                for (Element item : items) {
+                    Element span = item.select("span.span1").first();
+                    String yearMonth = span.select("p.p1").text();
+                    String dayStr = span.select("p").text();
+                    String day = dayStr.substring(0, 2);
+                    String timestamp = yearMonth + "-" + day;
+
+                    Element link = item.select("h3 a").first();
+                    String title = link.text();
+                    String href = link.attr("href");
+
+                    if (!timestamp.isEmpty() && !href.isEmpty()) {
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date date = new Date();
+                        if (!timestamp.isEmpty()) {
+                            try {
+                                date = dateFormat.parse(timestamp);
+                            } catch (ParseException e) {
+                                System.out.println("time parse error");
+                                continue;
+                            }
+                        }
+                        ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                        articleInfoDTO.setTitle(title);
+                        articleInfoDTO.setLink("https://snipa.shaanxi.gov.cn/" + href);
+                        articleInfoDTO.setTime(date);
+                        articleInfoDTO.setFakeId("14");
+                        articleInfoDTO.setSource(1);
+                        articleInfoDTOList.add(articleInfoDTO);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 158 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetShanXi2ArticleService.java

@@ -0,0 +1,158 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 山西省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetShanXi2ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getShanXi() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        Map<String, Boolean> urlMap = new HashMap<>();
+        // 通知公告
+        urlMap.put("https://scjgj.shanxi.gov.cn/trs-search/trssearch/v2/searchAll.do?siteId=22&searchTag=all&allKeywords=%E7%9F%A5%E8%AF%86%E4%BA%A7%E6%9D%83&fullKeywords=&orKeywords=&notKeywords=&sort=&position=0&organization=&pageNum=1&pageSize=10&zcYear=&isAlways=0&fileTag=", true);
+        for (Map.Entry<String, Boolean> entry : urlMap.entrySet()) {
+            String url = entry.getKey();
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+//                if (entry.getValue()) {
+//                    responseBodies.add(responseBody);
+//                    if (responseBodies != null && !responseBodies.isEmpty()) {
+//                        List<ArticleInfoDTO> articleInfoDTOList = this.readJson1(responseBodies);
+//                        articleInfoDTOS.addAll(articleInfoDTOList);
+//                    }
+//                } else {
+//                    List<ArticleInfoDTO> articleInfoDTOList = this.readJson(responseBody);
+//                    articleInfoDTOS.addAll(articleInfoDTOList);
+//                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+//            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson1(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select("div.scroll_cont li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element link = item.select("a").first();
+                        String href = link.attr("href");
+                        String title = link.select("span").text();
+                        String timestamp = item.select(".tim").text();
+                        if (!timestamp.isEmpty() && !href.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!timestamp.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(timestamp);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            articleInfoDTO.setLink("https://snipa.shaanxi.gov.cn/" + href);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("14");
+                            articleInfoDTO.setSource(1);
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+
+    private List<ArticleInfoDTO> readJson(String responseBody) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            Document doc = Jsoup.parse(responseBody);
+            Elements items = doc.select("div.content_c ul li");
+            if (items != null && !items.isEmpty()) {
+                for (Element item : items) {
+                    Element span = item.select("span.span1").first();
+                    String yearMonth = span.select("p.p1").text();
+                    String dayStr = span.select("p").text();
+                    String day = dayStr.substring(0, 2);
+                    String timestamp = yearMonth + "-" + day;
+
+                    Element link = item.select("h3 a").first();
+                    String title = link.text();
+                    String href = link.attr("href");
+
+                    if (!timestamp.isEmpty() && !href.isEmpty()) {
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date date = new Date();
+                        if (!timestamp.isEmpty()) {
+                            try {
+                                date = dateFormat.parse(timestamp);
+                            } catch (ParseException e) {
+                                System.out.println("time parse error");
+                                continue;
+                            }
+                        }
+                        ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                        articleInfoDTO.setTitle(title);
+                        articleInfoDTO.setLink("https://snipa.shaanxi.gov.cn/" + href);
+                        articleInfoDTO.setTime(date);
+                        articleInfoDTO.setFakeId("14");
+                        articleInfoDTO.setSource(1);
+                        articleInfoDTOList.add(articleInfoDTO);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 110 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetShangHaiArticleService.java

@@ -0,0 +1,110 @@
+package com.example.mos.service.GetWebArticle;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 上海市知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetShangHaiArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getShangHai() {
+        String responseStr = "success";
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        urls.add("https://sipa.sh.gov.cn/tzgg/index.html");
+        urls.add("https://sipa.sh.gov.cn/ywzx/");
+        urls.add("https://sipa.sh.gov.cn/zwgk_zxxxgk/");
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity());
+                responseBodies.add(responseBody);
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                // 解析包含 JSON 数据的 <abbr> 标签
+                Document doc = Jsoup.parse(responseBody);
+                Elements liElements = doc.select("ul.uli14 li");
+                if (liElements != null && !liElements.isEmpty()) {
+                    for (Element li : liElements) {
+                        Element link = li.select("a").first();
+                        String title = link.text();
+                        String url = link.attr("href");
+                        String time = li.select("span.time").first().text();
+                        if (!time.isEmpty() && !url.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!time.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(time);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            articleInfoDTO.setLink("https://sipa.sh.gov.cn" + url);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("7");
+                            articleInfoDTO.setSource(1);
+                            // 添加到列表
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 113 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetTianJinArticleService.java

@@ -0,0 +1,113 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 天津市知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetTianJinArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public String getTianJin() {
+        String responseStr = "success";
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        urls.add("https://zscq.tj.gov.cn/zwxx/zwyw/");
+        urls.add("https://zscq.tj.gov.cn/zwxx/gzdt/");
+        urls.add("https://zscq.tj.gov.cn/zwxx/tzgg/");
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        try {
+            for (String url : urls) {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                responseStr = responseBody;
+            }
+            httpClient.close();
+            if (responseBodies != null && !responseBodies.isEmpty()) {
+                this.readJson(responseBodies);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseStr;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private void readJson(List<String> responseBodies) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+            for (String responseBody : responseBodies) {
+                // 解析包含 JSON 数据的 <abbr> 标签
+                Document doc = Jsoup.parse(responseBody);
+                Elements liElements = doc.select("div.fr.nymain ul.list2 li");
+                if (liElements != null && !liElements.isEmpty()) {
+                    for (Element li : liElements) {
+                        String title = li.select("a").attr("title");
+                        String url = li.select("a").attr("href");
+                        String time = li.select("span").text();
+                        if (!time.isEmpty() && !url.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!time.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(time);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            if (url.contains("https")) {
+                                articleInfoDTO.setLink(url);
+                            } else {
+                                articleInfoDTO.setLink("https://zscq.tj.gov.cn/zwxx/" + url.substring(3));
+                            }
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("9");
+                            articleInfoDTO.setSource(1);
+                            // 添加到列表
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+            }
+            // 将提取的信息添加到数据库或进行其他操作
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 141 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetWeb1ArticleService.java

@@ -0,0 +1,141 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.alibaba.fastjson.JSONObject;
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.common.model.dto.Web1DTO;
+import com.example.mos.common.model.vo.ReturnVO;
+import com.example.mos.common.model.vo.Web1VO.Web1InfoVO;
+import com.example.mos.common.model.vo.Web1VO.Web1VO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.springframework.stereotype.Service;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 国家法律法规数据库
+ * @Author xiexiang
+ * @Date 2024/6/11
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetWeb1ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    /**
+     * "dfxfg"  地方性法规
+     * "sfjs"   司法解释
+     * "jcfg"   监察法规
+     * "xzfg"   行政法规
+     * "flfg"   法律法规
+     * @param type
+     */
+    public String getWeb(String type) {
+        String responseBody = "";
+        Integer page = 1;
+        Integer size = 10;
+        String timeStamp = "1718174452350";
+        Web1DTO params = this.setParams(type, page, size, timeStamp);
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String baseUrl = "https://flk.npc.gov.cn/api/";
+        try {
+            // 使用StringBuilder构建URL
+            StringBuilder urlBuilder = new StringBuilder(baseUrl);
+            urlBuilder.append("?type=").append(params.getType())
+                    .append("&searchType=").append(params.getSearchType())
+                    .append("&sortTr=").append(params.getSortTr())
+                    .append("&gbrqStart=").append(params.getGbrqStart())
+                    .append("&gbrqEnd=").append(params.getGbrqEnd())
+                    .append("&sxrqStart=").append(params.getSxrqStart())
+                    .append("&sxrqEnd=").append(params.getSxrqEnd())
+                    .append("&sort=").append(params.isSort())
+                    .append("&page=").append(params.getPage())
+                    .append("&size=").append(params.getSize())
+                    .append("&_=").append(params.getTimestamp());
+
+            HttpGet request = new HttpGet(urlBuilder.toString());
+            HttpResponse response = httpClient.execute(request);
+            // 获取响应实体内容
+            responseBody = EntityUtils.toString(response.getEntity());
+            httpClient.close();  // 关闭httpClient
+//            this.readJson(responseBody);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseBody;
+    }
+
+    /**
+     * 配置固定参数
+     * @param type
+     * @param page
+     * @param size
+     * @param timeStamp
+     * @return
+     */
+    private static Web1DTO setParams(String type, Integer page, Integer size, String timeStamp){
+        Web1DTO web1DTO = new Web1DTO();
+        web1DTO.setType(type);
+        web1DTO.setSearchType("title%3Bvague");
+        web1DTO.setSortTr("f_bbrq_s%3Bdesc");
+        web1DTO.setGbrqStart("");
+        web1DTO.setGbrqEnd("");
+        web1DTO.setSxrqStart("");
+        web1DTO.setSxrqEnd("");
+        web1DTO.setSort(true);
+        web1DTO.setPage(page);
+        web1DTO.setSize(size);
+        web1DTO.setTimestamp(timeStamp);
+        return web1DTO;
+    }
+
+    /**
+     * 解析json
+     * @param responseBody
+     */
+    public void readJson(String responseBody) {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        ReturnVO returnVO = JSONObject.parseObject(responseBody, ReturnVO.class);
+        if (returnVO.getMessage().equals("success")) {
+            Web1VO web1VO = returnVO.getResult();
+            List<Web1InfoVO> web1InfoVOS = web1VO.getData();
+            if (!web1InfoVOS.isEmpty()) {
+                for (Web1InfoVO web1InfoVO : web1InfoVOS) {
+                    ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                    articleInfoDTO.setSource(1);
+                    String url = web1InfoVO.getUrl();
+                    if (url.startsWith("./")) {
+                        url = url.substring(2);
+                    }
+                    String absoluteUrl = "https://flk.npc.gov.cn/" + url;
+                    articleInfoDTO.setLink(absoluteUrl);
+                    articleInfoDTO.setTitle(web1InfoVO.getTitle());
+                    String dateString = web1InfoVO.getPublish();
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    Date date = new Date();
+                    try {
+                        date = dateFormat.parse(dateString);
+                        System.out.println(date); // 输出转换后的日期对象
+                    } catch (ParseException e) {
+                        e.printStackTrace();
+                    }
+                    articleInfoDTO.setTime(date);
+                    articleInfoDTO.setFakeId("1");
+                    articleInfoDTOS.add(articleInfoDTO);
+                }
+                articleInfoService.addArticles(articleInfoDTOS);
+            }
+        }
+    }
+}

+ 213 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetWeb2ArticleService.java

@@ -0,0 +1,213 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.common.model.dto.Web2DTO;
+import com.example.mos.common.model.dto.Web4DTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 法律图书馆
+ * @Author xiexiang
+ * @Date 2024/6/17
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetWeb2ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    /**
+     * 法治动态
+     *
+     * @return
+     */
+    public String getWeb2() {
+        List<String> responseBodyList = new ArrayList<>();
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String baseUrl = "http://www.law-lib.com/fzdt/newsweb/newssearch.asp";
+
+        try {
+            // 使用StringBuilder构建URL
+            String keyword = "%D6%AA%CA%B6%B2%FA%C8%A8";
+            List<String> searchTypes = new ArrayList<>(Arrays.asList("bt", "qw"));
+            for (String searchType : searchTypes) {
+                StringBuilder urlBuilder = new StringBuilder(baseUrl);
+                urlBuilder.append("?newskeyword=").append(keyword)
+                        .append("&s=")
+                        .append("&btqw=").append(searchType);
+
+                HttpGet request = new HttpGet(urlBuilder.toString());
+                HttpResponse response = httpClient.execute(request);
+                HttpEntity entity = response.getEntity();
+
+                // 获取响应实体内容
+                if (entity != null) {
+                    // 指定字符编码为UTF-8或GB2312
+                    String responseBody = EntityUtils.toString(entity, "gb2312");
+                    responseBodyList.add(responseBody);
+                }
+            }
+            // 打印响应内容
+            httpClient.close();  // 关闭httpClient
+            if (!responseBodyList.isEmpty()) {
+                this.readHTML(responseBodyList);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "success";
+    }
+
+    private void readHTML(List<String> reHtmlS) {
+        for (String reHtml : reHtmlS) {
+            try {
+                List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+
+                // 使用JSoup解析HTML
+                Document doc = Jsoup.parse(reHtml, "gb2312");
+                // 找到指定class的table元素
+                Elements lawElements = doc.select("div.law");
+                for (Element lawElement : lawElements) {
+                    Elements titleElements = lawElement.select("li > a");
+                    for (Element titleElement : titleElements) {
+
+                        String title = titleElement.text();
+                        String link = titleElement.attr("href");
+                        String url = "http://www.law-lib.com/fzdt";
+
+                        Element timeElement = lawElement.select("span.time").first();
+                        String timeStr = timeElement.text().replaceAll("[\\[\\]]", ""); // 去除中括号
+                        Date date = new Date();
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        try {
+                            date = dateFormat.parse(timeStr);// 输出转换后的日期对象
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                        ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                        articleInfoDTO.setTitle(title);
+                        articleInfoDTO.setLink(link.replace("..", url));
+                        articleInfoDTO.setFakeId("2");
+                        articleInfoDTO.setSource(1);
+                        articleInfoDTO.setTime(date);
+                        articleInfoDTOList.add(articleInfoDTO);
+                    }
+                }
+                articleInfoService.addArticles(articleInfoDTOList);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * 新法规速递
+     */
+    public void getXFGSD() {
+        List<String> responseBodyList = new ArrayList<>();
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        /**
+         * 中央
+         */
+        String zyUrl = "http://www.law-lib.com/law/lawml.asp?bbdw=&tm1=%D6%AA%CA%B6%B2%FA%C8%A8&tm2=";
+
+        /**
+         * 地方
+         */
+        String dfUrl = "http://www.law-lib.com/law/lawml-df.asp?bbdw=&tm1=%D6%AA%CA%B6%B2%FA%C8%A8&tm2=";
+
+        try {
+            // 使用StringBuilder构建URL
+            List<String> searchUrls = new ArrayList<>(Arrays.asList(zyUrl, dfUrl));
+            for (String searchUrl : searchUrls) {
+                HttpGet request = new HttpGet(searchUrl);
+                HttpResponse response = httpClient.execute(request);
+                HttpEntity entity = response.getEntity();
+
+                // 获取响应实体内容
+                if (entity != null) {
+                    // 指定字符编码为UTF-8或GB2312
+                    String responseBody = EntityUtils.toString(entity, "gb2312");
+                    responseBodyList.add(responseBody);
+                }
+            }
+            // 打印响应内容
+            httpClient.close();// 关闭httpClient
+            if (!responseBodyList.isEmpty()) {
+                this.readXFGSDHTML(responseBodyList);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void readXFGSDHTML(List<String> reHtmlS) {
+        for (String reHtml : reHtmlS) {
+            try {
+                List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+
+                // 使用JSoup解析HTML
+                Document doc = Jsoup.parse(reHtml, "gb2312");
+                // 找到指定class的table元素
+                Elements lawElements = doc.select("li");
+                for (Element lawElement : lawElements) {
+                    Element aTag = lawElement.select("a").first();
+                    if (aTag != null) {
+                        String href = aTag.attr("href");
+                        String url = "http://www.law-lib.com/law/";
+                        String title = aTag.text();
+                        Element pTag = lawElement.select("p").first();
+                        if (pTag != null) {
+                            String dateStr = pTag.text().replaceAll("[^\\d-]", "");
+                            Date date = new Date();
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            try {
+                                date = dateFormat.parse(dateStr);// 输出转换后的日期对象
+                            } catch (ParseException e) {
+                                e.printStackTrace();
+                            }
+
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            articleInfoDTO.setLink(url + href);
+                            articleInfoDTO.setFakeId("2");
+                            articleInfoDTO.setSource(1);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+                articleInfoService.addArticles(articleInfoDTOList);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+}

+ 129 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetWeb3ArticleService.java

@@ -0,0 +1,129 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.common.model.dto.Web1DTO;
+import com.example.mos.common.model.dto.Web4DTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 法律文库
+ * @Author xiexiang
+ * @Date 2024/6/13
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetWeb3ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    private static Web4DTO setParams(String type, String sobj, String keywords, Integer page) {
+        Web4DTO web4DTO = new Web4DTO();
+        web4DTO.setType(type);
+        web4DTO.setSobj(sobj);
+        web4DTO.setKeywords(keywords);
+        web4DTO.setPage(page);
+        return web4DTO;
+    }
+
+    public String getWeb4(String type, String sobj, String keywords, Integer page) {
+        String responseBody = "";
+        Web4DTO params = this.setParams(type, sobj, keywords, page);
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String baseUrl = "http://lawdb.cncourt.org/index.php";
+        try {
+            // 使用StringBuilder构建URL
+            StringBuilder urlBuilder = new StringBuilder(baseUrl);
+            urlBuilder.append("?type=").append(params.getType())
+                    .append("&sobj=").append(params.getSobj())
+                    .append("&keywords=").append(params.getKeywords())
+                    .append("&page=").append(params.getPage());
+
+            HttpGet request = new HttpGet(urlBuilder.toString());
+            HttpResponse response = httpClient.execute(request);
+            HttpEntity entity = response.getEntity();
+            // 获取响应实体内容
+            if (entity != null) {
+                // 指定字符编码为UTF-8或GB2312
+                responseBody = EntityUtils.toString(entity, "gb2312");
+            }
+            // 打印响应内容
+            httpClient.close();  // 关闭httpClient
+            this.readHTML(responseBody);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseBody;
+    }
+
+    private void readHTML(String reHtml) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+
+            // 使用JSoup解析HTML
+            Document doc = Jsoup.parse(reHtml, "gb2312");
+            // 找到指定class的table元素
+            Element lawListTable = doc.select("table.law_list").first();
+            Element table = lawListTable.select("table").first();
+            System.out.println("table" + table);
+            // 遍历table中的列表信息
+            Elements trList = table.select("tr");
+            for (Element tr : trList) {
+                Elements tdList = tr.children(); // 获取 tr 下的所有 td 元素
+                if (tdList.size() > 1) { // 确保 tdList 的长度大于 1,避免索引越界
+                    Element td = tdList.get(1);
+                    String title = td.text();
+                    String url = td.select("a").attr("href");
+                    Date date = new Date();
+                    Pattern pattern = Pattern.compile("\\b\\d{4}-\\d{2}-\\d{2}\\b"); // 正则表达式用于匹配日期格式
+                    Matcher matcher = pattern.matcher(title);
+                    if (matcher.find()) {
+                        String dateString = matcher.group(); // 提取匹配的日期字符串
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        try {
+                            date = dateFormat.parse(dateString);
+                            System.out.println(date); // 输出转换后的日期对象
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                    articleInfoDTO.setTitle(title);
+                    articleInfoDTO.setLink("http://lawdb.cncourt.org/" + url);
+                    articleInfoDTO.setFakeId("4");
+                    articleInfoDTO.setSource(1);
+                    articleInfoDTO.setTime(date);
+                    articleInfoDTOList.add(articleInfoDTO);
+                } else {
+                    System.out.println("No valid data found in current row");
+                }
+            }
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 128 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetWeb4ArticleService.java

@@ -0,0 +1,128 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.common.model.dto.Web4DTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 法律文库
+ * @Author xiexiang
+ * @Date 2024/6/13
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetWeb4ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    private static Web4DTO setParams(String type, String sobj, String keywords, Integer page) {
+        Web4DTO web4DTO = new Web4DTO();
+        web4DTO.setType(type);
+        web4DTO.setSobj(sobj);
+        web4DTO.setKeywords(keywords);
+        web4DTO.setPage(page);
+        return web4DTO;
+    }
+
+    public String getWeb4(String type, String sobj, String keywords, Integer page) {
+        String responseBody = "";
+        Web4DTO params = this.setParams(type, sobj, keywords, page);
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String baseUrl = "http://lawdb.cncourt.org/index.php";
+        try {
+            // 使用StringBuilder构建URL
+            StringBuilder urlBuilder = new StringBuilder(baseUrl);
+            urlBuilder.append("?type=").append(params.getType())
+                    .append("&sobj=").append(params.getSobj())
+                    .append("&keywords=").append(params.getKeywords())
+                    .append("&page=").append(params.getPage());
+
+            HttpGet request = new HttpGet(urlBuilder.toString());
+            HttpResponse response = httpClient.execute(request);
+            HttpEntity entity = response.getEntity();
+            // 获取响应实体内容
+            if (entity != null) {
+                // 指定字符编码为UTF-8或GB2312
+                responseBody = EntityUtils.toString(entity, "gb2312");
+            }
+            // 打印响应内容
+            httpClient.close();  // 关闭httpClient
+            this.readHTML(responseBody);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return responseBody;
+    }
+
+    private void readHTML(String reHtml) {
+        try {
+            List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+
+            // 使用JSoup解析HTML
+            Document doc = Jsoup.parse(reHtml, "gb2312");
+            // 找到指定class的table元素
+            Element lawListTable = doc.select("table.law_list").first();
+            Element table = lawListTable.select("table").first();
+            System.out.println("table" + table);
+            // 遍历table中的列表信息
+            Elements trList = table.select("tr");
+            for (Element tr : trList) {
+                Elements tdList = tr.children(); // 获取 tr 下的所有 td 元素
+                if (tdList.size() > 1) { // 确保 tdList 的长度大于 1,避免索引越界
+                    Element td = tdList.get(1);
+                    String title = td.text();
+                    String url = td.select("a").attr("href");
+                    Date date = new Date();
+                    Pattern pattern = Pattern.compile("\\b\\d{4}-\\d{2}-\\d{2}\\b"); // 正则表达式用于匹配日期格式
+                    Matcher matcher = pattern.matcher(title);
+                    if (matcher.find()) {
+                        String dateString = matcher.group(); // 提取匹配的日期字符串
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        try {
+                            date = dateFormat.parse(dateString);
+                            System.out.println(date); // 输出转换后的日期对象
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                    articleInfoDTO.setTitle(title);
+                    articleInfoDTO.setLink("http://lawdb.cncourt.org/" + url);
+                    articleInfoDTO.setFakeId("4");
+                    articleInfoDTO.setSource(1);
+                    articleInfoDTO.setTime(date);
+                    articleInfoDTOList.add(articleInfoDTO);
+                } else {
+                    System.out.println("No valid data found in current row");
+                }
+            }
+            articleInfoService.addArticles(articleInfoDTOList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 129 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetWeb5ArticleService.java

@@ -0,0 +1,129 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 中国知识产权资讯网
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetWeb5ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> get() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        Map<String, Integer> urlMap = new HashMap<>();
+        // 地方扫描
+        urlMap.put("http://www.iprchn.com/cipnews/list.aspx?newsClassid=49&flag=5", 0);
+        // 地理标志
+        urlMap.put("http://www.iprchn.com/cipnews/list.aspx?newsClassid=77&flag=5", 0);
+        // 商标
+        urlMap.put("http://www.iprchn.com/cipnews/list.aspx?newsClassid=24&flag=5", 0);
+        // 专利
+        urlMap.put("http://www.iprchn.com/cipnews/list.aspx?newsClassid=23&flag=5", 0);
+
+        for (Map.Entry<String, Integer> entry : urlMap.entrySet()) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                String url = entry.getKey();
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                if (responseBodies != null && !responseBodies.isEmpty()) {
+                    List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+                    if (entry.getValue().equals(0)) {
+                        articleInfoDTOList = this.readJson(responseBodies);
+                    }
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select(".lister li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select("span").first();
+                        if (dateElement != null) {
+                            Element anchorElement = item.select("a").first();
+                            String text = anchorElement.text();
+                            String href = anchorElement.attr("href");
+
+                            int startIndex = text.lastIndexOf("(");
+                            int endIndex = text.lastIndexOf(")");
+
+                            String timestamp = text.substring(startIndex + 1, endIndex);
+                            String title = text.substring(0, startIndex);
+
+
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+                                Date date = new Date();
+                                if (!timestamp.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(timestamp);
+                                    } catch (ParseException e) {
+                                        System.out.println("time parse error");
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(title);
+                                articleInfoDTO.setLink("http://www.iprchn.com/cipnews/" + href);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("20");
+                                articleInfoDTO.setSource(1);
+                                articleInfoDTOList.add(articleInfoDTO);
+
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 122 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetWeb6ArticleService.java

@@ -0,0 +1,122 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 中国知识产权网
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetWeb6ArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> get() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        Map<String, Integer> urlMap = new HashMap<>();
+        // 新闻资讯
+        urlMap.put("http://www.cnipr.com/sj/zx/", 0);
+
+        for (Map.Entry<String, Integer> entry : urlMap.entrySet()) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                String url = entry.getKey();
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                if (responseBodies != null && !responseBodies.isEmpty()) {
+                    List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+                    if (entry.getValue().equals(0)) {
+                        articleInfoDTOList = this.readJson(responseBodies);
+                    }
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select("li.zx_cont_list1");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select(".time.list1_dongtai_time").first();
+                        if (dateElement != null) {
+                            Element anchorElement = item.select(".list1_l a").first();
+                            String title = anchorElement.text();
+                            String href = anchorElement.attr("href");
+                            String dateStr = dateElement.text();
+                            String year = String.valueOf(java.time.Year.now().getValue());
+                            String timestamp = year + "-" + dateStr;
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                Date date = new Date();
+                                if (!timestamp.isEmpty()) {
+                                    try {
+                                        date = dateFormat.parse(timestamp);
+                                    } catch (ParseException e) {
+                                        System.out.println("time parse error");
+                                        continue;
+                                    }
+                                }
+                                ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                articleInfoDTO.setTitle(title);
+                                articleInfoDTO.setLink("http://www.cnipr.com/sj/zx/" + href);
+                                articleInfoDTO.setTime(date);
+                                articleInfoDTO.setFakeId("21");
+                                Element abstractElement = item.select(".list1_zhaiyao").first();
+                                if (abstractElement != null) {
+                                    String abs = abstractElement.text();
+                                    articleInfoDTO.setAbs(abs);
+                                }
+                                articleInfoDTO.setSource(1);
+                                articleInfoDTOList.add(articleInfoDTO);
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 170 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetXinJiangArticleService.java

@@ -0,0 +1,170 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 新疆维吾尔族自治区知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetXinJiangArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getXinJiang() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        Map<String, Integer> urlMap = new HashMap<>();
+        // 政策解读
+        urlMap.put("https://scjgj.xinjiang.gov.cn/xjaic/myzcjd/zfxxgk_gknrz.shtml", 0);
+        // 统计数据
+        urlMap.put("https://scjgj.xinjiang.gov.cn/xjaic/tjsj/common_list1578453299909.shtml", 1);
+        for (Map.Entry<String, Integer> entry : urlMap.entrySet()) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                String url = entry.getKey();
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                if (responseBodies != null && !responseBodies.isEmpty()) {
+                    List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+                    if (entry.getValue().equals(0)) {
+                        articleInfoDTOList = this.readJson(responseBodies);
+                    } else if (entry.getValue().equals(1)) {
+                        articleInfoDTOList = this.readJson2(responseBodies);
+                    }
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select(".gknr_list dl dd");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select("span").first();
+                        if (dateElement != null) {
+                            String timestamp = dateElement.text();
+                            Element urlElement = item.select("a").first();
+                            String href = urlElement.attr("href");
+                            String title = urlElement.text();
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                if (title.contains("知识产权") || title.contains("专利")) {
+                                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                    Date date = new Date();
+                                    if (!timestamp.isEmpty()) {
+                                        try {
+                                            date = dateFormat.parse(timestamp);
+                                        } catch (ParseException e) {
+                                            System.out.println("time parse error");
+                                            continue;
+                                        }
+                                    }
+                                    ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                    articleInfoDTO.setTitle(title);
+                                    articleInfoDTO.setLink("https://scjgj.xinjiang.gov.cn" + href);
+                                    articleInfoDTO.setTime(date);
+                                    articleInfoDTO.setFakeId("19");
+                                    articleInfoDTO.setSource(1);
+                                    articleInfoDTOList.add(articleInfoDTO);
+                                } else {
+                                    continue;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+
+    private List<ArticleInfoDTO> readJson2(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select(".list li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select("span").first();
+                        if (dateElement != null) {
+                            String timestamp = dateElement.text();
+                            Element urlElement = item.select("a").first();
+                            String href = urlElement.attr("href");
+                            String title = urlElement.text();
+                            if (!timestamp.isEmpty() && !href.isEmpty()) {
+                                if (title.contains("知识产权") || title.contains("专利")) {
+                                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                                    Date date = new Date();
+                                    if (!timestamp.isEmpty()) {
+                                        try {
+                                            date = dateFormat.parse(timestamp);
+                                        } catch (ParseException e) {
+                                            System.out.println("time parse error");
+                                            continue;
+                                        }
+                                    }
+                                    ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                                    articleInfoDTO.setTitle(title);
+                                    articleInfoDTO.setLink("https://scjgj.xinjiang.gov.cn" + href);
+                                    articleInfoDTO.setTime(date);
+                                    articleInfoDTO.setFakeId("19");
+                                    articleInfoDTO.setSource(1);
+                                    articleInfoDTOList.add(articleInfoDTO);
+                                } else {
+                                    continue;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 120 - 0
src/main/java/com/example/mos/service/GetWebArticle/GetYunNanArticleService.java

@@ -0,0 +1,120 @@
+package com.example.mos.service.GetWebArticle;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.service.ArticleInfoService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.springframework.stereotype.Service;
+
+import java.nio.charset.StandardCharsets;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 云南省知识产权局
+ * @Author xiexiang
+ * @Date 2024/8/19
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class GetYunNanArticleService {
+    private final ArticleInfoService articleInfoService;
+
+    public List<String> getYunNan() {
+        List<ArticleInfoDTO> articleInfoDTOS = new ArrayList<>();
+        List<String> responseBodies = new ArrayList<>();
+        List<String> urls = new ArrayList<>();
+        // 公示公告
+        urls.add("https://amr.yn.gov.cn/zscqj/gsgg1.htm");
+        // 政策法规
+        urls.add("https://amr.yn.gov.cn/zscqj/zcfg1.htm");
+        // 工作动态
+        urls.add("https://amr.yn.gov.cn/zscqj/gzdt.htm");
+        // 专利统计
+        urls.add("https://amr.yn.gov.cn/zscqj/zltj1.htm");
+        // 知识产权保护
+        urls.add("https://amr.yn.gov.cn/zscqj/zscqbh.htm");
+        // 知识产权运用促进
+        urls.add("https://amr.yn.gov.cn/zscqj/zscqyycj.htm");
+        for (String url : urls) {
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            try {
+                HttpGet request = new HttpGet(url);
+                setupHeaders(request);
+                HttpResponse response = httpClient.execute(request);
+                String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
+                responseBodies.add(responseBody);
+                if (responseBodies != null && !responseBodies.isEmpty()) {
+                    List<ArticleInfoDTO> articleInfoDTOList = this.readJson(responseBodies);
+                    articleInfoDTOS.addAll(articleInfoDTOList);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if (!articleInfoDTOS.isEmpty()) {
+            articleInfoService.addArticles(articleInfoDTOS);
+        }
+        return responseBodies;
+    }
+
+    private void setupHeaders(HttpGet request) {
+        request.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0");
+        request.addHeader("Cookie", "lcid=1043; __jsluid_s=d8da8b71aed1f47e6d74773d87ebf074; _va_ref=%5B%22%22%2C%22%22%2C1724059829%2C%22https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DuiYh-tKeu5W26B6buTNuL3NeDZ5sZfdDhBXd4R344papXwOqiQ_DhapSKUUahDaN%26wd%3D%26eqid%3Dc0d9d9b6002526d400000004668cdae9%22%5D; _va_id=f7c6b7152dd01f89.1720512427.4.1724059829.1724059829.; _va_ses=*");
+    }
+
+    private List<ArticleInfoDTO> readJson(List<String> responseBodies) {
+        List<ArticleInfoDTO> articleInfoDTOList = new ArrayList<>();
+        try {
+            for (int i = 0; i < responseBodies.size(); i++) {
+                String res = responseBodies.get(i);
+                Document doc = Jsoup.parse(res);
+                Elements items = doc.select("ul.news-list li");
+                if (items != null && !items.isEmpty()) {
+                    for (Element item : items) {
+                        Element dateElement = item.select(".opendate").first();
+                        String timestamp = dateElement.text();
+
+                        Element urlElement = item.select("a").first();
+                        String href = urlElement.attr("href");
+                        String title = urlElement.text();
+
+                        if (!timestamp.isEmpty() && !href.isEmpty()) {
+                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                            Date date = new Date();
+                            if (!timestamp.isEmpty()) {
+                                try {
+                                    date = dateFormat.parse(timestamp);
+                                } catch (ParseException e) {
+                                    System.out.println("time parse error");
+                                    continue;
+                                }
+                            }
+                            ArticleInfoDTO articleInfoDTO = new ArticleInfoDTO();
+                            articleInfoDTO.setTitle(title);
+                            articleInfoDTO.setLink("https://amr.yn.gov.cn/zscqj/" + href);
+                            articleInfoDTO.setTime(date);
+                            articleInfoDTO.setFakeId("15");
+                            articleInfoDTO.setSource(1);
+                            articleInfoDTOList.add(articleInfoDTO);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return articleInfoDTOList;
+    }
+}

+ 224 - 0
src/main/java/com/example/mos/service/QuartzTask/AutoGetArticleService.java

@@ -0,0 +1,224 @@
+package com.example.mos.service.QuartzTask;
+
+import com.example.mos.common.model.dto.ArticleInfoDTO;
+import com.example.mos.domain.quartz.QrtzTaskDTO;
+import com.example.mos.handler.WeChatLoginHandler;
+import com.example.mos.service.ArticleInfoService;
+import com.example.mos.service.GetWebArticle.*;
+import com.example.mos.service.GetWebArticle.Cnipr.GetPPHArticleService;
+import com.example.mos.service.WeChatAccountInfoService;
+import com.example.mos.weChatLogin.api.WeiXinApi;
+import com.example.mos.weChatLogin.model.Article;
+import com.example.mos.weChatLogin.model.WxResultBody;
+import com.example.mos.weChatLogin.okhttp.MyCookieStore;
+import lombok.RequiredArgsConstructor;
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+
+import javax.swing.*;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+@DisallowConcurrentExecution
+@RequiredArgsConstructor
+public class AutoGetArticleService extends QuartzJobBean {
+    private final ArticleInfoService articleInfoService;
+    private final GetWeb1ArticleService getWeb1ArticleService;
+    private final GetWeb2ArticleService getWeb2ArticleService;
+    private final GetWeb3ArticleService getWeb3ArticleService;
+    private final GetWeb4ArticleService getWeb4ArticleService;
+    private final GetWeb5ArticleService getWeb5ArticleService;
+    private final GetWeb6ArticleService getWeb6ArticleService;
+    private final GetPPHArticleService getPPHArticleService;
+    private final GetBeiJingArticleService getBeiJingArticleService;
+    private final GetShangHaiArticleService getShangHaiArticleService;
+    private final GetChongQingArticleService getChongQingArticleService;
+    private final GetGuangDongArticleService getGuangDongArticleService;
+    private final GetGuangXiArticleService getGuangXiArticleService;
+    private final GetHaiNanArticleService getHaiNanArticleService;
+    private final GetHeNanArticleService getHeNanArticleService;
+    private final GetHuNanArticleService getHuNanArticleService;
+    private final GetJiangSuArticleService getJiangSuArticleService;
+    private final GetLiaoNingArticleService getLiaoNingArticleService;
+    private final GetQingHaiArticleService getQingHaiArticleService;
+    private final GetShanXi1ArticleService getShanXi1ArticleService;
+    private final GetShanXi2ArticleService getShanXi2ArticleService;
+    private final GetTianJinArticleService getTianJinArticleService;
+    private final GetXinJiangArticleService getXinJiangArticleService;
+    private final GetYunNanArticleService getYunNanArticleService;
+    private final WeChatAccountInfoService weChatAccountInfoService;
+
+    @Override
+    public void executeInternal(JobExecutionContext context) throws JobExecutionException {
+        JobDataMap jobDataMap = context.getTrigger().getJobDataMap();
+        QrtzTaskDTO qrtzTask = (QrtzTaskDTO) jobDataMap.get("qrtzTask");
+        String parameter = qrtzTask.getParameter();
+        if (parameter != null) {
+//            // 国家法律法规数据库
+//            List<String> types = new ArrayList<>();
+//            types.add("dfxfg");
+//            types.add("sfjs");
+//            types.add("jcfg");
+//            types.add("xzfg");
+//            types.add("flfg");
+//            for (String type : types) {
+//                try {
+//                    System.out.println("--------------Web1---start---------------");
+//                    getWeb1ArticleService.getWeb(type);
+//                    System.out.println(type + "--------------success--------------");
+//                } catch (Exception e) {
+//                    System.out.println("--------------Web1---error---------------");
+//                }
+//            }
+
+            // 法律图书馆
+            //      法治动态
+            try {
+                getWeb2ArticleService.getWeb2();
+                System.out.println("------------Web2---fzdt-----success--------------");
+            } catch (Exception e) {
+                System.out.println("------------Web2---fzdt-----error--------------");
+            }
+
+            // 法律图书馆
+            //      新法规速递
+            try {
+                getWeb2ArticleService.getXFGSD();
+                System.out.println("------------Web2---xfgsd----success--------------");
+            } catch (Exception e) {
+                System.out.println("------------Web2---xfgsd----error--------------");
+            }
+
+            // 中国知识产权资讯网
+            try {
+                getWeb5ArticleService.get();
+                System.out.println("------------Web5-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------Web5-------error--------------");
+            }
+
+            // 中国知识产权网
+            try {
+                getWeb6ArticleService.get();
+                System.out.println("------------Web6-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------Web6-------error--------------");
+            }
+
+            try {
+                getPPHArticleService.getPPH();
+                System.out.println("------------getPPH------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getPPH------error--------------");
+            }
+
+
+            try {
+                getBeiJingArticleService.getBeiJing();
+                System.out.println("------------getBeiJing-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getBeiJing-------error--------------");
+            }
+
+            try {
+                getChongQingArticleService.getChongQing();
+                System.out.println("------------getChongQing-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getChongQing-------error--------------");
+            }
+
+            try {
+                getTianJinArticleService.getTianJin();
+                System.out.println("------------getTianJin-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getTianJin-------error--------------");
+            }
+
+            try {
+                getGuangDongArticleService.getGuangDong();
+                System.out.println("------------getGuangDong-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getGuangDong-------error--------------");
+            }
+
+            try {
+                getGuangXiArticleService.getGuangXi();
+                System.out.println("------------getGuangXi-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getGuangXi-------error--------------");
+            }
+
+            try {
+                getHaiNanArticleService.getHaiNan();
+                System.out.println("------------getHaiNan-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getHaiNan-------error--------------");
+            }
+
+            try {
+                getHeNanArticleService.getHeNan();
+                System.out.println("------------getHeNan-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getHeNan-------error--------------");
+            }
+
+            try {
+                getJiangSuArticleService.getJiangSu();
+                System.out.println("------------getJiangSu-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getJiangSu-------error--------------");
+            }
+
+            try {
+                getLiaoNingArticleService.getLiaoNing();
+                System.out.println("------------getLiaoNing-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getLiaoNing-------error--------------");
+            }
+
+            try {
+                getQingHaiArticleService.getQingHai();
+                System.out.println("------------getQingHai-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getQingHai-------error--------------");
+            }
+
+            try {
+                getShangHaiArticleService.getShangHai();
+                System.out.println("------------getShangHai-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getShangHai-------error--------------");
+            }
+
+            try {
+                getShanXi1ArticleService.getShanXi();
+                System.out.println("------------getShanXi-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getShanXi-------error--------------");
+            }
+
+            try {
+                getXinJiangArticleService.getXinJiang();
+                System.out.println("------------getXinJiang-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getXinJiang-------error--------------");
+            }
+
+            try {
+                getYunNanArticleService.getYunNan();
+                System.out.println("------------getYunNan-------success--------------");
+            } catch (Exception e) {
+                System.out.println("------------getYunNan-------error--------------");
+            }
+
+            Date date = new Date();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String currentTime = sdf.format(date);
+            System.out.println("currentTime--------"+ currentTime +"------All finish");
+        }
+    }
+}

+ 0 - 0
src/main/java/com/example/mos/service/QuartzTask/AutoGetWeChatArticleService.java


部分文件因为文件数量过多而无法显示