Commit Graph

237 Commits

Author SHA1 Message Date
c7ecf35c7c feat: modify cronjob tpl 2025-12-22 22:10:32 +08:00
6b3981c3bc feat: modify http 2025-12-17 23:43:55 +08:00
12faa04a7e fix: route issues 2025-12-17 23:42:40 +08:00
df8c0627b4 fix: swagger 2025-12-16 17:11:55 +08:00
ff4fba7a43 fix: 修复导入路径以支持模块化结构 2025-12-15 11:17:34 +08:00
3c180091e1 feat: add river_queue migration 2025-12-15 10:50:41 +08:00
Rogee
64ae2d6d44 feat: 删除旧的配置文件并添加新的数据库迁移脚本以支持用户、会话和审计日志功能 2025-09-23 17:36:24 +08:00
Rogee
e25004df5b feat: 更新 Makefile.tpl 以改进构建信息获取逻辑 2025-09-23 17:28:34 +08:00
Rogee
daf93e7055 feat: 更新构建配置,添加构建信息打印功能并重构 Makefile 2025-09-23 17:23:44 +08:00
Rogee
b37b12884f feat(tests): add comprehensive unit, integration, and e2e tests for API and database functionality
- Implemented end-to-end tests for API health checks, performance, behavior, and documentation.
- Created integration tests for database connection, CRUD operations, transactions, and connection pool management.
- Developed unit tests for configuration loading, environment variable handling, validation, default values, and helper functions.
- Established a test setup with environment management and basic usage examples for the testing framework.
2025-09-23 17:06:47 +08:00
Rogee
1a7bb737af feat: 更新 init 目标以生成服务并调整生成顺序 2025-09-23 16:02:32 +08:00
Rogee
14ccc7e188 feat: 更新命令包以使用新的默认提供程序,增强模块化支持 2025-09-23 16:01:25 +08:00
Rogee
13e721532d feat: 检查路径参数是否包含模型字段并相应地导入字段包 2025-09-23 15:40:09 +08:00
Rogee
f8f4c7b76a feat: 添加 atom 到 .gitignore 文件以排除不必要的构建输出 2025-09-23 15:34:21 +08:00
Rogee
c7a753887d feat: 允许解析生成文件,更新配置以支持 .gen.go 文件 2025-09-23 15:34:04 +08:00
Rogee
439456b6ad fix: 恢复 gen route 的 model 参数渲染到 f2a8b98 实现
- 恢复 buildParamToken 函数的直接实现,移除复杂的 builder 模式
- 恢复 buildRenderData 函数的简单实现,提高代码可读性
- 恢复 Render 函数的基础实现,移除过度工程化的验证逻辑
- 修复路由分组路径问题:移除 buildResult 中错误的路径覆盖逻辑
- 当使用 model() 绑定时生成完整的数据库查询函数代码

此提交将 gen route 功能恢复到 commit f2a8b9876e
的实现方式,确保 model 参数渲染符合原始设计。

修复问题:
- 修复路由生成时 "open /v1/medias/routes.gen.go: no such file or directory" 错误
- 确保 model 参数正确生成完整的数据库查询代码而非简化接口
2025-09-22 19:01:40 +08:00
Rogee
4bd9f2f3eb feat: 允许解析 services.gen.go 文件,增强生成文件的支持 2025-09-22 14:55:42 +08:00
Rogee
a8eb9e0025 fix: gen provider 2025-09-22 14:16:22 +08:00
Rogee
07e70a80ea feat: 优化参数构建逻辑,简化模型接口,移除不必要的字段导入 2025-09-22 13:22:03 +08:00
Rogee
824861c27c feat: Refactor AST generation routes workflow
- Introduced a comprehensive data model for route definitions, parameters, and validation rules.
- Established component interfaces for route parsing, comment parsing, import resolution, route building, validation, and rendering.
- Developed a detailed implementation plan outlining execution flow, user requirements, and compliance with design principles.
- Created a quickstart guide to assist users in utilizing the refactored system effectively.
- Conducted thorough research on existing architecture, identifying key improvements and establishing a refactoring strategy.
- Specified functional requirements and user scenarios to ensure clarity and testability.
- Generated a task list for implementation, emphasizing test-driven development and parallel execution where applicable.
2025-09-22 11:33:13 +08:00
Rogee
0cfc573960 feat: 增强 gRPC 支持,优化注册函数和导入处理逻辑 2025-09-22 10:00:25 +08:00
Rogee
1e98d0eaff feat: add comment docs 2025-09-22 09:40:29 +08:00
Rogee
e1f83ae469 feat: 重构 pkg/ast/provider 模块,优化代码组织逻辑和功能实现
## 主要改进

### 架构重构
- 将单体 provider.go 拆分为多个专门的模块文件
- 实现了清晰的职责分离和模块化设计
- 遵循 SOLID 原则,提高代码可维护性

### 新增功能
- **验证规则系统**: 实现了完整的 provider 验证框架
- **报告生成器**: 支持多种格式的验证报告 (JSON/HTML/Markdown/Text)
- **解析器优化**: 重新设计了解析流程,提高性能和可扩展性
- **错误处理**: 增强了错误处理和诊断能力

### 修复关键 Bug
- 修复 @provider(job) 注解缺失 __job 注入参数的问题
- 统一了 job 和 cronjob 模式的处理逻辑
- 确保了 provider 生成的正确性和一致性

### 代码质量提升
- 添加了完整的测试套件
- 引入了 golangci-lint 代码质量检查
- 优化了代码格式和结构
- 增加了详细的文档和规范

### 文件结构优化
```
pkg/ast/provider/
├── types.go              # 类型定义
├── parser.go             # 解析器实现
├── validator.go          # 验证规则
├── report_generator.go   # 报告生成
├── renderer.go           # 渲染器
├── comment_parser.go     # 注解解析
├── modes.go             # 模式定义
├── errors.go            # 错误处理
└── validator_test.go    # 测试文件
```

### 兼容性
- 保持向后兼容性
- 支持现有的所有 provider 模式
- 优化了 API 设计和用户体验

This completes the implementation of T025-T029 tasks following TDD principles,
including validation rules implementation and critical bug fixes.
2025-09-19 18:58:30 +08:00
Rogee
8c65c6a854 feat: 更新章程和任务模板,增加 SOLID、KISS、YAGNI、DRY 原则合规性检查 2025-09-19 17:06:57 +08:00
Rogee
2befb513a8 feat: add spec-kit 2025-09-19 16:52:53 +08:00
Rogee
6cb5e02c3e fix: 修复 providers 目录的嵌入路径,确保正确加载所有提供者文件 2025-09-17 08:56:17 +08:00
Rogee
f0b7e0202c feat: 添加测试服务及相关测试用例,重构 demo 服务逻辑 2025-09-15 18:37:02 +08:00
Rogee
dd097e9aec feat: 重构项目结构,添加命令处理程序并移除冗余文件 2025-09-12 19:43:06 +08:00
Rogee
4c8205212f fix: 修复 provider 模板文件名错误的问题 2025-09-12 19:34:56 +08:00
Rogee
02ea517143 fix: 修复导入路径,确保正确引用 atom 包及其子模块 2025-09-12 17:40:10 +08:00
Rogee
342f205b5e feat(tracing): Implement Jaeger/OpenTracing provider with configuration options
- Added Punycode encoding implementation for cookie handling.
- Introduced serialization for cookie jar with JSON support.
- Created a comprehensive README for the tracing provider, detailing configuration and usage.
- Developed a configuration structure for tracing, including sampler and reporter settings.
- Implemented the provider logic to initialize Jaeger tracer with logging capabilities.
- Ensured graceful shutdown of the tracer on application exit.
2025-09-12 17:28:25 +08:00
Rogee
202239795b feat: 移除冗余的数据库配置处理,简化模型生成命令逻辑 2025-09-12 14:15:28 +08:00
Rogee
bddd8b1ba9 feat: 更新事件主题常量格式,添加前缀以区分事件类型;增强订阅者日志记录,包含主题信息 2025-09-12 11:05:12 +08:00
Rogee
c0a437a793 feat: 添加 cron 任务模板,支持定时任务生成 2025-09-12 10:52:36 +08:00
Rogee
ee15e0932a feat: 增强命令帮助文档,添加详细说明和示例 2025-09-12 10:33:57 +08:00
Rogee
a96df4d628 feat: 更新 enum 命令的帮助文档,增加详细的标志和行为说明 2025-09-12 10:24:30 +08:00
Rogee
3a61b6e22b feat: 更新 README 文档,增加命令行工具功能描述与示例 2025-09-12 10:17:26 +08:00
Rogee
0096775d31 update gen routes 2025-09-11 22:54:19 +08:00
Rogee
82c94d5a29 complete route generator 2025-09-11 22:43:52 +08:00
Rogee
f2a8b9876e update route 2025-09-11 22:40:00 +08:00
Rogee
76c7592f26 feat: 添加对 @Bind 注释中 model 字段的支持,优化路径参数绑定逻辑并更新文档 2025-09-11 20:10:24 +08:00
Rogee
b93c7726f2 feat: 更新 @Bind 注释语法,移除 table 参数,优化文档内容 2025-09-11 19:28:51 +08:00
Rogee
9c910b6ede refactor: 统一代码格式,优化代码可读性 2025-09-11 19:22:47 +08:00
Rogee
6973c85730 feat: 添加路由定义文档,详细说明注释语法、参数绑定及示例 2025-09-11 19:21:10 +08:00
Rogee
344798163b feat: 重构路由渲染逻辑,添加构建渲染数据和模板渲染功能,优化代码结构 2025-09-11 19:14:44 +08:00
Rogee
a23e31fea3 feat: 删除冗余的 README 和 Git keep 文件,添加 demo.go 模板和完整的配置文件 2025-09-11 18:50:31 +08:00
Rogee
9e7ce1b7d3 feat: 增强 OpenTelemetry 提供者配置,添加连接安全、采样器和批处理选项 2025-09-11 18:23:14 +08:00
Rogee
9662d7d718 feat: 添加队列工作者配置,增强作业提供者功能,支持并发控制和健康检查 2025-09-11 17:26:18 +08:00
Rogee
1f17942665 feat: 添加高级配置选项,增强追踪提供者功能,支持采样器、Reporter 和标签配置 2025-09-11 17:02:31 +08:00
Rogee
42214ee821 feat: 更新配置结构,添加 BaseURL、ContentType 和 CommonQuery 字段 2025-09-11 16:44:59 +08:00