M3: console.log -> Logger + UI redesign (QuestionBank) + S7/A9/A10/A11/U11 bug fixes + #1/#2/#3/#4 enhancements + i18n for QuestionBank pages

This commit is contained in:
Developer
2026-05-19 16:57:45 +08:00
parent 5b5f14674d
commit 29bac74b58
20 changed files with 1081 additions and 501 deletions
+5 -3
View File
@@ -1,4 +1,4 @@
import { Injectable, NotFoundException } from '@nestjs/common';
import { Injectable, Logger, NotFoundException } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Note } from './note.entity';
@@ -11,6 +11,8 @@ import { I18nService } from '../i18n/i18n.service';
@Injectable()
export class NoteService {
private readonly logger = new Logger(NoteService.name);
// Directory will be created dynamically per user
private getScreenshotsDir(userId: string) {
return path.join(process.cwd(), 'uploads', 'notes-screenshots', userId);
@@ -153,7 +155,7 @@ export class NoteService {
}
// Optional: Add logging to help debug permission issues
console.log(`User ${userId} attempting to add note to group ${groupId}`);
this.logger.log('User ' + userId + ' attempting to add note to group ' + groupId);
}
if (categoryId === '') {
@@ -176,7 +178,7 @@ export class NoteService {
screenshot.buffer,
);
} catch (error) {
console.error('OCR extraction failed:', error);
this.logger.error('OCR extraction failed:', error);
// Continue without OCR text if extraction fails
}