feat: migrate app routes and business modules

This commit is contained in:
2026-08-12 18:22:59 +08:00
parent 555aa00043
commit cc706378c2
247 changed files with 28623 additions and 14988 deletions
+128
View File
@@ -0,0 +1,128 @@
import {
GENEALOGY_ACCESS_PRESET,
} from '../../utils/genealogy/access-policy.js'
const genealogies = [
{
id: '1001',
surname: '汤',
name: '汤氏家谱',
hall: '敦睦堂',
location: '河南·洛阳',
memberCount: 158,
updatedAt: '2024-05-12',
activeCount: 8,
accessPreset: GENEALOGY_ACCESS_PRESET.MEMBER_ONLY,
membership: 'created',
motto: '敦亲睦族,敬祖传家。',
ancestorName: '汤文远',
parentName: '汤氏中华总谱',
branchName: '洛阳主支',
source: '由洛阳汤氏族人整理并维护',
publicDescription: '公开展示家谱身份、地区、堂号与支系信息。'
},
{
id: '1002',
surname: '汤',
name: '汤氏宗谱',
hall: '承志堂',
location: '山东·济宁',
memberCount: 286,
updatedAt: '2024-04-28',
activeCount: 15,
accessPreset: GENEALOGY_ACCESS_PRESET.PUBLIC_APPLY,
membership: 'joined',
motto: '继往开来,世守家风。',
ancestorName: '汤正明',
parentName: '汤氏鲁西总谱',
branchName: '济宁主支',
source: '由济宁汤氏族人整理并维护',
publicDescription: '公开展示家谱身份、地区、堂号与支系信息。'
}
]
// 家谱列表与公开搜索共用预览数据。成员关系只存在于 genealogies
// 公开搜索投影不能携带该字段,避免本地预览误授予管理能力。
const toPublicProjection = ({ membership: _membership, ...genealogy }) => genealogy
const previewPublicGenealogies = [
{
id: '2001',
surname: '汤',
name: '汤氏南阳宗谱',
hall: '敦睦堂',
location: '河南·南阳',
parentName: '汤氏中华总谱',
branchName: '南阳主支',
manager: '管理员 汤文礼',
certification: '资料已认证',
memberCount: 428,
activeCount: 316,
updatedAt: '2026-07-12',
relation: 'available',
source: '由南阳汤氏族人整理并维护',
publicDescription: '公开展示家谱身份、地区、堂号与支系信息;成员资料和世系详情仅向已加入成员开放。',
motto: '敦亲睦族,敬祖传家。',
accessPreset: GENEALOGY_ACCESS_PRESET.PUBLIC_APPLY,
ancestorName: '汤文远'
},
{
...toPublicProjection(genealogies[1]),
manager: '管理员 汤文远',
certification: '资料已认证',
relation: 'joined'
},
{
id: '2003',
surname: '汤',
name: '汤氏济宁宗谱',
hall: '敬宗堂',
location: '山东·济宁',
parentName: '汤氏鲁西总谱',
branchName: '济宁主支',
manager: '管理员 汤正明',
certification: '管理员已实名',
memberCount: 286,
updatedAt: '2026-07-08',
relation: 'pending',
accessPreset: GENEALOGY_ACCESS_PRESET.PUBLIC_APPLY,
},
{
id: '2004',
surname: '汤',
name: '汤氏清河家谱',
hall: '思源堂',
location: '山东·临清',
parentName: '汤氏鲁西总谱',
branchName: '清河支系',
manager: '管理员 汤志成',
certification: '资料已认证',
memberCount: 96,
updatedAt: '2026-07-05',
relation: 'rejected',
accessPreset: GENEALOGY_ACCESS_PRESET.PUBLIC_APPLY,
},
{
id: '2005',
surname: '汤',
name: '汤氏汝南支谱',
hall: '崇本堂',
location: '河南·驻马店',
parentName: '汤氏中原总谱',
branchName: '汝南三支',
manager: '管理员 汤国安',
certification: '管理员已实名',
memberCount: 72,
updatedAt: '2026-07-02',
relation: 'removed',
accessPreset: GENEALOGY_ACCESS_PRESET.PUBLIC_APPLY,
},
{
...toPublicProjection(genealogies[0]),
manager: '创建者 当前用户',
certification: '资料待完善',
relation: 'owned'
}
]
export const listPreviewPublicGenealogies = () =>
previewPublicGenealogies.map((genealogy) => ({ ...genealogy }))