IntelliClass_FE/api/aifn.ts
Timothy Yin a6acd8fd54
All checks were successful
CI / lint (push) Successful in 50s
CI / test (push) Successful in 51s
feat(备课-教学设计): 教案设计功能
2025-05-23 20:43:39 +08:00

68 lines
1.5 KiB
TypeScript

import type { IResponse } from '.'
import type { AIGeneratedContent } from '~/components/ai'
export type AIGeneratedContentResponse = IResponse<{
data: AIGeneratedContent & {
raw: string
}
}>
export interface GenerateLessonPlanParams {
query: string
moduleName?: string
urls?: string[]
useTemplate?: boolean
templateId?: string
}
export interface RegenerateLessonPlanSectionParams {
query: string
conversationId: string
urls?: string[]
}
export interface LessonPlanTemplate {
createBy: number
createTime: string
docxUrl: string
id: number
imgUrl: string
isActive: boolean
moduleName: string
name: string
remark: string
updateBy: number
updateTime: string
}
export const generateLessonPlan = async (params: GenerateLessonPlanParams) => {
return await http<AIGeneratedContentResponse>(`/ai/lesson-plan-design/text-block`, {
method: 'POST',
body: params,
})
}
export const regenerateLessonPlanSection = async (params: RegenerateLessonPlanSectionParams) => {
return await http<AIGeneratedContentResponse>(`/ai/lesson-plan-design/update-block`, {
method: 'POST',
body: params,
})
}
export const getLessonPlanTemplate = async () => {
return await http<IResponse<{
data: LessonPlanTemplate[]
}>>(`/ai/lesson-plan-template/list`, {
method: 'GET',
})
}
export const generateCase = async (params: {
query: string
}) => {
return await http<AIGeneratedContentResponse>(`/ai/case-design/text-block`, {
method: 'POST',
body: params,
})
}