forked from wangziqi/gongxue-base
feat: schedule student supervision rules
This commit is contained in:
@@ -208,6 +208,39 @@ export interface TenantStudentSupervisionPreview {
|
||||
};
|
||||
}
|
||||
|
||||
export interface TenantStudentSupervisionSchedule {
|
||||
enabled?: boolean;
|
||||
frequency?: 'manual' | 'daily' | 'weekly';
|
||||
hour?: number;
|
||||
minute?: number;
|
||||
timezone?: string;
|
||||
weekdays?: number[];
|
||||
}
|
||||
|
||||
export interface TenantStudentSupervisionRuleItem {
|
||||
id: string;
|
||||
name: string;
|
||||
status?: string;
|
||||
rules?: TenantStudentSupervisionRules;
|
||||
schedule?: TenantStudentSupervisionSchedule;
|
||||
classId?: string | null;
|
||||
className?: string | null;
|
||||
assignedToUserId?: string | null;
|
||||
assignedToName?: string | null;
|
||||
limit?: number;
|
||||
metadata?: Record<string, unknown>;
|
||||
lastRunAt?: string | null;
|
||||
nextRunAt?: string | null;
|
||||
lastResult?: Record<string, unknown>;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface TenantStudentSupervisionRulesPayload {
|
||||
items?: TenantStudentSupervisionRuleItem[];
|
||||
scoped?: boolean;
|
||||
}
|
||||
|
||||
export interface ImportJobItem {
|
||||
id: string;
|
||||
importType?: string;
|
||||
@@ -1157,6 +1190,32 @@ export async function previewTenantStudentSupervision(query: TenantStudentSuperv
|
||||
});
|
||||
}
|
||||
|
||||
export async function loadTenantStudentSupervisionRules(query: {
|
||||
status?: string;
|
||||
limit?: number;
|
||||
} = {}) {
|
||||
return apiRequest<TenantStudentSupervisionRulesPayload>('/api/tenant-admin/students/supervision/rules', {
|
||||
query: { ...query, limit: query.limit || 50 },
|
||||
});
|
||||
}
|
||||
|
||||
export async function upsertTenantStudentSupervisionRule(input: {
|
||||
id?: string;
|
||||
name: string;
|
||||
status?: string;
|
||||
rules?: TenantStudentSupervisionRules;
|
||||
schedule?: TenantStudentSupervisionSchedule;
|
||||
classId?: string | null;
|
||||
assignedToUserId?: string | null;
|
||||
limit?: number;
|
||||
metadata?: Record<string, unknown>;
|
||||
}) {
|
||||
return apiRequest<{ item?: TenantStudentSupervisionRuleItem }>('/api/tenant-admin/students/supervision/rules', {
|
||||
method: 'PUT',
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
|
||||
export async function generateTenantStudentSupervision(input: {
|
||||
rules?: TenantStudentSupervisionRules;
|
||||
classId?: string | null;
|
||||
|
||||
Reference in New Issue
Block a user