refactor: 重构代码架构并使用 Modern Go 特性

- 重命名模块 jwts -> schedule_converter
- 新增 service 包,统一业务逻辑层
- 新增 pkg/logger 包,使用 slog 结构化日志
- 新增 pkg/errors 包,统一错误处理
- 拆分 captcha 包,图片识别移至 service/recognizer
- 清理 models 包,只保留数据结构定义
- 消除 grpc/handler.go 中的重复代码
- 简化 main.go,使用 slog 和 context
- 配置支持单例模式和结构化配置
- 使用 any 替代 interface{}
- 使用 sync.Map 替代 map + RWMutex
This commit is contained in:
lafay
2026-03-16 13:40:53 +08:00
parent 294151cd40
commit 74438c1f7f
20 changed files with 1183 additions and 602 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v6.33.1
// protoc-gen-go v1.36.9
// protoc v3.19.4
// source: proto/runner/runner.proto
package runner
@@ -1735,7 +1735,7 @@ const file_proto_runner_runner_proto_rawDesc = "" +
"\x13TASK_STATUS_TIMEOUT\x10\x03\x12\x19\n" +
"\x15TASK_STATUS_CANCELLED\x10\x042H\n" +
"\tRunnerHub\x12;\n" +
"\aConnect\x12\x15.runner.StreamMessage\x1a\x15.runner.StreamMessage(\x010\x01B\x1aZ\x18jwts/proto/runner;runnerb\x06proto3"
"\aConnect\x12\x15.runner.StreamMessage\x1a\x15.runner.StreamMessage(\x010\x01B(Z&schedule_converter/proto/runner;runnerb\x06proto3"
var (
file_proto_runner_runner_proto_rawDescOnce sync.Once