feat: 联调
This commit is contained in:
+5
-2
@@ -362,9 +362,12 @@ function normalizeCase(item: unknown, index: number): CaseListItem {
|
||||
|
||||
function normalizeAiGenerateResult(data: unknown): AiGenerateCaseResult {
|
||||
const root = getRecord(data)
|
||||
const payload = root.parse_id || root.parseId ? root : getRecord(root.data)
|
||||
const payload = root.parse_id || root.parseId || root.case_type || root.caseType || root.title
|
||||
? root
|
||||
: getRecord(root.data)
|
||||
const usage = getRecord(getFirst(payload, ['ai_usage', 'aiUsage']))
|
||||
const generatedData = getRecord(payload.data)
|
||||
const nestedData = getRecord(payload.data)
|
||||
const generatedData = Object.keys(nestedData).length ? nestedData : payload
|
||||
|
||||
return {
|
||||
parseId: getString(payload, ['parse_id', 'parseId']),
|
||||
|
||||
@@ -27,15 +27,20 @@ export interface TeacherStudentRelationListResult {
|
||||
}
|
||||
|
||||
export interface TeacherStudentRelationPayload {
|
||||
teacher?: number
|
||||
student?: number
|
||||
teacher_phone?: string
|
||||
student_phone?: string
|
||||
relation_type?: string
|
||||
status?: 0 | 1
|
||||
}
|
||||
|
||||
export interface CreateTeacherStudentRelationPayload extends TeacherStudentRelationPayload {
|
||||
teacher: number
|
||||
student: number
|
||||
teacher_phone: string
|
||||
student_phone: string
|
||||
}
|
||||
|
||||
export interface UpdateTeacherStudentRelationPayload extends TeacherStudentRelationPayload {
|
||||
teacher_phone: string
|
||||
student_phone: string
|
||||
}
|
||||
|
||||
export interface CreateTeacherStudentRelationParams {
|
||||
@@ -46,7 +51,7 @@ export interface CreateTeacherStudentRelationParams {
|
||||
export interface UpdateTeacherStudentRelationParams {
|
||||
token: string
|
||||
id: number
|
||||
payload: TeacherStudentRelationPayload
|
||||
payload: UpdateTeacherStudentRelationPayload
|
||||
}
|
||||
|
||||
export interface DisableTeacherStudentRelationParams {
|
||||
@@ -111,14 +116,14 @@ function getRelatedUser(value: unknown, fallbackRecord: Record<string, unknown>,
|
||||
return {
|
||||
id: getString(record, ['id', 'user_id', 'userId']),
|
||||
name: getString(record, ['real_name', 'realName', 'name', 'username']),
|
||||
phone: getString(record, ['phone', 'mobile'])
|
||||
phone: getString(record, ['phone', 'mobile', 'username'])
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
id: typeof value === 'number' || typeof value === 'string' ? String(value) : getString(fallbackRecord, [`${prefix}_id`, `${prefix}Id`]),
|
||||
name: getString(fallbackRecord, [`${prefix}_name`, `${prefix}Name`, `${prefix}_real_name`, `${prefix}RealName`]),
|
||||
phone: getString(fallbackRecord, [`${prefix}_phone`, `${prefix}Phone`])
|
||||
phone: getString(fallbackRecord, [`${prefix}_phone`, `${prefix}Phone`, `${prefix}_username`, `${prefix}Username`])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user