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
+37
View File
@@ -0,0 +1,37 @@
const fs = require('fs');
const path = require('path');
function walkDir(dir, callback) {
fs.readdirSync(dir).forEach(f => {
let dirPath = path.join(dir, f);
let isDirectory = fs.statSync(dirPath).isDirectory();
if (isDirectory) {
if (f !== 'node_modules' && f !== '.git' && f !== 'dist' && f !== '.next' && f !== 'build' && f !== 'coverage') {
walkDir(dirPath, callback);
}
} else {
if (dirPath.endsWith('.ts') || dirPath.endsWith('.tsx') || dirPath.endsWith('.js')) {
callback(path.join(dir, f));
}
}
});
}
const filesWithLogs = [];
const logRegex = /(console|logger|Logger)\.(log|error|warn|info|debug|verbose)\(([^)]*[\u4e00-\u9fa5]+[^)]*)\)/g;
walkDir('d:/workspace/AuraK/server', (filePath) => {
const content = fs.readFileSync(filePath, 'utf8');
if (logRegex.test(content)) {
filesWithLogs.push(filePath);
}
});
walkDir('d:/workspace/AuraK/web', (filePath) => {
const content = fs.readFileSync(filePath, 'utf8');
if (logRegex.test(content)) {
filesWithLogs.push(filePath);
}
});
console.log('Found ' + filesWithLogs.length + ' files');
fs.writeFileSync('d:/workspace/AuraK/files_to_translate.json', JSON.stringify(filesWithLogs, null, 2));