Files
photography/backend/api/desc/CLAUDE.md
xujiang 386666660f
Some checks failed
部署后端服务 / 🚀 构建并部署 (push) Failing after 7m20s
feat: 重构CLAUDE.md文档体系,实现模块化轻量级设计
- 重构根目录CLAUDE.md为项目总览(60行精简版)
- 细化backend模块CLAUDE.md为开发指南
- 新增各子模块CLAUDE.md文件:
  - api/desc/ - API定义模块
  - internal/handler/ - 请求处理器
  - internal/logic/ - 业务逻辑层
  - internal/model/ - 数据模型层
  - internal/middleware/ - 中间件层
  - internal/svc/ - 服务上下文
  - configs/ - 配置目录
  - deploy/ - 部署配置
  - pkg/ - 公共库
  - scripts/ - 工具脚本
  - configs/sql/ - SQL脚本
- 修复PostgreSQL SSL配置参数
- 清理旧的backend-old目录

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 13:16:01 +08:00

1.1 KiB

API定义模块

📋 文件结构

api/desc/
├── photography.api      # 主API文件(聚合)
├── auth.api            # 认证接口
├── photo.api           # 照片接口
├── category.api        # 分类接口
├── user.api            # 用户接口
└── frontend/           # 前端专用接口
    ├── auth.api        # 前端认证
    └── public.api      # 公开接口

🚀 开发流程

  1. 新增接口: 编辑对应.api文件
  2. 生成代码: make generate-api
  3. 实现逻辑: 在internal/logic/对应目录

🎯 文件作用

文件 用途 对应功能
auth.api 登录/注册 JWT认证
photo.api 照片CRUD 上传/管理
category.api 分类管理 相册分类
frontend/auth.api 前端登录 用户认证
frontend/public.api 公开接口 无需认证

⚙️ 生成命令

# 生成所有API代码
goctl api go -api api/desc/photography.api -dir ./

# 生成单个模块
goctl api go -api api/desc/photo.api -dir ./internal/handler/photo