Files
AI-Health/CLAUDE.md
MingNian 14d7c30d3d Initial commit: 健康管家 AI 健康陪伴助手
- Backend: .NET 10 Minimal API + EF Core + PostgreSQL
- Frontend: Flutter + Riverpod + GoRouter + Dio
- AI: DeepSeek LLM + Qwen VLM (OpenAI-compatible)
- Auth: SMS + JWT (access/refresh tokens)
- Features: AI chat, health tracking, medication management, diet analysis, exercise plans, doctor consultations, report analysis
2026-06-02 11:11:29 +08:00

27 lines
947 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AI APP — 编码规范
## 后端 C# (.NET 10)
- 主构造函数:`public class Service(DbContext db) { }`
- 静态方法必须标记 `static`
- 集合表达式:`[]` / `[..src]`
- `TryGetValue` 替代 `GetValueOrDefault`
- 空 catch 必须指定异常类型
- DTO 用 `record` 类型
- `private static readonly` 缓存可复用对象
- 本地函数优于 `Func<T>` 赋值
- file-scoped namespace、global using、target-typed `new()``Nullable=enable`
- Minimal API 扩展方法模式:`public static class XxxEndpoints { }`
- AI 请求用 `HttpClient` 直连,不引入第三方 AI SDK
- **文件命名 snake_case**`auth_service.cs``auth_endpoints.cs`
## 前端 Flutter (Dart)
-前端用sqlite存储信息不用shared_preferences
- 用 Riverpod 管理所有状态和页面跳转
## 运行与测试
- 测试时自行启动后端,通过浏览器 DevTools 发送请求验证
- Flutter 用 `flutter run` 连模拟器/真机