feat: implement QuestionBank CRUD with pagination and template query

- Add pagination support to findAll (page, limit query params)
- Add findByTemplateId method to service
- Add GET /by-template/:templateId endpoint to controller
- Service already includes CRUD for QuestionBank and QuestionBankItem
This commit is contained in:
Developer
2026-04-23 17:19:11 +08:00
commit 0a9588abb7
492 changed files with 112453 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
+31
View File
@@ -0,0 +1,31 @@
type ToastType = 'success' | 'error' | 'warning' | 'info';
interface ToastHandler {
showToast: (type: ToastType, message: string, title?: string) => void;
}
let handler: ToastHandler | null = null;
export const registerToastHandler = (h: ToastHandler) => {
handler = h;
};
export const toast = {
success: (message: string, title?: string) => {
if (handler) handler.showToast('success', message, title);
else console.log(`${message}`);
},
error: (message: string, title?: string) => {
if (handler) handler.showToast('error', message, title);
else console.log(`${message}`);
},
info: (message: string, title?: string) => {
if (handler) handler.showToast('info', message, title);
else console.log(`${message}`);
},
warning: (message: string, title?: string) => {
if (handler) handler.showToast('warning', message, title);
else console.log(`⚠️ ${message}`);
}
};