Преглед изворни кода

docs: 更新README和AGENTS,同步TabBar/端口/关系管理模块

User пре 2 месеци
родитељ
комит
bc4b720486
2 измењених фајлова са 37 додато и 8 уклоњено
  1. 30 2
      AGENTS.md
  2. 7 6
      README.md

+ 30 - 2
AGENTS.md

@@ -18,8 +18,9 @@ cfc/
 │       ├── config/       # JWT / 多数据源 / DatabaseInitializer
 │       └── common/       # Result<T>, JwtUtil
 ├── cfc-frontend/    # uni-app 微信小程序 (Vue 2, Options API)
-│   ├── pages/           # 页面 (index/, body/, mind/, action/, profile/, teacher/, games/, assessment/, shop/, ...)
-│   ├── pages.json       # TabBar (首页/身体/心智/行动/我的) + 分包注册
+│   ├── pages/           # 页面 (index/, family/, body/, mind/, action/, profile/, teacher/, games/, assessment/, shop/, ...)
+│   ├── components/      # 可复用组件 (RelationshipPicker, ContactCard, FamilyRelationGraph, ...)
+│   ├── pages.json       # TabBar (行/身/智/心/富) + 分包注册
 │   ├── config.js        # 环境自适应 baseUrl (develop/trial/release)
 │   └── store/           # Vuex 双角色状态
 ├── cfc-web/          # Vue 2 + Element UI 管理端
@@ -44,6 +45,30 @@ cfc/
 | Danshop | `localhost:8888` | 独立 Spring Boot 商城子系统 |
 | 数据迁移 | `curl -X POST http://localhost:9082/api/migration/run` | sfms → zxyj |
 
+## RELATIONSHIP MANAGEMENT
+
+| 实体 | 表 | 说明 |
+|------|----|------|
+| `RelationshipType` | `relationship_types` | 关系类型字典(typeKey/typeName/capabilityRole/sortOrder/enabled) |
+| `FamilyMember` | `family_members` | 家庭成员(relationshipType FK → typeKey, capabilityRole, showToFamily) |
+| `Contact` | `contacts` | 社会联系人(relationshipType → family/friend/partner/colleague/other, intimacyLevel) |
+| `GuideFamilyRelation` | `guide_family_relations` | 规划师-家庭绑定(relationType, status) |
+
+| 前端组件 | 用途 |
+|----------|------|
+| `RelationshipPicker.vue` | 关系类型选择器(自动加载 API,v-model 双向绑定) |
+| `FamilyRelationGraph.vue` | 家庭关系图(Canvas 绘制,信任度=颜色,沟通=线宽) |
+| `ContactCard.vue` | 联系人卡片 |
+| `ContactImport.vue` | 手机通讯录导入 |
+
+| API 端点 | 控制器 | 用途 |
+|----------|--------|------|
+| `/api/family/member/*` | `FamilyMembersController` | 添加/列表/切换/踢出/更新成员 |
+| `/api/family/member/relationship-types` | `FamilyMembersController` | 获取已启用的关系类型 |
+| `/api/admin/relationship-type/*` | `RelationshipTypeAdminController` | 管理端关系类型 CRUD |
+| `/api/bind/*` | `BindController` | 家长-规划师绑定 |
+| `/api/guide/bind/*` | `BindInviteController` | 规划师绑定邀请 |
+
 ## CONVENTIONS
 
 - **接口:** 统一 `@PostMapping`,禁止 `@GetMapping/@PutMapping/@DeleteMapping`
@@ -77,6 +102,9 @@ cfc/
 - 家庭关系图重设计
 - 成长记录重构
 - Dify AI 对话集成
+- 家庭成员关系编辑(前端:RelationshipPicker + family-members 编辑弹窗)
+- 关系类型 CRUD 管理(Web管理端 RelationshipTypes.vue)
+- 联系人管理(ContactCard, ContactImport, contact-detail)
 
 ## COMMANDS
 

+ 7 - 6
README.md

@@ -123,9 +123,9 @@ cfc/
 │   │   ├── discover/ | shop/          # 发现 / 商城(TabBar)
 │   │   ├── vendor/                    # 服务商入驻
 │   │   └── profile/ | login/          # 个人 / 登录
-│   ├── components/                    # 可复用组件(地址选择器、wuxing-sandbox 等)
+│   ├── components/                    # 可复用组件(地址选择器、RelationshipPicker、wuxing-sandbox 等)
 │   ├── store/                         # Vuex 角色状态管理
-│   ├── pages.json                     # 页面注册(4 TabBar
+│   ├── pages.json                     # 页面注册(5 TabBar:行/身/智/心/富
 │   └── uni.scss                       # 设计 Token 体系
 ├── cfc-web/                           # Vue 2 + Element UI Web 管理端(29 页面)
@@ -163,7 +163,7 @@ mysql -u root -p cfc < cfc-backend/src/main/resources/schema.sql
 # 2. 后端
 cd cfc-backend
 mvn clean install
-mvn spring-boot:run          # localhost:8080
+mvn spring-boot:run          # localhost:9082
 
 # 3. 小程序
 cd cfc-frontend
@@ -183,7 +183,7 @@ npm run serve                # localhost:8082
 | 模块 | 功能 | 客户 | 附属 | 服务商 | 运营 |
 |------|------|:----:|:----:|:------:|:----:|
 | **认证** | 微信/手机登录、角色切换 | ● | ● | ● | — |
-| **家庭** | 家庭创建、成员邀请、解绑 | ● | ○ | ○ | ● |
+| **家庭** | 家庭创建、成员邀请/管理、关系类型编辑、家庭关系图 | ● | ○ | ○ | ● |
 | **任务** | 创建/下发、执行(含小游戏)、审核 | ● | ● | ● | ● |
 | **积分** | 余额、流水、手动调整 | ● | ● | — | ● |
 | **心愿** | 创建心愿、兑换、审批 | ● | ● | — | ● |
@@ -225,6 +225,7 @@ npm run serve                # localhost:8082
 |------|--------|------|
 | 认证 | `AuthController` | `/api/auth/*` — 登录/注册/切换角色 |
 | 家庭 | `FamilyController` | `/api/family/*` — 邀请码/绑定 |
+| 家庭成员 | `FamilyMembersController` | `/api/family/member/*` — 添加/编辑/切换/移除成员 |
 | 任务 | `TaskController` | `/api/tasks/*` — CRUD/审核/小游戏 |
 | 心愿 | `WishController` | `/api/wishes/*` — 创建/审批/兑换 |
 | 五维能量 | `EnergyController` | `/api/energy/*` — 概览/流水/配置 |
@@ -237,7 +238,7 @@ npm run serve                # localhost:8082
 | 服务商入驻 | `VendorController` | `/api/vendor/*` — 申请/状态 |
 | 运营 | `AdminController` | `/api/admin/*` — 审核/用户/配置 |
 
-完整 API 清单见后端 Swagger 文档(启动后访问 `http://localhost:8080/swagger-ui.html`)。
+完整 API 清单见后端 Swagger 文档(启动后访问 `http://localhost:9082/swagger-ui.html`)。
 
 ---
 
@@ -296,7 +297,7 @@ npm run serve                # localhost:8082
 ## 小程序信息
 
 - **AppID:** `wx5ba8038ef16fb245`
-- **TabBar:** 首页 / 发现 / 商城 / 我的
+- **TabBar:** 行 / 身 / 智 / 心 / 富(对应五行相生:木·土·金·水·火)
 - **自定义 TabBar:** 角色感知(客户/附属/服务商显示不同内容)
 
 ---