Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 上线 kt 版本 #166

Merged
merged 185 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
3eaf133
修改默认情况下显示评分不足时所需的评分量,并允许该项配置修改
Lixuhuilll Nov 17, 2023
f075b8e
修改配置中的阈值为50
Lixuhuilll Nov 17, 2023
47481a9
修改@Value注入的方式以及maaCopilotProperties.copilot的默认值,唯一的好处是修改默认值只需要改一个地方
Lixuhuilll Nov 17, 2023
625e2ba
修改阈值的注入方式
Lixuhuilll Nov 17, 2023
238f6a9
启用响应体自动压缩,进一步节约服务器带宽
Lixuhuilll Nov 17, 2023
9091b28
调整 Etag 过滤器的工作逻辑,使得自动压缩能正确处理全局的 min-response-size
Lixuhuilll Nov 18, 2023
095cdff
优化 ETag 过滤器的工作逻辑
Lixuhuilll Nov 18, 2023
c2e2f1f
进一步优化 ETag 过滤器的工作逻辑
Lixuhuilll Nov 18, 2023
26d5924
进一步优化 ETag 过滤器的工作逻辑,使其支持 URI Pattern 语法进行匹配
Lixuhuilll Nov 18, 2023
24c34c3
优化 URI Pattern 匹配的性能
Lixuhuilll Nov 18, 2023
c3bccdd
优化代码可读性
Lixuhuilll Nov 19, 2023
565c4d1
Merge pull request #146 from Lixuhuilll/NotEnoughRating
LuoRenMu Nov 19, 2023
041fd20
功能拆分,将 ETag 和获取 Content-Length 分为两个过滤器
Lixuhuilll Nov 19, 2023
65b895c
添加 ContentLengthRepairFilter 的条件装配
Lixuhuilll Nov 19, 2023
80e4731
热度排行实现降低未开放关卡权重的功能
Lixuhuilll Nov 23, 2023
e515a48
过滤 null 值
Lixuhuilll Nov 23, 2023
516fc43
改为只通过地图前缀匹配是否开放。优化 Json 解析过程。
Lixuhuilll Nov 24, 2023
a6584fe
修改 arkLevel 的迭代方式
Lixuhuilll Nov 24, 2023
87b4f14
refactor: enable profile to specify max quantity of jwt login devices
Handiwork Nov 25, 2023
4a307d8
地图数据适配新危机合约
Lixuhuilll Nov 27, 2023
e6f498a
修改 EmailService 注入自身代理类的方式,因为 JUnit 不兼容 @Lazy,测试时会报错
Lixuhuilll Nov 28, 2023
e565dab
补充单元测试
Lixuhuilll Nov 28, 2023
863d843
创建新的工具类。补充单元测试
Lixuhuilll Nov 28, 2023
6307307
优化关卡开放状态更新服务,支持危机合约的关卡开放状态更新
Lixuhuilll Nov 28, 2023
7831fe5
优化开放状态更新任务,减少已关闭地图的热度惩罚
Lixuhuilll Nov 29, 2023
52ecb46
活动信息不太准确,减少匹配为关闭的数量
Lixuhuilll Nov 29, 2023
cdd199b
修改正则表达式。优化测试用例。
Lixuhuilll Dec 1, 2023
ad09685
同步GameData失败后不执行后续流程
Lixuhuilll Dec 2, 2023
cd6a1bd
Revert "修改 EmailService 注入自身代理类的方式,因为 JUnit 不兼容 @Lazy,测试时会报错"
Lixuhuilll Dec 7, 2023
e7e25c5
去除 EmailService 中的循环依赖,避免与 AOT 的兼容性问题
Lixuhuilll Dec 7, 2023
dcec28b
fix: 修复由于aot插件导致的编译后jar包无法直接运行的问题(暂时注释aot插件)
dragove Dec 7, 2023
6743d06
Merge pull request #147 from Lixuhuilll/compression
dragove Dec 9, 2023
e01f95a
GitHub json 响应的字段名样式统一配置为 SnakeCase
Lixuhuilll Dec 11, 2023
f55e691
Merge pull request #148 from Lixuhuilll/ArkLevelOpen
dragove Dec 11, 2023
09219c5
Merge branch 'MaaAssistantArknights:dev' into crisis
Lixuhuilll Dec 12, 2023
30116a6
优化危机合约地图信息的 CatTwo 字段,使其为本次危机合约的赛季名称
Lixuhuilll Dec 12, 2023
5f372d3
地图信息新增服务器认为的关闭时间。作业热度惩罚仅限首次上传时间于地图关闭前。
Lixuhuilll Dec 12, 2023
aba8761
修改 findByLevelIdFuzzy 的返回值类型,该方法的返回值从未用于响应给前端
Lixuhuilll Dec 12, 2023
eeeef6f
/version 接口返回值返回编译时对应的 commit 的 abbreviatedId 以及 dateTime
Lixuhuilll Dec 13, 2023
9a96506
调整 Git 仓库不存在时的处理流程
Lixuhuilll Dec 13, 2023
6919a6d
Merge pull request #149 from Lixuhuilll/crisis
dragove Dec 13, 2023
72aa329
Merge pull request #152 from Lixuhuilll/version-show-commit
dragove Dec 13, 2023
9ea4bcb
优化 RedisCache 的删除性能
Lixuhuilll Dec 21, 2023
c50dcb6
fixup! /version 接口返回值返回编译时对应的 commit 的 abbreviatedId 以及 dateTime
Lixuhuilll Dec 23, 2023
0981269
Merge pull request #150 from Lixuhuilll/cancel-emailservice-circular-…
dragove Dec 24, 2023
93b5529
改为使用现成的插件生成 git.properties
Lixuhuilll Dec 25, 2023
429d418
Merge pull request #156 from Lixuhuilll/git-properties
dragove Dec 25, 2023
13781ad
Merge pull request #151 from Lixuhuilll/closeTime
dragove Dec 25, 2023
df021f2
feat: 迁移自增 id 生成组建为单独工具
dragove Dec 25, 2023
7b7963d
Merge pull request #154 from Lixuhuilll/optimize-redicache
dragove Dec 27, 2023
55f72fc
refactor: 重新抽象自增id功能,建立集合元数据类型,使用元数据自动获取最大id并用于生成之后需要使用的id数据
dragove Dec 27, 2023
62161e2
feat: 作业集添加名称、描述、状态信息
dragove Jan 1, 2024
330fb12
feat: 实现创建作业集接口
dragove Jan 1, 2024
6852470
Merge branch 'MaaAssistantArknights:dev' into feature/copilot-set
dragove Jan 1, 2024
784cab9
feat: 向作业集中添加作业id列表接口
dragove Jan 2, 2024
a3c3f1c
fix: 修复校验未生效的问题
dragove Jan 2, 2024
4fda510
feat: 往作业集中删除作业接口
dragove Jan 2, 2024
999c4b6
feat: 添加更新作业集信息接口
dragove Jan 2, 2024
74170cd
评论响应点踩数量
Lixuhuilll Jan 3, 2024
0504e3e
减少转换器中不必要的参数
Lixuhuilll Jan 3, 2024
e434f97
feat: 添加作业集删除接口
dragove Jan 5, 2024
b825a02
chore: CommonIdInput -> CommonIdReq
dragove Jan 5, 2024
ed4582a
feat: 作业集列表查询接口
dragove Jan 6, 2024
688c2d6
feat: 作业集详情接口
dragove Jan 6, 2024
9583a17
feat: 作业列表查询接口,添加支持根据作业id列表查询
dragove Jan 6, 2024
022e48b
Merge pull request #158 from Lixuhuilll/comment-dislike
LuoRenMu Jan 9, 2024
3da616c
Merge pull request #157 from dragove/feature/copilot-set
dragove Jan 14, 2024
5fd1b7e
fix: 修复生成文档错误
dragove Jan 14, 2024
673a709
refactor: extract security requirement annotation
Handiwork Jan 20, 2024
06f6aec
Rename .java to .kt
Handiwork Jan 25, 2024
857bb85
feat: add kotlin support
Handiwork Jan 25, 2024
ad07463
Rename .java to .kt
KevinT3Hu Feb 5, 2024
c62efd6
refactor: migrate ArkGameDataService and some data types to kt
KevinT3Hu Feb 5, 2024
42bc972
fix: null in ArkStage deserialization
KevinT3Hu Feb 5, 2024
2180ef5
Rename .java to .kt
KevinT3Hu Feb 5, 2024
9443548
refactor: more services in kotlin
KevinT3Hu Feb 5, 2024
0fb82fc
fix: log format corrected
KevinT3Hu Feb 5, 2024
1e45e81
Rename .java to .kt
KevinT3Hu Feb 5, 2024
caddcae
refactor: more services rewritten in kotlin
KevinT3Hu Feb 5, 2024
a5c418b
perf: add @JvmStatic annotation for companion object val
KevinT3Hu Feb 5, 2024
295bb44
Merge pull request #161 from KevinT3Hu/kt
Handiwork Feb 6, 2024
3e27696
Rename .java to .kt
KevinT3Hu Feb 6, 2024
6bec42d
refactor: migrate tasks to kotlin
KevinT3Hu Feb 6, 2024
630c434
fix: NoSuchMethodError with lombok
KevinT3Hu Feb 6, 2024
d600f7f
perf: remove some uses of java Stream and Collector
KevinT3Hu Feb 6, 2024
3b47527
Rename .java to .kt
KevinT3Hu Feb 6, 2024
45ecb41
refactor: migrate CopilotController and some services to kotlin
KevinT3Hu Feb 6, 2024
83b4883
Rename .java to .kt
KevinT3Hu Feb 7, 2024
3e01fdb
perf: remove several uses of java stream functions
KevinT3Hu Feb 7, 2024
e4eee6d
Rename .java to .kt
KevinT3Hu Feb 7, 2024
b6dd0b1
refactor: handlers in kotlin
KevinT3Hu Feb 7, 2024
497a44e
Rename .java to .kt
KevinT3Hu Feb 7, 2024
4ddefab
refactor: utils in kotlin
KevinT3Hu Feb 7, 2024
4f3d3cb
Rename .java to .kt
KevinT3Hu Feb 7, 2024
cf90f00
refactor: annotations in kotlin
KevinT3Hu Feb 7, 2024
4fd657a
Rename .java to .kt
KevinT3Hu Feb 7, 2024
b6a1d5b
perf: use kotlin functions instead of java counterparts
KevinT3Hu Feb 7, 2024
c89a74b
perf: remove usage of Consumer
KevinT3Hu Feb 7, 2024
5a9fcda
Merge pull request #162 from KevinT3Hu/kt
Handiwork Feb 7, 2024
bbff885
fix: remove lombok annotation
KevinT3Hu Feb 7, 2024
10e10ce
Rename .java to .kt
KevinT3Hu Feb 7, 2024
abd621d
refactor: aop in kotlin
KevinT3Hu Feb 7, 2024
4e74f27
Rename .java to .kt
KevinT3Hu Feb 8, 2024
91a9345
refactor: EmailBusinessObject in kotlin
KevinT3Hu Feb 8, 2024
ddafd7c
Rename .java to .kt
KevinT3Hu Feb 8, 2024
c80e3ed
refactor: converters in kotlin
KevinT3Hu Feb 8, 2024
4dc0833
perf: remove uses of Java stream
KevinT3Hu Feb 8, 2024
941bd91
Rename .java to .kt
KevinT3Hu Feb 8, 2024
d70816f
refactor: controllers in kotlin
KevinT3Hu Feb 8, 2024
9c62c43
Rename .java to .kt
KevinT3Hu Feb 8, 2024
3f50763
refactor: configs in kotlin
KevinT3Hu Feb 8, 2024
47d99c9
Rename .java to .kt
KevinT3Hu Feb 8, 2024
9228152
refactor: FileController in kotlin
KevinT3Hu Feb 8, 2024
3c6ffa4
fix: rollback CopilotSetType
KevinT3Hu Feb 8, 2024
9adfbe0
fix: rollback CopilotSetType
KevinT3Hu Feb 8, 2024
e647515
Rename .java to .kt
dragove Feb 10, 2024
fd0648a
refactor: 将所有单元测试迁移到kt
dragove Feb 10, 2024
fb61242
Rename .java to .kt
dragove Feb 11, 2024
a7b2dde
refactor: 将迁移至kotlin的部分单独放到kotlin源代码目录中
dragove Feb 11, 2024
edc01c4
Rename .java to .kt
dragove Feb 11, 2024
c300e62
refactor: 迁移评论相关功能 pojo 类到 kotlin
dragove Feb 11, 2024
83e3eea
Rename .java to .kt
dragove Feb 11, 2024
c8e8636
refactor: 迁移评论相关功能 pojo 类到 kotlin
dragove Feb 11, 2024
564f486
Rename .java to .kt
dragove Feb 11, 2024
4108706
refactor: 迁移作业相关功能 pojo 类到 kotlin
dragove Feb 11, 2024
4129cc2
Rename .java to .kt
dragove Feb 11, 2024
e92d35c
refactor: 迁移作业集相关功能 pojo 类到 kotlin
dragove Feb 11, 2024
45a60eb
refactor: 迁移作业集相关功能 pojo 类到 kotlin
dragove Feb 11, 2024
6d8f613
fix: 修复作业信息返回字段的名称错误
dragove Feb 11, 2024
99187a7
Rename .java to .kt
dragove Feb 11, 2024
6519097
refactor: CommonIdReq 和 MaaResultException 迁移至 kotlin
dragove Feb 11, 2024
8c6fa54
refactor: 迁移漏掉的作业集类到 kotlin
dragove Feb 12, 2024
ef3c0af
fix: 修复部分类型访问限定的问题
dragove Feb 12, 2024
998d37a
Rename .java to .kt
dragove Feb 12, 2024
ddf16f4
refactor: 返回类型使用和类型区分成功和失败
dragove Feb 12, 2024
93e2a0c
refactor: 移动 controller 到 kotlin 目录下
dragove Feb 12, 2024
939dc42
Rename .java to .kt
dragove Feb 12, 2024
d587bb1
fix: 修复 RedisCache 在存储kt对象时报错的问题
dragove Feb 12, 2024
de18347
Rename .java to .kt
dragove Feb 12, 2024
9d0caf9
refactor: 迁移 Repository 类型到 kotlin
dragove Feb 12, 2024
5c59307
perf: remove some uses of java Consumer and Supplier
KevinT3Hu Feb 13, 2024
58097ed
Rename .java to .kt
dragove Feb 13, 2024
b307285
refactor: 迁移 repository 中除了 Copilot 类之外的所有实体类到 kotlin
dragove Feb 13, 2024
4c8928c
Rename .java to .kt
dragove Feb 14, 2024
9c0edd4
refactor: 迁移Copilot类型到kotlin
dragove Feb 14, 2024
cd855a8
fix: 修复id生成功能错误
dragove Feb 14, 2024
ba74182
revert: 回滚错误修改的任务触发节点
dragove Feb 14, 2024
9fa7d89
refactor: 迁移 repository 到 kotlin 目录下
dragove Feb 14, 2024
6e244bd
Rename .java to .kt
dragove Feb 14, 2024
c3fd0f8
refactor: 迁移关卡解析模块到 kotlin
dragove Feb 14, 2024
8e9df85
Rename .java to .kt
dragove Feb 14, 2024
df21eb0
refactor: 通用model类型迁移至kotlin
dragove Feb 14, 2024
853974f
Rename .java to .kt
dragove Feb 14, 2024
cc94035
fix: 修复单元测试编译错误
dragove Feb 14, 2024
c670b76
Rename .java to .kt
dragove Feb 14, 2024
6d730e1
refactor: 完成jwt相关类型到kotlin的迁移
dragove Feb 14, 2024
1224572
chore: 清理残留的 lombok 注解
dragove Feb 14, 2024
b37cf89
refactor: 将剩余文件迁移到kotlin目录
dragove Feb 14, 2024
576d9d8
fix: 修复遗漏的jwt返回类型错误
dragove Feb 14, 2024
83f6e51
chore: 去除 lombok 依赖
dragove Feb 14, 2024
3bff313
Merge pull request #163 from MaaAssistantArknights/kt
KevinT3Hu Feb 14, 2024
e0cb0a6
build: bump gradle version to 8.6 to support java 21
dragove Feb 14, 2024
81da68d
chore: 去除无用判断逻辑
dragove Feb 14, 2024
4e67165
refactor: 迁移 groovy 脚本到 kotlin,升级依赖版本,java21支持
dragove Feb 14, 2024
1bfb71a
fix: 修复swagger文档生成位置错误
dragove Feb 14, 2024
417fb64
chore: 更新ci任务和docker文件,修正swagger代码生成使用文件错误的问题
dragove Feb 14, 2024
9221f13
fix: 修复生产api客户端错误的问题
dragove Feb 16, 2024
b54e26a
Merge pull request #164 from dragove/dragove
dragove Feb 16, 2024
95bd748
ci: 修复 ci 中 url 替换错误的问题
dragove Feb 16, 2024
168dbb4
fix: 修复用户修改密码时未校验原密码的问题
dragove Feb 16, 2024
92d4cd8
work-around: change MaaResult from sealed interface to data class to …
Handiwork Feb 18, 2024
33edc35
feat: add basic support of kotlin coroutines
Handiwork Feb 18, 2024
5df1fa8
ci: update ci action versions to make GitHub happy
dragove Feb 18, 2024
733d25e
ci: update ci action versions to make GitHub happy
dragove Feb 18, 2024
1a66556
fix: timezone is missing when serializing LocalDateTime
Handiwork Feb 20, 2024
901e3bd
refactor: simplify AccessLimitInterceptor and remove SpringUtil class…
Handiwork Feb 21, 2024
c77be4f
fix: incorrect usage of openapi @Parameter annotation
Handiwork Feb 22, 2024
22856f5
refactor: change type of CommentsAddDTO#copilotId from String to Long
Handiwork Feb 22, 2024
925ee5d
refactor: remove `@CurrentUser`
Handiwork Feb 23, 2024
3c59af5
refactor: remove `EmailBusinessObject`
Handiwork Feb 24, 2024
7966ea8
doc: update README.md
Handiwork Feb 27, 2024
03c94bd
fix: type of GithubTree#url
Handiwork Feb 29, 2024
3d19287
fix: jwt type checking
Handiwork Feb 29, 2024
08edb42
ci: add options for dockerfile
dragove Mar 2, 2024
745605b
ci: update dockerfile
dragove Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 11 additions & 11 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history
Expand All @@ -39,10 +39,10 @@ jobs:
major-identifier: "breaking:"
minor-identifier: "feature:"

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
distribution: temurin
java-version: 21

# - name: Startup Mongodb
# uses: supercharge/[email protected]
Expand All @@ -52,11 +52,11 @@ jobs:

- name: Remove aliyun maven mirror
run: |
sed -i '/maven {/,+2d' build.gradle
sed -i '/maven(url/d' build.gradle.kts

- name: Set versions
run: |
sed -i "s/^version.*$/version '${{ steps.version.outputs.version }}'/g" build.gradle
sed -i "s/^version.*$/version = \"${{ steps.version.outputs.version }}\"/g" build.gradle.kts
sed -i 's/"packageVersion.*,/"packageVersion": "${{ steps.version.outputs.version }}",/g' client-config/cpp.json
sed -i 's/"packageVersion.*,/"packageVersion": "${{ steps.version.outputs.version }}",/g' client-config/csharp-netcore.json
sed -i 's/"packageVersion.*,/"packageVersion": "${{ steps.version.outputs.version }}",/g' client-config/rust.json
Expand All @@ -71,31 +71,31 @@ jobs:
run: ./gradlew generateSwaggerCode

- name: upload openapi
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openapi-${{ steps.version.outputs.version }}
path: ./build/docs/swagger.json

- name: upload cpp client
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cpp-client
path: ./build/clients/cpp-client/*

- name: upload csharp client
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: csharp-client
path: ./build/clients/csharp-client/*

- name: upload rust client
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rust-client
path: ./build/clients/rust-client/*

- name: upload ts client
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ts-client
path: ./build/clients/ts-fetch-client/*
21 changes: 11 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history
Expand All @@ -42,48 +42,49 @@ jobs:
export TRUNCATED_GITHUB_SHA=$(echo ${{ github.sha }} | cut -c1-7);
echo "VERSION_TAG=${GITHUB_REF/refs\/heads\//}-${TRUNCATED_GITHUB_SHA}" >> $GITHUB_ENV

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
distribution: temurin
java-version: 21

- name: Remove aliyun maven mirror
run: |
sed -i '/maven {/,+2d' build.gradle
sed -i '/maven(url/d' build.gradle.kts

- name: Set Java version
run: |
sed -i "s/^version.*$/version '${{ steps.version.outputs.version }}'/g" build.gradle
sed -i "s/^version.*$/version = \"${{ steps.version.outputs.version }}\"/g" build.gradle.kts

- name: Build jar
run: ./gradlew bootJar

- name: Upload jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jar
path: ./build/libs/*

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'dev') }}
type=raw,value={{branch}}-{{sha}}

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,33 @@ jobs:
runs-on: ubuntu-latest
steps:
#checkout代码
- uses: actions/checkout@v3
- uses: actions/checkout@v4
#安装graalvm
- name: 安装graalvm
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '17'
components: 'native-image'
java-version: '21'
#查看版本信息
- name: 查看版本信息
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
gu --version
native-image --version
#校验Gradle wrapper
- name: 校验Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
#使用Gradle编译项目
- name: 使用Gradle编译项目
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: bootBuildImage

# 登录docker仓库
- name: 登录docker仓库 ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM amazoncorretto:17-alpine as runner
FROM amazoncorretto:21-alpine as runner
WORKDIR /app
COPY ./build/libs/MaaBackendCenter*.jar /MaaBackendCenter.jar
COPY ./build/libs/MaaBackendCenter*.jar /app/app.jar
EXPOSE 7000-9000
ENTRYPOINT ["java", "-jar", "/MaaBackendCenter.jar"]
ENTRYPOINT ["java", "-jar", "app.jar", "${JAVA_OPTS}"]
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# MaaBackendCenter

使用 Java 重写的 MAA 作业服务器后端
使用 Kotlin(Java) 重写的 MAA 作业服务器后端

## 开发技术栈

- Java 17
- kotlin 1.9 (Java 21)
- SpringBoot 3
- spring-security
- springdoc-openapi
- MongoDB
- Redis

## 本地开发指南

1. 下载安装 jdk 17 或者以上版本的 jdk,可以考虑从 [zuluJDK](https://www.azul.com/downloads/?version=java-17-lts&package=jdk) 或者 [libreicaJDK](https://bell-sw.com/pages/downloads/#/java-17-lts) 下载安装
2. 你需要一个有redis和mongoDB的环境,如果你是windows用户,可以从 https://github.com/tporadowski/redis 中下载版本较旧的 redis 使用
3. 使用你喜欢的 IDE 导入此项目,修改 /src/main/resources/application-template.yml 中的数据库配置以符合你自己配置的环境
4. 运行 MainApplication 类里的 main 方法
5. 首次运行建议修改 ArkLevelSyncTask 类的scheduled注解的参数,这样可以将明日方舟中的关卡数据同步到你本地的 mongodb 中,为了防止反复调用造成调试的麻烦,建议首次运行同步成功后再将代码修改回去
1. 使用你喜欢的 IDE 导入此项目,修改 /src/main/resources/application-template.yml 中的数据库配置以符合你自己配置的环境
2. 下载安装 JDK 21 或者以上版本的 jdk,可以考虑从 [zuluJDK](https://www.azul.com/downloads/?version=java-17-lts&package=jdk) 或者 [libreicaJDK](https://bell-sw.com/pages/downloads/#/java-17-lts) 下载安装。 Jetbrains Idea 可以使用自带的 JDK 管理器进行下载。
3. 你需要一个有redis和mongoDB的环境,如果你是windows用户,可以从 https://github.com/tporadowski/redis 中下载版本较旧的 redis 使用。 您也可以直接使用 `./dev-docker/docker-compose.yml` 来启动 docker 服务。
4. 运行 `./gradlew bootRun`, windows 环境为 `./gradlew.bat bootRun`
5. 首次运行建议修改 ArkLevelSyncTask 类的 scheduled 注解的参数,这样可以将明日方舟中的关卡数据同步到你本地的 mongodb 中,为了防止反复调用造成调试的麻烦,建议首次运行同步成功后再将代码修改回去

## 项目结构

- config 存放spring配置
- controller 交互层
- request 入参类型
- response 响应类型
- repository 数据仓库层,用于和数据库交互
- entity 与数据库字段对应的类型
- service 业务处理层,复杂或者公用逻辑放在这里(注:您无需为每个类型都提供对应接口,只有当接口在可见未来有多个实现的时候才考虑建立接口)
- model 应用内传输用类型放这里
- utils 工具类
- config # 存放 spring 配置
- common # 共享的逻辑
- controller # 交互层
- request # 入参类型
- response # 响应类型
- repository # 数据仓库层,用于和数据库交互
- entity # 与数据库字段对应的类型
- service # 业务处理层,复杂或者公用逻辑放在这里(注:您无需为每个类型都提供对应接口,只有当接口在可见未来有多个实现的时候才考虑建立接口)
- model # 应用内传输用类型放这里

## 编译与部署

1. 安装 jdk17,可以考虑从 [zuluJDK](https://www.azul.com/downloads/?version=java-17-lts&package=jdk) 或者 [libreicaJDK](https://bell-sw.com/pages/downloads/#/java-17-lts) 下载
1. 安装 JDK 21,可以考虑从 [zuluJDK](https://www.azul.com/downloads/?version=java-17-lts&package=jdk) 或者 [libreicaJDK](https://bell-sw.com/pages/downloads/#/java-17-lts) 下载
2. clone 此项目 `git clone https://github.com/MaaAssistantArknights/MaaBackendCenter.git`
3. 进入此项目目录 `cd MaaBackendCenter`
4. 编译项目 `./gradlew bootJar -x processAot`,windows环境下请使用 `gradlew.bat bootJar -x processAot`
4. 编译项目 `./gradlew bootJar -x processAot`,windows 环境下请使用 `gradlew.bat bootJar -x processAot`
5. 获得编译后的 jar 文件 `cp ./build/libs/MaaBackendCenter-1.0-SNAPSHOT.jar .`
6. 复制一份配置文件 `cp ./build/resources/main/application-template.yml ./application-prod.yml`
7. 修改配置文件 `application-prod.yml`
Expand All @@ -45,7 +44,7 @@
## native 编译(暂时废弃,如果希望协助维护,请查看native分支)

1. 安装 [GraalVM](https://github.com/graalvm/graalvm-ce-builds/releases)
Java17,并配置好环境变量,部分功能需要正确配置 `JAVA_HOME` 变量为 GraalVM 安装目录才能正常使用
Java21,并配置好环境变量,部分功能需要正确配置 `JAVA_HOME` 变量为 GraalVM 安装目录才能正常使用
2. 如果您处于 Windows 环境下,需要安装 `Visual Studio` 并且安装 C++ 组件,Linux 环境下则需要安装 `gcc` 工具链,Mac
下需要安装 `xcode`
工具链,详情查看 [native-image#prerequisites](https://www.graalvm.org/22.3/reference-manual/native-image/#prerequisites)
Expand Down
129 changes: 0 additions & 129 deletions build.gradle

This file was deleted.

Loading
Loading