Skip to content

refactor: 架构重构 — 从「社区隔离」改为「社区关联」模式#62

Merged
ZhengZhenyu merged 1 commit intoopensourceways:mainfrom
ZhengZhenyu:main
Feb 23, 2026
Merged

refactor: 架构重构 — 从「社区隔离」改为「社区关联」模式#62
ZhengZhenyu merged 1 commit intoopensourceways:mainfrom
ZhengZhenyu:main

Conversation

@ZhengZhenyu
Copy link
Collaborator

将活动、内容、运营活动、生态洞察四个模块从强社区隔离模式迁移到
社区关联模式:数据独立存在,community_id 改为可选关联属性。

核心变更:

  • 数据库迁移 010:events/event_templates/contents/campaigns 表 community_id 改为 nullable
  • 后端 API:移除 get_current_community 依赖,改为可选 Query 参数过滤
  • 后端 Schema:community_id 字段改为 Optional[int] = None
  • 前端页面:移除 hasCommunity guard,创建表单新增「关联社区」可选下拉
  • App.vue:CommunitySwitcher 改为白名单模式(仅社区工作台和社区治理显示)
  • App.vue:「社区总览」从「平台管理」移至「社区治理」submenu,全员可见
  • 测试:更新 9 个测试以反映新的跨社区访问行为

委员会、会议、发布渠道保持原有的社区强绑定不变。

变更说明

关联 Issue:#

Checklist

  • 功能实现正确,无明显 Bug
  • 测试通过(新增/修改功能已补充测试,覆盖率 ≥ 80%)
  • 无敏感信息硬编码(密钥、密码、Token)
  • 数据库有变更时迁移文件已生成并测试
  • 必要的文档已同步更新

将活动、内容、运营活动、生态洞察四个模块从强社区隔离模式迁移到
社区关联模式:数据独立存在,community_id 改为可选关联属性。

核心变更:
- 数据库迁移 010:events/event_templates/contents/campaigns 表
  community_id 改为 nullable
- 后端 API:移除 get_current_community 依赖,改为可选 Query 参数过滤
- 后端 Schema:community_id 字段改为 Optional[int] = None
- 前端页面:移除 hasCommunity guard,创建表单新增「关联社区」可选下拉
- App.vue:CommunitySwitcher 改为白名单模式(仅社区工作台和社区治理显示)
- App.vue:「社区总览」从「平台管理」移至「社区治理」submenu,全员可见
- 测试:更新 9 个测试以反映新的跨社区访问行为

委员会、会议、发布渠道保持原有的社区强绑定不变。
@opensourceways-bot
Copy link
Contributor

Linking Issue Notice

@ZhengZhenyu , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .

@opensourceways-bot
Copy link
Contributor

CLA Signature Guide

@ZhengZhenyu , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
5b11947c refactor: 架构重构 — 从��... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

@ZhengZhenyu ZhengZhenyu merged commit ba6e1e0 into opensourceways:main Feb 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants