# shetuanguanli **Repository Path**: likefallwind/shetuanguanli ## Basic Information - **Project Name**: shetuanguanli - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-23 - **Last Updated**: 2026-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ⚡ Vibe Coding 社团管理系统 极客风格的学生社团管理平台 ## 🚀 功能特性 - ✅ 社团介绍管理 - ✅ 成员添加、删除、更新 - ✅ 职位系统(社长、副社长、部长、普通成员) - ✅ 成员晋升/任命功能 - ✅ 极客风格 Web 界面 - ✅ RESTful API - ✅ 完整的测试覆盖 ## 📦 技术栈 - **后端**: Python + FastAPI - **数据库**: SQLite - **前端**: HTML + CSS (极客终端风格) - **测试**: pytest ## 🛠️ 安装步骤 ### 1. 安装依赖 ```bash pip install -r requirements.txt ``` ### 2. 运行测试 ```bash pytest ``` ### 3. 启动系统 ```bash python start.py ``` 或直接运行: ```bash python main.py ``` ## 🌐 访问地址 - **Web 界面**: http://localhost:8000 - **API 文档**: http://localhost:8000/docs - **ReDoc**: http://localhost:8000/redoc ## 📖 API 接口 ### 社团管理 | 方法 | 路径 | 描述 | |------|------|------| | POST | /club/info | 创建社团信息 | | GET | /club/info | 获取社团信息 | | PUT | /club/info | 更新社团信息 | ### 成员管理 | 方法 | 路径 | 描述 | |------|------|------| | POST | /members | 添加成员 | | GET | /members | 获取所有成员 | | GET | /members/{id} | 获取指定成员 | | PUT | /members/{id} | 更新成员信息 | | DELETE | /members/{id} | 删除成员 | | POST | /members/{id}/promote?position={职位} | 晋升成员 | | GET | /members/position/{职位} | 按职位查询成员 | ## 💻 使用示例 ### 使用 curl 测试 API ```bash # 创建社团 curl -X POST http://localhost:8000/club/info \ -H "Content-Type: application/json" \ -d '{"name": "Vibe Coding 社团", "description": "极客社团"}' # 添加成员 curl -X POST http://localhost:8000/members \ -H "Content-Type: application/json" \ -d '{"name": "张三", "student_id": "2024001", "email": "zhangsan@example.com", "position": "普通成员"}' # 获取所有成员 curl http://localhost:8000/members # 晋升成员 curl -X POST "http://localhost:8000/members/1/promote?position=部长" # 删除成员 curl -X DELETE http://localhost:8000/members/1 ``` ## 🎨 职位体系 1. **社长** - 社团负责人 2. **副社长** - 社长助理 3. **部长** - 部门负责人 4. **普通成员** - 基础成员 ## 🧪 运行测试 ```bash # 运行所有测试 pytest # 运行特定测试类 pytest test_main.py::TestClubInfo -v # 运行特定测试方法 pytest test_main.py::TestMemberManagement::test_create_member -v # 查看测试覆盖率 pytest --cov=. ``` ## 📝 注意事项 - 首次运行会自动创建数据库 - 成员删除采用软删除(is_active 标记) - 学号必须唯一 - 支持中文职位名称 ## 🔧 开发信息 - 版本:1.0.0 - 开发模式:DEBUG - 数据库文件:club.db --- **Vibe Coding Club Management System** | Made with ⚡ by Geek