From d955b1116564d08b01657c18bd4cbed990639529 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 12:21:45 +0800 Subject: [PATCH 1/8] =?UTF-8?q?ci:=20=E5=88=9B=E5=BB=BA=20GitHub=20Actions?= =?UTF-8?q?=20=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=87=AA=E5=8A=A8=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ novel-common/pom.xml | 24 ++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7a0dbeb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Create novel-plus Maven Release with ZIPs + +on: + push: + # 匹配所有以'v'开头的标签 + tags: + - 'v*' + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + # 可选,默认是 temurin,也可以选择其他发行版 + distribution: 'temurin' + + - name: Build project with Maven + run: mvn clean install -DskipTests=true + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # 使用 tag_name 而不是 github.ref + tag_name: ${{ github.ref_name }} + release_name: novel-plus ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload all *.zip artifacts from submodules + run: | + for module in novel-common novel-crawl novel-front novel-admin + do + for file in $(find ./$module/target/build -type f -name "*.zip") + do + asset_path="$file" + asset_name=$(basename "$file") + echo "Uploading $asset_name..." + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/zip" \ + --data-binary @"$file" \ + "${{ steps.create_release.outputs.upload_url }}?name=$asset_name" + done + done \ No newline at end of file diff --git a/novel-common/pom.xml b/novel-common/pom.xml index 1b9292b..6b4a68b 100644 --- a/novel-common/pom.xml +++ b/novel-common/pom.xml @@ -130,5 +130,29 @@ + + + + maven-antrun-plugin + 1.8 + + + package + + run + + + + + + + + + + + + + + \ No newline at end of file From 6cdb68899bc7c5708ed2ee4b21b83e643e260675 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 13:26:10 +0800 Subject: [PATCH 2/8] =?UTF-8?q?ci:=20GitHub=20Actions=20=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E4=B8=AD=E5=A4=AE=E4=BB=93=E5=BA=93=E4=B8=8B=E8=BD=BD=20maven?= =?UTF-8?q?=20=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- novel-admin/pom.xml | 31 +++++++++++++++++++++++++++++++ pom.xml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a0dbeb..6ac888f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: distribution: 'temurin' - name: Build project with Maven - run: mvn clean install -DskipTests=true + run: mvn clean install -DskipTests=true -Pcentral-repo - name: Create Release id: create_release diff --git a/novel-admin/pom.xml b/novel-admin/pom.xml index b1d9fad..1140350 100644 --- a/novel-admin/pom.xml +++ b/novel-admin/pom.xml @@ -332,4 +332,35 @@ + + + + + central-repo + + + central + https://repo.maven.apache.org/maven2/ + + true + + + false + + + + + + central-plugin + https://repo.maven.apache.org/maven2/ + + true + + + false + + + + + diff --git a/pom.xml b/pom.xml index 4ac1f58..661c29d 100644 --- a/pom.xml +++ b/pom.xml @@ -113,4 +113,35 @@ + + + + + central-repo + + + central + https://repo.maven.apache.org/maven2/ + + true + + + false + + + + + + central-plugin + https://repo.maven.apache.org/maven2/ + + true + + + false + + + + + From 5dcc2b0b46f9614b30e53081e7c4d7ae3d9c13a2 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 13:27:46 +0800 Subject: [PATCH 3/8] =?UTF-8?q?v5.0.1=20=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- novel-admin/pom.xml | 2 +- novel-common/pom.xml | 2 +- novel-crawl/pom.xml | 2 +- novel-front/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/novel-admin/pom.xml b/novel-admin/pom.xml index 1140350..e32cea5 100644 --- a/novel-admin/pom.xml +++ b/novel-admin/pom.xml @@ -5,7 +5,7 @@ com.java2nb novel-admin - 5.0.1-SNAPSHOT + 5.0.1 jar novel-admin diff --git a/novel-common/pom.xml b/novel-common/pom.xml index 6b4a68b..ed24e2f 100644 --- a/novel-common/pom.xml +++ b/novel-common/pom.xml @@ -5,7 +5,7 @@ novel com.java2nb - 5.0.1-SNAPSHOT + 5.0.1 4.0.0 diff --git a/novel-crawl/pom.xml b/novel-crawl/pom.xml index f0e6a6a..8f63044 100644 --- a/novel-crawl/pom.xml +++ b/novel-crawl/pom.xml @@ -5,7 +5,7 @@ novel com.java2nb - 5.0.1-SNAPSHOT + 5.0.1 4.0.0 diff --git a/novel-front/pom.xml b/novel-front/pom.xml index c5e315a..57c8f18 100644 --- a/novel-front/pom.xml +++ b/novel-front/pom.xml @@ -5,7 +5,7 @@ novel com.java2nb - 5.0.1-SNAPSHOT + 5.0.1 4.0.0 diff --git a/pom.xml b/pom.xml index 661c29d..d03c874 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.java2nb novel - 5.0.1-SNAPSHOT + 5.0.1 novel-common novel-front From c0634a335ed8d0ebe79f90b03b2e7d12bbd0ac67 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 14:48:42 +0800 Subject: [PATCH 4/8] =?UTF-8?q?ci:=20GitHub=20Actions=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?ZIP=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 49 +++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ac888f..79e8a3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,19 +36,36 @@ jobs: draft: false prerelease: false - - name: Upload all *.zip artifacts from submodules - run: | - for module in novel-common novel-crawl novel-front novel-admin - do - for file in $(find ./$module/target/build -type f -name "*.zip") - do - asset_path="$file" - asset_name=$(basename "$file") - echo "Uploading $asset_name..." - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: application/zip" \ - --data-binary @"$file" \ - "${{ steps.create_release.outputs.upload_url }}?name=$asset_name" - done - done \ No newline at end of file + + # 使用 action 来替代直接 curl 进行上传 + - name: Upload sql.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-common/target/build/sql.zip + asset_name: sql.zip + asset_content_type: application/zip + + - name: Upload novel-crawl.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-crawl/target/build/novel-crawl.zip + asset_name: novel-crawl.zip + asset_content_type: application/zip + + - name: Upload novel-front.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-front/target/build/novel-front.zip + asset_name: novel-front.zip + asset_content_type: application/zip + + - name: Upload novel-admin.zip + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/novel-admin/target/build/novel-admin.zip + asset_name: novel-admin.zip + asset_content_type: application/zip \ No newline at end of file From 73654dda2b62016dfcdddb1be108a67bc8af38c4 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 14:58:26 +0800 Subject: [PATCH 5/8] =?UTF-8?q?ci:=20GitHub=20Actions=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79e8a3a..229bd24 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,8 @@ jobs: # 使用 action 来替代直接 curl 进行上传 - name: Upload sql.zip uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ${{ github.workspace }}/novel-common/target/build/sql.zip @@ -48,6 +50,8 @@ jobs: - name: Upload novel-crawl.zip uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ${{ github.workspace }}/novel-crawl/target/build/novel-crawl.zip @@ -56,6 +60,8 @@ jobs: - name: Upload novel-front.zip uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ${{ github.workspace }}/novel-front/target/build/novel-front.zip @@ -64,6 +70,8 @@ jobs: - name: Upload novel-admin.zip uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ${{ github.workspace }}/novel-admin/target/build/novel-admin.zip From 06074faf9af103fcccb2437baa073c1f60ba9add Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 17:30:18 +0800 Subject: [PATCH 6/8] =?UTF-8?q?feat(pc):=20=E7=A7=BB=E9=99=A4=E4=B9=A6?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/user/favorites.html | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/novel-front/src/main/resources/templates/user/favorites.html b/novel-front/src/main/resources/templates/user/favorites.html index 985bec0..92facf3 100644 --- a/novel-front/src/main/resources/templates/user/favorites.html +++ b/novel-front/src/main/resources/templates/user/favorites.html @@ -53,7 +53,7 @@ 更新时间 - 书签 + 操作 @@ -94,7 +94,7 @@ var bookShelfListHtml = ""; for (var i = 0; i < bookShelfList.length; i++) { var book = bookShelfList[i]; - bookShelfListHtml += (" \n" + + bookShelfListHtml += (" \n" + " \n" + " [" + book.catName + "]\n" + " \n" + @@ -109,7 +109,8 @@ " " + book.lastIndexUpdateTime + "\n" + " \n" + " \n" + - "继续阅读" + + "
继续阅读
" + + "
移除书架
" + " \n" + " "); } @@ -160,5 +161,21 @@ }) } + + function removeFromBookShelf(bookId) { + + $.ajax({ + type: "delete", + url: "/user/removeFromBookShelf/" + bookId, + data: {}, + dataType: "json", + success: function (data) { + if (data.code == 200) { + $("#shelf" + bookId).remove(); + } + } + }); + + } From ec9674f2aaac006b8d56d3bc12fa1d9e8e2a5d1d Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 21:51:51 +0800 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20=E7=A7=BB=E5=87=BA=E4=B9=A6?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/mobile/user/favorites.html | 138 +++++++++++++++--- .../resources/templates/user/favorites.html | 2 +- 2 files changed, 121 insertions(+), 19 deletions(-) diff --git a/novel-front/src/main/resources/templates/mobile/user/favorites.html b/novel-front/src/main/resources/templates/mobile/user/favorites.html index 44d3d44..793c76f 100644 --- a/novel-front/src/main/resources/templates/mobile/user/favorites.html +++ b/novel-front/src/main/resources/templates/mobile/user/favorites.html @@ -20,6 +20,28 @@ - @@ -95,6 +127,10 @@ +
@@ -105,11 +141,12 @@ -
diff --git a/novel-front/src/main/resources/templates/user/favorites.html b/novel-front/src/main/resources/templates/user/favorites.html index 92facf3..08ebb60 100644 --- a/novel-front/src/main/resources/templates/user/favorites.html +++ b/novel-front/src/main/resources/templates/user/favorites.html @@ -110,7 +110,7 @@ " \n" + " \n" + "
继续阅读
" + - "
移除书架
" + + "
移出书架
" + " \n" + " "); } From e4e511aed867b88187db7b364670c04c640a6238 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Thu, 20 Mar 2025 22:03:10 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=E7=A7=BB=E5=87=BA=E4=B9=A6?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../green/html/mobile/user/favorites.html | 138 +++++++++++++++--- templates/green/html/user/favorites.html | 23 ++- 2 files changed, 140 insertions(+), 21 deletions(-) diff --git a/templates/green/html/mobile/user/favorites.html b/templates/green/html/mobile/user/favorites.html index 44d3d44..793c76f 100644 --- a/templates/green/html/mobile/user/favorites.html +++ b/templates/green/html/mobile/user/favorites.html @@ -20,6 +20,28 @@ - @@ -95,6 +127,10 @@ +
@@ -105,11 +141,12 @@ -
diff --git a/templates/green/html/user/favorites.html b/templates/green/html/user/favorites.html index 985bec0..08ebb60 100644 --- a/templates/green/html/user/favorites.html +++ b/templates/green/html/user/favorites.html @@ -53,7 +53,7 @@ 更新时间 - 书签 + 操作 @@ -94,7 +94,7 @@ var bookShelfListHtml = ""; for (var i = 0; i < bookShelfList.length; i++) { var book = bookShelfList[i]; - bookShelfListHtml += (" \n" + + bookShelfListHtml += (" \n" + " \n" + " [" + book.catName + "]\n" + " \n" + @@ -109,7 +109,8 @@ " " + book.lastIndexUpdateTime + "\n" + " \n" + " \n" + - "继续阅读" + + "
继续阅读
" + + "
移出书架
" + " \n" + " "); } @@ -160,5 +161,21 @@ }) } + + function removeFromBookShelf(bookId) { + + $.ajax({ + type: "delete", + url: "/user/removeFromBookShelf/" + bookId, + data: {}, + dataType: "json", + success: function (data) { + if (data.code == 200) { + $("#shelf" + bookId).remove(); + } + } + }); + + }