mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 16:16:37 +08:00
更新 license .github
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "new-async-task"
|
name: "new-async-task"
|
||||||
description: "项目专用:指导如何在本项目中新增异步任务(TaskHandler),包括常量定义、参数传递(TaskParam)、PayloadValidator 接口、处理器实现、注册、Cron 调度、AppendLog 日志规范等完整步骤。"
|
description: "项目专用:指导如何在 wavelet 项目中新增异步任务(TaskHandler)。当用户提到新增任务、Asynq、后台任务、定时任务、任务日志、任务重试、TaskMeta、TaskParam 或 PayloadValidator 时必须使用本技能,覆盖常量定义、参数校验、处理器实现、统一注册、Worker 路由、Cron 调度、AppendLog 日志和测试验证。"
|
||||||
---
|
---
|
||||||
|
|
||||||
# 新增异步任务开发指南
|
# 新增异步任务开发指南
|
||||||
@@ -29,7 +29,8 @@ TaskHandler.Execute (← 你写这一步)
|
|||||||
- `internal/task/handler.go` — `TaskHandler` 接口、`TaskResult` 类型、`PayloadValidator` 可选接口
|
- `internal/task/handler.go` — `TaskHandler` 接口、`TaskResult` 类型、`PayloadValidator` 可选接口
|
||||||
- `internal/task/constants.go` — 任务类型常量、`TaskMeta`、`TaskParam`、`DispatchableTasks`
|
- `internal/task/constants.go` — 任务类型常量、`TaskMeta`、`TaskParam`、`DispatchableTasks`
|
||||||
- `internal/task/executor.go` — 注册、下发、执行、日志追加、参数校验分发
|
- `internal/task/executor.go` — 注册、下发、执行、日志追加、参数校验分发
|
||||||
- `internal/task/worker/worker.go` — Worker 启动、处理器注册、路由
|
- `internal/task/handlers/register.go` — 内置任务处理器统一注册点,Admin API 和 Worker 都依赖它
|
||||||
|
- `internal/task/worker/worker.go` — Worker 启动、Asynq mux 路由、队列配置
|
||||||
- `internal/task/scheduler/scheduler.go` — Cron 定时调度
|
- `internal/task/scheduler/scheduler.go` — Cron 定时调度
|
||||||
- `internal/model/task_execution.go` — `TaskExecution` GORM 模型
|
- `internal/model/task_execution.go` — `TaskExecution` GORM 模型
|
||||||
- `internal/apps/admin/task/routers.go` — 管理 API(下发、查询、重试)
|
- `internal/apps/admin/task/routers.go` — 管理 API(下发、查询、重试)
|
||||||
@@ -216,20 +217,37 @@ type PayloadValidator interface {
|
|||||||
- 成功:返回 `&task.TaskResult{Message: "摘要", Detail: "可选详细JSON"}`。`ProcessTask` 会将 `Message + "\n" + Detail` 存入 `TaskExecution.Result`。
|
- 成功:返回 `&task.TaskResult{Message: "摘要", Detail: "可选详细JSON"}`。`ProcessTask` 会将 `Message + "\n" + Detail` 存入 `TaskExecution.Result`。
|
||||||
- 失败:返回 `nil, fmt.Errorf("...")`。`ProcessTask` 会将错误信息存入 `TaskExecution.ErrorMessage`,状态标记为 `failed`,并将 error 返回给 Asynq 触发自动重试。
|
- 失败:返回 `nil, fmt.Errorf("...")`。`ProcessTask` 会将错误信息存入 `TaskExecution.ErrorMessage`,状态标记为 `failed`,并将 error 返回给 Asynq 触发自动重试。
|
||||||
|
|
||||||
### 第 3 步:在 worker.go 注册
|
### 第 3 步:统一注册 Handler,并在 worker.go 添加路由
|
||||||
|
|
||||||
打开 `internal/task/worker/worker.go`,做两件事:
|
新增任务必须同时满足两条链路:
|
||||||
|
|
||||||
**1. 在 `init()` 中注册处理器**:
|
- Admin API 下发任务时能找到 Handler,从而调用 `PayloadValidator` 做服务端参数校验。
|
||||||
|
- Worker 消费 Asynq 消息时能路由到 `task.ProcessTask`,再由框架分发到 Handler。
|
||||||
|
|
||||||
|
#### 3.1 在 `internal/task/handlers/register.go` 注册处理器
|
||||||
|
|
||||||
|
打开 `internal/task/handlers/register.go`,导入你的业务模块并在 `Register()` 中注册:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func init() {
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/Rain-kl/Wavelet/internal/apps/upload"
|
||||||
|
"github.com/Rain-kl/Wavelet/internal/apps/user"
|
||||||
|
"github.com/Rain-kl/Wavelet/internal/task"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Register() {
|
||||||
task.RegisterHandler(task.CleanupUnusedUploadsTask, &upload.CleanupUnusedUploadsHandler{})
|
task.RegisterHandler(task.CleanupUnusedUploadsTask, &upload.CleanupUnusedUploadsHandler{})
|
||||||
task.RegisterHandler(task.SendEmailTask, &user.SendEmailHandler{})
|
task.RegisterHandler(task.SendEmailTask, &user.SendEmailHandler{})
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**2. 在 `StartWorker()` 的 mux 中添加路由**:
|
`Register()` 会被 Admin task API 和 Worker 共同调用。不要只在 `worker` 包里注册,否则 Admin dispatch 时 `ValidateAndNormalizePayload` 找不到 Handler,带参数任务会绕过 `PayloadValidator`。
|
||||||
|
|
||||||
|
#### 3.2 在 `internal/task/worker/worker.go` 添加 Asynq 路由
|
||||||
|
|
||||||
|
在 `StartWorker()` 的 mux 中添加任务类型路由:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
mux := asynq.NewServeMux()
|
mux := asynq.NewServeMux()
|
||||||
@@ -240,6 +258,14 @@ mux.HandleFunc(task.SendEmailTask, task.ProcessTask)
|
|||||||
|
|
||||||
所有路由都指向同一个 `task.ProcessTask`,它内部根据 Asynq task type 查找对应的 handler 分发执行。
|
所有路由都指向同一个 `task.ProcessTask`,它内部根据 Asynq task type 查找对应的 handler 分发执行。
|
||||||
|
|
||||||
|
`worker.go` 的 `init()` 应保持调用统一注册函数:
|
||||||
|
|
||||||
|
```go
|
||||||
|
func init() {
|
||||||
|
taskhandlers.Register()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### 第 4 步(可选):添加 Cron 定时调度
|
### 第 4 步(可选):添加 Cron 定时调度
|
||||||
|
|
||||||
如果任务需要定时执行,编辑 `internal/task/scheduler/scheduler.go`,在 `StartScheduler()` 中注册:
|
如果任务需要定时执行,编辑 `internal/task/scheduler/scheduler.go`,在 `StartScheduler()` 中注册:
|
||||||
@@ -289,6 +315,8 @@ scheduler:
|
|||||||
|
|
||||||
关键点:Admin dispatch handler (`routers.go`) 是**通用的**,不需要按任务类型写 if 分支。新增带参数的任务时,只需在 Handler 上实现 `ValidatePayload` 方法即可。
|
关键点:Admin dispatch handler (`routers.go`) 是**通用的**,不需要按任务类型写 if 分支。新增带参数的任务时,只需在 Handler 上实现 `ValidatePayload` 方法即可。
|
||||||
|
|
||||||
|
注意:`ValidateAndNormalizePayload` 依赖 Handler 已注册。新增任务后必须更新 `internal/task/handlers/register.go`,否则 Admin API 不会执行该任务的 `PayloadValidator`。
|
||||||
|
|
||||||
## AppendLog 使用指南
|
## AppendLog 使用指南
|
||||||
|
|
||||||
`task.AppendLog(ctx, format string, args ...interface{})` 在 `TaskHandler.Execute` 内部调用,将日志追加到 `TaskExecution.Log` 字段。管理端 API 可查看完整执行日志。
|
`task.AppendLog(ctx, format string, args ...interface{})` 在 `TaskHandler.Execute` 内部调用,将日志追加到 `TaskExecution.Log` 字段。管理端 API 可查看完整执行日志。
|
||||||
@@ -338,3 +366,23 @@ scheduler:
|
|||||||
- `internal/apps/upload/tasks.go` — `CleanupUnusedUploadsHandler`:无参数任务,展示游标分页批量处理、每批次 AppendLog、事务内操作、单条失败 continue 不终止。
|
- `internal/apps/upload/tasks.go` — `CleanupUnusedUploadsHandler`:无参数任务,展示游标分页批量处理、每批次 AppendLog、事务内操作、单条失败 continue 不终止。
|
||||||
- `internal/apps/user/tasks.go` — `SendEmailHandler`:带参数任务,展示 Payload 结构体定义、`PayloadValidator` 实现(`ValidatePayload` 用于校验+标准化)、`Execute` 中 json.Unmarshal 使用参数。
|
- `internal/apps/user/tasks.go` — `SendEmailHandler`:带参数任务,展示 Payload 结构体定义、`PayloadValidator` 实现(`ValidatePayload` 用于校验+标准化)、`Execute` 中 json.Unmarshal 使用参数。
|
||||||
|
|
||||||
|
## 测试与验证
|
||||||
|
|
||||||
|
新增或调整异步任务后,至少做以下验证:
|
||||||
|
|
||||||
|
1. 单测 Handler 本身:无参数任务验证业务结果;带参数任务额外覆盖 `ValidatePayload` 的成功、非法 JSON、缺失必填字段。
|
||||||
|
2. 单测 Admin dispatch:`POST /api/v1/admin/tasks/dispatch` 对合法 payload 返回 200,对非法 payload 返回 400,并包含清晰错误信息。
|
||||||
|
3. 单测 Retry:可重试失败任务应创建新的 `TaskExecution`,达到 `MaxRetry`、非 failed 状态、`Retryable=false` 都应拒绝。
|
||||||
|
4. 跑目标包测试:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go test ./internal/task ./internal/apps/admin/task ./internal/apps/<module>
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 最后跑全量测试:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go test ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
测试环境中如需下发/重试任务,使用 `miniredis` 初始化 `task.AsynqClient`;不要把 `internal/task` 依赖塞回通用 `internal/testhelper`,否则容易让 `model`/`task` 测试产生 import cycle。
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ body:
|
|||||||
value: |
|
value: |
|
||||||
感谢您花时间填写此 Bug 报告!
|
感谢您花时间填写此 Bug 报告!
|
||||||
|
|
||||||
- **提交错误报告前**:请检查 [已有 Issues](https://github.com/linux-do/credit/issues)列表,了解是否有类似问题被报告。如果不确定,请进行搜索,这有助于我们高效地专注于改进项目。
|
- **提交错误报告前**:请检查 [已有 Issues](https://github.com/Rain-kl/Wavelet/issues) 列表,了解是否有类似问题被报告。如果不确定,请进行搜索,这有助于我们高效地专注于改进项目。
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
id: issue-check
|
id: issue-check
|
||||||
attributes:
|
attributes:
|
||||||
@@ -18,7 +18,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
- label: 我已经搜索了现有问题和讨论。
|
- label: 我已经搜索了现有问题和讨论。
|
||||||
required: true
|
required: true
|
||||||
- label: 我正在使用最新版本或 credit.linux.do 上的此应用。
|
- label: 我正在使用 wavelet 的最新版本或当前部署实例。
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: what-happened
|
id: what-happened
|
||||||
@@ -68,7 +68,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
- label: 我已阅读并遵循了 `README.md` 中的所有说明。
|
- label: 我已阅读并遵循了 `README.md` 中的所有说明。
|
||||||
required: true
|
required: true
|
||||||
- label: 我正在使用 linux-do/credit 的最新版本。
|
- label: 我正在使用 Rain-kl/Wavelet 的最新版本。
|
||||||
required: true
|
required: true
|
||||||
- label: 我已提供我能够提供的尽可能多的相关日志,屏幕截图等。
|
- label: 我已提供我能够提供的尽可能多的相关日志,屏幕截图等。
|
||||||
required: true
|
required: true
|
||||||
@@ -87,4 +87,4 @@ body:
|
|||||||
value: |
|
value: |
|
||||||
## 注意
|
## 注意
|
||||||
如果 Bug 报告不完整或不遵循说明,则可能不会得到处理。请确保您已遵循所有 **README.md** 指南,并提供所有必要信息以便我们重现该问题。
|
如果 Bug 报告不完整或不遵循说明,则可能不会得到处理。请确保您已遵循所有 **README.md** 指南,并提供所有必要信息以便我们重现该问题。
|
||||||
感谢您为 linux-do/credit 做出贡献!
|
感谢您为 wavelet 做出贡献!
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ body:
|
|||||||
value: |
|
value: |
|
||||||
感谢您花时间填写此功能请求!
|
感谢您花时间填写此功能请求!
|
||||||
|
|
||||||
- **提交功能请求前**:请检查 [已有 Issues](https://github.com/linux-do/credit/issues) 列表和讨论区,了解是否有类似功能已被讨论或请求。这有助于我们避免重复工作,并高效地专注于改进项目。
|
- **提交功能请求前**:请检查 [已有 Issues](https://github.com/Rain-kl/Wavelet/issues) 列表和讨论区,了解是否有类似功能已被讨论或请求。这有助于我们避免重复工作,并高效地专注于改进项目。
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
id: check-existing
|
id: check-existing
|
||||||
attributes:
|
attributes:
|
||||||
@@ -18,7 +18,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
- label: 我已经搜索了现有问题和讨论。
|
- label: 我已经搜索了现有问题和讨论。
|
||||||
required: true
|
required: true
|
||||||
- label: 我正在使用最新版本或 credit.linux.do 上的此应用。
|
- label: 我正在使用 wavelet 的最新版本或当前部署实例。
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: feature-description
|
id: feature-description
|
||||||
@@ -65,7 +65,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
- label: 我已阅读并遵循了 `README.md` 中的所有说明。
|
- label: 我已阅读并遵循了 `README.md` 中的所有说明。
|
||||||
required: true
|
required: true
|
||||||
- label: 我正在使用 linux-do/credit 的最新版本。
|
- label: 我正在使用 Rain-kl/Wavelet 的最新版本。
|
||||||
required: true
|
required: true
|
||||||
- label: 我已提供我能够提供的尽可能多的相关信息,包括用例和场景。
|
- label: 我已提供我能够提供的尽可能多的相关信息,包括用例和场景。
|
||||||
required: true
|
required: true
|
||||||
@@ -76,4 +76,4 @@ body:
|
|||||||
value: |
|
value: |
|
||||||
## 注意
|
## 注意
|
||||||
如果功能请求不完整或不遵循说明,则可能不会得到处理。请确保您已提供所有必要信息以便我们理解您的建议。
|
如果功能请求不完整或不遵循说明,则可能不会得到处理。请确保您已提供所有必要信息以便我们理解您的建议。
|
||||||
感谢您为 linux-do/credit 做出贡献!
|
感谢您为 wavelet 做出贡献!
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
## 基础规范
|
## 基础规范
|
||||||
|
|
||||||
- 在任何情况都使用简体中文
|
- 在任何情况都使用简体中文
|
||||||
- 你是一个专业的代码助手,专门为 LINUX DO Credit 项目提供代码编写和优化服务
|
- 你是一个专业的代码助手,专门为 wavelet 项目提供代码编写和优化服务
|
||||||
- 严格遵循项目的代码规范和最佳实践,确保代码质量和一致性
|
- 严格遵循项目的代码规范和最佳实践,确保代码质量和一致性
|
||||||
- 保持代码简洁、可读、高效
|
- 保持代码简洁、可读、高效
|
||||||
- 优先考虑项目的可维护性、性能和安全性,避免引入不必要的复杂性
|
- 优先考虑项目的可维护性、性能和安全性,避免引入不必要的复杂性
|
||||||
@@ -10,8 +10,9 @@
|
|||||||
- 避免仅修改格式、注释或无影响力的拼写错误
|
- 避免仅修改格式、注释或无影响力的拼写错误
|
||||||
- 重构代码时必须带来可维护性或功能上的实质提升
|
- 重构代码时必须带来可维护性或功能上的实质提升
|
||||||
- 新增功能时考虑向后兼容性和 API 稳定性
|
- 新增功能时考虑向后兼容性和 API 稳定性
|
||||||
- 遵循项目的 MIT 许可证要求
|
- 遵循项目的 Apache2.0 许可证要求
|
||||||
- 遵循语义化版本控制规范
|
- 遵循语义化版本控制规范
|
||||||
|
- 新增异步任务时使用项目技能 `.agent/new-async-task/SKILL.md`
|
||||||
|
|
||||||
## 后端规范
|
## 后端规范
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<!-- 请在下面的 [ ] 中删除空格并打 x ,表示已完成相关检查 -->
|
<!-- 请在下面的 [ ] 中删除空格并打 x ,表示已完成相关检查 -->
|
||||||
|
|
||||||
- [ ] 我已阅读并理解 [贡献者公约](https://github.com/linux-do/credit/blob/master/CODE_OF_CONDUCT.md)
|
- [ ] 我已阅读并理解 [贡献者公约](https://github.com/Rain-kl/Wavelet/blob/main/CODE_OF_CONDUCT.md)
|
||||||
- [ ] 我已阅读并同意 [贡献者许可协议 (CLA)](https://github.com/linux-do/credit/blob/master/CLA.md),确认我的贡献将根据项目的 Apache2.0 许可证进行许可
|
- [ ] 我已阅读并同意 [贡献者许可协议 (CLA)](https://github.com/Rain-kl/Wavelet/blob/main/CLA.md),确认我的贡献将根据项目的 Apache2.0 许可证进行许可
|
||||||
- [ ] 我知晓如果此 PR 并不做出实质性更改,或可被认为是*为了PR被合并而提交PR*的,则可能不会被合并
|
- [ ] 我知晓如果此 PR 并不做出实质性更改,或可被认为是*为了PR被合并而提交PR*的,则可能不会被合并
|
||||||
|
|
||||||
**关联信息**
|
**关联信息**
|
||||||
@@ -22,4 +22,4 @@ resolves #1234
|
|||||||
|
|
||||||
**变更原因**
|
**变更原因**
|
||||||
|
|
||||||
<!-- 请在下方简要描述此 PR 的变更原因 -->
|
<!-- 请在下方简要描述此 PR 的变更原因 -->
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "22"
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: frontend/pnpm-lock.yaml
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,36 @@
|
|||||||
name: Build Docker Image
|
name: Build Docker Images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches:
|
||||||
tags: [ "*" ]
|
- "main"
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
branches:
|
||||||
|
- "main"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
FRONTEND_IMAGE_NAME: ${{ github.repository }}-web
|
FRONTEND_IMAGE_NAME: ${{ github.repository }}-frontend
|
||||||
|
BACKEND_IMAGE_NAME: ${{ github.repository }}-backend
|
||||||
|
|
||||||
# add permission for package publishing
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_image:
|
build_integrated_image:
|
||||||
|
name: Build integrated image
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
# checkout code
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# set up go
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.25"
|
|
||||||
check-latest: true
|
|
||||||
|
|
||||||
# download Go modules
|
|
||||||
- name: Download Go modules
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
# build do
|
|
||||||
- name: Build Go Binary (multi-arch)
|
|
||||||
run: |
|
|
||||||
# build amd64 binary
|
|
||||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o credit-server-amd64 main.go
|
|
||||||
|
|
||||||
# build arm64 binary
|
|
||||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o credit-server-arm64 main.go
|
|
||||||
|
|
||||||
# show binaries
|
|
||||||
ls -alh credit-server-*
|
|
||||||
|
|
||||||
# set up docker buildx
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# login to registry
|
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -60,41 +38,38 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# extract metadata for docker
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=sha,format=short,prefix=
|
type=sha,format=short,prefix=
|
||||||
|
|
||||||
# build and push docker image
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/master' && github.event_name == 'push') }}
|
file: docker/Dockerfile
|
||||||
|
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name == 'push') }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
build_frontend_image:
|
build_frontend_image:
|
||||||
|
name: Build frontend image
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
# checkout code
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# set up docker buildx
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# login to registry
|
|
||||||
- name: Log into registry
|
- name: Log into registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -102,99 +77,70 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# extract metadata for docker (frontend)
|
- name: Extract Docker metadata
|
||||||
- name: Extract Docker metadata (frontend)
|
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=sha,format=short,prefix=
|
type=sha,format=short,prefix=
|
||||||
|
|
||||||
# generate frontend build date in utc
|
|
||||||
- name: Generate frontend build date
|
- name: Generate frontend build date
|
||||||
id: frontend_build_meta
|
id: frontend_build_meta
|
||||||
run: echo "build_date=$(date -u +'%Y/%m/%d UTC')" >> "$GITHUB_OUTPUT"
|
run: echo "build_date=$(date -u +'%Y/%m/%d UTC')" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# build and push frontend docker image with version argument
|
|
||||||
- name: Build Frontend Docker image
|
- name: Build Frontend Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: ./frontend
|
context: .
|
||||||
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/master' && github.event_name == 'push') }}
|
file: docker/Dockerfile.frontend
|
||||||
|
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name == 'push') }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ github.ref_type == 'tag' && github.ref_name || '' }}
|
VERSION=${{ github.ref_type == 'tag' && github.ref_name || '' }}
|
||||||
BUILD_DATE=${{ steps.frontend_build_meta.outputs.build_date }}
|
BUILD_DATE=${{ steps.frontend_build_meta.outputs.build_date }}
|
||||||
|
|
||||||
update_helm_values:
|
build_backend_image:
|
||||||
|
name: Build backend image
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs: [build_image, build_frontend_image]
|
|
||||||
if: github.ref_type == 'tag'
|
|
||||||
steps:
|
steps:
|
||||||
# configure SSH agent with deploy key
|
- name: Checkout repository
|
||||||
- name: Setup SSH agent
|
uses: actions/checkout@v4
|
||||||
uses: webfactory/ssh-agent@v0.9.0
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log into registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# add github.com to known_hosts to avoid host verification prompt
|
- name: Extract Docker metadata
|
||||||
- name: Add GitHub to known_hosts
|
id: meta
|
||||||
run: ssh-keyscan github.com >> ~/.ssh/known_hosts
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=ref,event=tag
|
||||||
|
type=sha,format=short,prefix=
|
||||||
|
|
||||||
# clone the helm charts repository
|
- name: Build Backend Docker image
|
||||||
- name: Clone Helm Charts repository
|
uses: docker/build-push-action@v5
|
||||||
run: git clone ${{ vars.HELM_CHARTS_REPO }} helm-charts
|
with:
|
||||||
|
context: .
|
||||||
# install yq for yaml editing
|
file: docker/Dockerfile.backend
|
||||||
- name: Install yq
|
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name == 'push') }}
|
||||||
run: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
sudo chmod +x /usr/local/bin/yq
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
# determine helm values file based on tag type (production or test)
|
|
||||||
- name: Determine Helm values file
|
|
||||||
id: helm_config
|
|
||||||
run: |
|
|
||||||
TAG="${{ github.ref_name }}"
|
|
||||||
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
||||||
echo "values_file=values/credit/credit.yaml" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "branch_prefix=update/credit" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
echo "values_file=values/credit_test/credit.yaml" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "branch_prefix=update/credit_test" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# update image tags in helm values file
|
|
||||||
- name: Update image tags in helm values file
|
|
||||||
run: |
|
|
||||||
cd helm-charts
|
|
||||||
yq -i '.image.tag = "${{ github.ref_name }}"' ${{ steps.helm_config.outputs.values_file }}
|
|
||||||
yq -i '.image.webTag = "${{ github.ref_name }}"' ${{ steps.helm_config.outputs.values_file }}
|
|
||||||
|
|
||||||
# commit and push to a new branch, then open a PR for review
|
|
||||||
- name: Commit, push and create PR
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
run: |
|
|
||||||
cd helm-charts
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
BRANCH_NAME="${{ steps.helm_config.outputs.branch_prefix }}-${{ github.ref_name }}"
|
|
||||||
git checkout -b "$BRANCH_NAME"
|
|
||||||
git add ${{ steps.helm_config.outputs.values_file }}
|
|
||||||
git commit -m "chore: update credit image tag to ${{ github.ref_name }}"
|
|
||||||
git push origin "$BRANCH_NAME"
|
|
||||||
HELM_REPO=$(echo "${{ vars.HELM_CHARTS_REPO }}" | sed 's/git@github.com://;s/\.git$//')
|
|
||||||
gh pr create \
|
|
||||||
--repo "${HELM_REPO}" \
|
|
||||||
--title "chore: update credit image tag to ${{ github.ref_name }}" \
|
|
||||||
--body "Automated PR: update \`${{ steps.helm_config.outputs.values_file }}\` image tags to \`${{ github.ref_name }}\` after Docker image build." \
|
|
||||||
--base main \
|
|
||||||
--head "$BRANCH_NAME"
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
name: check license
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
tags: [ "*" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check_license:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: run make add_license
|
|
||||||
run: make check_license
|
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "22"
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
cache-dependency-path: frontend/pnpm-lock.yaml
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "22"
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: frontend/pnpm-lock.yaml
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
|
.PHONY: swagger license license-check build-embedded
|
||||||
|
|
||||||
swagger:
|
swagger:
|
||||||
scripts/swagger.sh
|
scripts/swagger.sh
|
||||||
|
|
||||||
|
license:
|
||||||
|
scripts/update_go_license.sh
|
||||||
|
|
||||||
|
license-check:
|
||||||
|
scripts/update_go_license.sh --check
|
||||||
|
|
||||||
build-embedded:
|
build-embedded:
|
||||||
cd frontend && pnpm build:embed
|
cd frontend && pnpm build:embed
|
||||||
rm -rf internal/router/dist
|
rm -rf internal/router/dist
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Wavelet
|
||||||
|
|
||||||
|
Copyright 2025 linux.do
|
||||||
|
Modifications Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
This product includes software originally licensed under the Apache License,
|
||||||
|
Version 2.0. Portions of this work have been modified by Arctel.net in 2026.
|
||||||
+106
@@ -452,6 +452,81 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/admin/logs": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"SessionCookie": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "分页获取系统历史日志,cursor=0 获取最新日志,cursor\u003e0 获取更早日志",
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"admin"
|
||||||
|
],
|
||||||
|
"summary": "获取系统日志",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"default": 0,
|
||||||
|
"description": "日志游标,0=获取最新",
|
||||||
|
"name": "cursor",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"default": 200,
|
||||||
|
"description": "每页条数",
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "日志列表",
|
||||||
|
"schema": {
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/util.ResponseAny"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/logs.logsResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "未登录",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/util.ResponseAny"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"description": "无管理员权限",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/util.ResponseAny"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/v1/admin/logs/ws": {
|
||||||
|
"get": {
|
||||||
|
"description": "通过 WebSocket 实时推送系统日志,需要管理员权限",
|
||||||
|
"tags": [
|
||||||
|
"admin"
|
||||||
|
],
|
||||||
|
"summary": "系统日志实时推送",
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/admin/status": {
|
"/api/v1/admin/status": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
@@ -2905,6 +2980,37 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"logger.LogEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"description": "一行日志原文(含换行符)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"index": {
|
||||||
|
"description": "全局递增序号",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logs.logsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"has_more": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"lines": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/logger.LogEntry"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"next_cursor": {
|
||||||
|
"description": "用于加载更早日志的 cursor",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"model.AccessToken": {
|
"model.AccessToken": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -445,6 +445,81 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/admin/logs": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"SessionCookie": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "分页获取系统历史日志,cursor=0 获取最新日志,cursor\u003e0 获取更早日志",
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"admin"
|
||||||
|
],
|
||||||
|
"summary": "获取系统日志",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"default": 0,
|
||||||
|
"description": "日志游标,0=获取最新",
|
||||||
|
"name": "cursor",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"default": 200,
|
||||||
|
"description": "每页条数",
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "日志列表",
|
||||||
|
"schema": {
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/util.ResponseAny"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"$ref": "#/definitions/logs.logsResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "未登录",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/util.ResponseAny"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"description": "无管理员权限",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/util.ResponseAny"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/v1/admin/logs/ws": {
|
||||||
|
"get": {
|
||||||
|
"description": "通过 WebSocket 实时推送系统日志,需要管理员权限",
|
||||||
|
"tags": [
|
||||||
|
"admin"
|
||||||
|
],
|
||||||
|
"summary": "系统日志实时推送",
|
||||||
|
"responses": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/admin/status": {
|
"/api/v1/admin/status": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
@@ -2898,6 +2973,37 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"logger.LogEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"data": {
|
||||||
|
"description": "一行日志原文(含换行符)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"index": {
|
||||||
|
"description": "全局递增序号",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logs.logsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"has_more": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"lines": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/logger.LogEntry"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"next_cursor": {
|
||||||
|
"description": "用于加载更早日志的 cursor",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"model.AccessToken": {
|
"model.AccessToken": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -73,6 +73,27 @@ definitions:
|
|||||||
- solutions
|
- solutions
|
||||||
- token
|
- token
|
||||||
type: object
|
type: object
|
||||||
|
logger.LogEntry:
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
description: 一行日志原文(含换行符)
|
||||||
|
type: string
|
||||||
|
index:
|
||||||
|
description: 全局递增序号
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
logs.logsResponse:
|
||||||
|
properties:
|
||||||
|
has_more:
|
||||||
|
type: boolean
|
||||||
|
lines:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/logger.LogEntry'
|
||||||
|
type: array
|
||||||
|
next_cursor:
|
||||||
|
description: 用于加载更早日志的 cursor
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
model.AccessToken:
|
model.AccessToken:
|
||||||
properties:
|
properties:
|
||||||
created_at:
|
created_at:
|
||||||
@@ -938,6 +959,52 @@ paths:
|
|||||||
summary: 切换认证源启用状态
|
summary: 切换认证源启用状态
|
||||||
tags:
|
tags:
|
||||||
- admin
|
- admin
|
||||||
|
/api/v1/admin/logs:
|
||||||
|
get:
|
||||||
|
description: 分页获取系统历史日志,cursor=0 获取最新日志,cursor>0 获取更早日志
|
||||||
|
parameters:
|
||||||
|
- default: 0
|
||||||
|
description: 日志游标,0=获取最新
|
||||||
|
in: query
|
||||||
|
name: cursor
|
||||||
|
type: integer
|
||||||
|
- default: 200
|
||||||
|
description: 每页条数
|
||||||
|
in: query
|
||||||
|
name: limit
|
||||||
|
type: integer
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: 日志列表
|
||||||
|
schema:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/definitions/util.ResponseAny'
|
||||||
|
- properties:
|
||||||
|
data:
|
||||||
|
$ref: '#/definitions/logs.logsResponse'
|
||||||
|
type: object
|
||||||
|
"401":
|
||||||
|
description: 未登录
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/util.ResponseAny'
|
||||||
|
"403":
|
||||||
|
description: 无管理员权限
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/util.ResponseAny'
|
||||||
|
security:
|
||||||
|
- SessionCookie: []
|
||||||
|
summary: 获取系统日志
|
||||||
|
tags:
|
||||||
|
- admin
|
||||||
|
/api/v1/admin/logs/ws:
|
||||||
|
get:
|
||||||
|
description: 通过 WebSocket 实时推送系统日志,需要管理员权限
|
||||||
|
responses: {}
|
||||||
|
summary: 系统日志实时推送
|
||||||
|
tags:
|
||||||
|
- admin
|
||||||
/api/v1/admin/status:
|
/api/v1/admin/status:
|
||||||
get:
|
get:
|
||||||
description: 获取后端服务运行状态、Goroutine、内存指标等详细统计数据,需要管理员权限
|
description: 获取后端服务运行状态、Goroutine、内存指标等详细统计数据,需要管理员权限
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package auth_source
|
package auth_source
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package cap
|
package cap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package cap
|
package cap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package cap
|
package cap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package oauth
|
package oauth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package user
|
package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@@ -16,5 +17,4 @@ limitations under the License.
|
|||||||
|
|
||||||
package user
|
package user
|
||||||
|
|
||||||
const (
|
const ()
|
||||||
)
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2026 Arctel.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
*/
|
||||||
|
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2026 linux.do
|
Copyright 2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025 linux.do
|
Copyright 2025 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2025-2026 linux.do
|
Copyright 2025-2026 linux.do
|
||||||
|
Modified by Arctel.net, 2026
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user