feat: release undergraduate integration 0.7.0
This commit is contained in:
@@ -8,13 +8,16 @@ import '../features/school/undergraduate/exam_adapter.dart';
|
||||
|
||||
class ExamFileImport {
|
||||
static ExamSchedule parse(String content) {
|
||||
if (utf8.encode(content).length > 2 * 1024 * 1024)
|
||||
if (utf8.encode(content).length > 2 * 1024 * 1024) {
|
||||
throw const FormatException('文件不能超过2MB');
|
||||
}
|
||||
final doc = html.parse(content.replaceFirst('\uFEFF', ''));
|
||||
if (doc.querySelector('#stdExamTableForm') != null)
|
||||
if (doc.querySelector('#stdExamTableForm') != null) {
|
||||
return UndergraduateExamAdapter.extract(content);
|
||||
if (doc.querySelector('#sample-table-1') != null)
|
||||
}
|
||||
if (doc.querySelector('#sample-table-1') != null) {
|
||||
return SchoolExamAdapter.extract(content);
|
||||
}
|
||||
throw const FormatException('未识别到学校排考页面');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user