68 lines
1.5 KiB
TypeScript
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,
|
|
})
|
|
}
|