feat(api): 完善家谱系统API客户端契约
- 实现家谱管理相关方法,包括创建、详情、概览、我的家谱和选项查询 - 添加家谱加入申请功能,支持申请、审核、取消和待审核列表操作 - 集成通知详情获取方法和通知ID安全验证机制 - 完善功德记录、谱文、相册、视频、祭祀活动的完整CRUD操作契约 - 实现家谱成员管理功能,包含成员列表、更新、移除和转让所有者操作 - 优化路径ID验证逻辑,拒绝不安全的数值ID并提供明确错误提示 - 更新测试用例以验证所有新增API方法的路径和请求体白名单机制
This commit is contained in:
+19
-14
@@ -7,24 +7,12 @@ const PageAvailability = require('../public/js/pending-pages.js');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const familyPendingPages = [
|
||||
'profile-families.html',
|
||||
'profile-create-family.html',
|
||||
'profile-join-family.html',
|
||||
'profile-join-review.html',
|
||||
'profile-family-admin.html',
|
||||
'profile-invite.html',
|
||||
];
|
||||
|
||||
const contentPendingPages = [
|
||||
'profile-content.html',
|
||||
'profile-article.html',
|
||||
'profile-article-edit.html',
|
||||
'profile-album.html',
|
||||
'profile-video.html',
|
||||
'profile-gift.html',
|
||||
'profile-gift-edit.html',
|
||||
'profile-merit.html',
|
||||
'profile-merit-edit.html',
|
||||
'profile-feedback.html',
|
||||
'profile-admin-permissions.html',
|
||||
'profile-data-reminders.html'
|
||||
@@ -65,16 +53,32 @@ test('待开发页面显式加载状态脚本', () => {
|
||||
});
|
||||
|
||||
test('已接入的家谱业务页面保持真实功能状态', () => {
|
||||
['profile-feed.html', 'profile-feed-edit.html', 'profile-generation.html', 'profile-tree.html', 'profile-growth.html', 'profile-growth-edit.html', 'profile-relative.html', 'profile-relative-edit.html', 'profile-memo.html', 'profile-memo-edit.html', 'profile-messages.html'].forEach((page) => {
|
||||
['profile-families.html', 'profile-create-family.html', 'profile-family-admin.html', 'profile-content.html', 'profile-feed.html', 'profile-feed-edit.html', 'profile-feed-detail.html', 'profile-generation.html', 'profile-tree.html', 'profile-article.html', 'profile-article-edit.html', 'profile-album.html', 'profile-album-edit.html', 'profile-album-detail.html', 'profile-video.html', 'profile-video-edit.html', 'profile-gift.html', 'profile-gift-edit.html', 'profile-ceremony.html', 'profile-ceremony-detail.html', 'profile-growth.html', 'profile-growth-edit.html', 'profile-relative.html', 'profile-relative-edit.html', 'profile-memo.html', 'profile-memo-edit.html', 'profile-merit.html', 'profile-merit-edit.html', 'profile-messages.html'].forEach((page) => {
|
||||
assert.doesNotMatch(read(page), /data-feature-status="pending"/, `${page} 不应标记为待开发`);
|
||||
});
|
||||
assert.match(read('profile-generation.html'), /src="public\/js\/generation-pages\.js"/);
|
||||
assert.match(read('profile-families.html'), /src="public\/js\/genealogy-entry-pages\.js"/);
|
||||
assert.match(read('profile-create-family.html'), /src="public\/js\/genealogy-entry-pages\.js"/);
|
||||
assert.match(read('profile-tree.html'), /src="public\/js\/lineage-pages\.js"/);
|
||||
assert.match(read('profile-family-admin.html'), /src="public\/js\/member-admin-pages\.js"/);
|
||||
assert.match(read('profile-article.html'), /src="public\/js\/article-pages\.js"/);
|
||||
assert.match(read('profile-article-edit.html'), /src="public\/js\/article-pages\.js"/);
|
||||
assert.match(read('profile-album.html'), /src="public\/js\/album-pages\.js"/);
|
||||
assert.match(read('profile-album-edit.html'), /src="public\/js\/album-pages\.js"/);
|
||||
assert.match(read('profile-album-detail.html'), /src="public\/js\/album-pages\.js"/);
|
||||
assert.match(read('profile-video.html'), /src="public\/js\/video-pages\.js"/);
|
||||
assert.match(read('profile-video-edit.html'), /src="public\/js\/video-pages\.js"/);
|
||||
assert.match(read('profile-gift.html'), /src="public\/js\/ceremony-pages\.js"/);
|
||||
assert.match(read('profile-gift-edit.html'), /src="public\/js\/ceremony-admin-pages\.js"/);
|
||||
assert.match(read('profile-ceremony.html'), /src="public\/js\/ceremony-admin-pages\.js"/);
|
||||
assert.match(read('profile-ceremony-detail.html'), /src="public\/js\/ceremony-admin-pages\.js"/);
|
||||
assert.match(read('profile-growth.html'), /src="public\/js\/growth-pages\.js"/);
|
||||
assert.match(read('profile-growth-edit.html'), /src="public\/js\/growth-pages\.js"/);
|
||||
assert.match(read('profile-relative.html'), /src="public\/js\/relative-pages\.js"/);
|
||||
assert.match(read('profile-relative-edit.html'), /src="public\/js\/relative-pages\.js"/);
|
||||
assert.match(read('profile-memo.html'), /src="public\/js\/memo-pages\.js"/);
|
||||
assert.match(read('profile-merit.html'), /src="public\/js\/merit-pages\.js"/);
|
||||
assert.match(read('profile-merit-edit.html'), /src="public\/js\/merit-pages\.js"/);
|
||||
assert.match(read('profile-messages.html'), /src="public\/js\/notification-pages\.js"/);
|
||||
assert.match(read('profile-memo-edit.html'), /src="public\/js\/memo-pages\.js"/);
|
||||
});
|
||||
@@ -89,7 +93,7 @@ test('待开发的家谱管理页明确放行已接入的字辈入口并透传
|
||||
});
|
||||
|
||||
test('待开发页面仅放行显式标记的可用功能入口', () => {
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: 'profile-article.html' })), true);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: 'profile-feedback.html' })), true);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: 'profile-feed.html', 'data-feature-link': 'available' })), false);
|
||||
assert.equal(PageAvailability.shouldBlockLink(createLink({ href: '#section' })), false);
|
||||
});
|
||||
@@ -99,6 +103,7 @@ test('内容入口明确保留家族圈动态跳转', () => {
|
||||
assert.match(read('profile-content.html'), /href="profile-growth\.html" data-feature-link="available" data-genealogy-context-link/);
|
||||
assert.match(read('profile-content.html'), /href="profile-relative\.html" data-feature-link="available" data-genealogy-context-link/);
|
||||
assert.match(read('profile-content.html'), /href="profile-memo\.html" data-feature-link="available" data-genealogy-context-link/);
|
||||
assert.match(read('profile-content.html'), /href="profile-merit\.html" data-feature-link="available" data-genealogy-context-link/);
|
||||
});
|
||||
|
||||
test('家谱主页明确保留家族圈动态跳转', () => {
|
||||
|
||||
Reference in New Issue
Block a user