修改完成待测试

This commit is contained in:
2026-09-13 17:45:47 +08:00
parent 9ad572907b
commit bbc024f7f2
80 changed files with 3844 additions and 1672 deletions
+19
View File
@@ -4,6 +4,7 @@ import {
normalizeLineagePersonIdentity,
normalizeLineagePersonOptions,
normalizeLineagePersonPage,
normalizeLineageRankOptions,
normalizeLineageSensitiveProfile
} from './lineage-person-contract.js'
import { normalizeLineageTree } from './lineage-tree-contract.js'
@@ -26,6 +27,24 @@ export const lineageApi = {
return normalizeLineageTree(tree)
},
async getRankOptions(genealogyId, generation, sex, requestOptions = {}) {
const normalizedGenealogyId = normalizeGenealogyPathId(genealogyId)
if (!Number.isSafeInteger(generation) || generation < 1) {
throw new TypeError('排行选项世代必须是正安全整数')
}
if (!['0', '1', '2'].includes(sex)) {
throw new TypeError('排行选项性别必须是 0、1 或 2')
}
const options = await requestStrict({
url: `/genealogy/app/genealogies/${normalizedGenealogyId}/lineage/ranks`,
method: 'GET',
data: { generation, sex }
}, {
requestController: requestOptions.requestController ?? null
})
return normalizeLineageRankOptions(options)
},
async getPerson(genealogyId, personId, requestOptions = {}) {
const normalizedGenealogyId = normalizeGenealogyPathId(genealogyId)
const normalizedPersonId = normalizeLineagePersonIdentity(personId, '人物标识')