修改完成待测试
This commit is contained in:
@@ -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, '人物标识')
|
||||
|
||||
Reference in New Issue
Block a user