diff --git a/src/timemanagerapp/.gitignore b/src/timemanagerapp/.gitignore
new file mode 100644
index 0000000..24476c5
--- /dev/null
+++ b/src/timemanagerapp/.gitignore
@@ -0,0 +1,44 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
diff --git a/src/timemanagerapp/.metadata b/src/timemanagerapp/.metadata
new file mode 100644
index 0000000..620e877
--- /dev/null
+++ b/src/timemanagerapp/.metadata
@@ -0,0 +1,45 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: "ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a"
+ channel: "stable"
+
+project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ - platform: android
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ - platform: ios
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ - platform: linux
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ - platform: macos
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ - platform: web
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ - platform: windows
+ create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+ base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/src/timemanagerapp/README.md b/src/timemanagerapp/README.md
new file mode 100644
index 0000000..0a0c87c
--- /dev/null
+++ b/src/timemanagerapp/README.md
@@ -0,0 +1,16 @@
+# timemanagerapp
+
+A new Flutter project.
+
+## Getting Started
+
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
+
+For help getting started with Flutter development, view the
+[online documentation](https://docs.flutter.dev/), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
diff --git a/src/timemanagerapp/analysis_options.yaml b/src/timemanagerapp/analysis_options.yaml
new file mode 100644
index 0000000..2a49e61
--- /dev/null
+++ b/src/timemanagerapp/analysis_options.yaml
@@ -0,0 +1,29 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
+include: package:flutter_lints/flutter.yaml
+
+linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at https://dart.dev/lints.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
+ rules:
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+ prefer_const_constructors: false
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/src/timemanagerapp/android/.gitignore b/src/timemanagerapp/android/.gitignore
new file mode 100644
index 0000000..6f56801
--- /dev/null
+++ b/src/timemanagerapp/android/.gitignore
@@ -0,0 +1,13 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+key.properties
+**/*.keystore
+**/*.jks
diff --git a/src/timemanagerapp/android/app/build.gradle b/src/timemanagerapp/android/app/build.gradle
new file mode 100644
index 0000000..d6f4833
--- /dev/null
+++ b/src/timemanagerapp/android/app/build.gradle
@@ -0,0 +1,57 @@
+plugins {
+ id "com.android.application"
+ id "kotlin-android"
+ id "dev.flutter.flutter-gradle-plugin"
+}
+
+def localProperties = new Properties()
+def localPropertiesFile = rootProject.file('local.properties')
+if (localPropertiesFile.exists()) {
+ localPropertiesFile.withReader('UTF-8') { reader ->
+ localProperties.load(reader)
+ }
+}
+
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
+if (flutterVersionCode == null) {
+ flutterVersionCode = '1'
+}
+
+def flutterVersionName = localProperties.getProperty('flutter.versionName')
+if (flutterVersionName == null) {
+ flutterVersionName = '1.0'
+}
+
+android {
+ namespace "com.example.timemanagerapp"
+ compileSdkVersion flutter.compileSdkVersion
+ ndkVersion flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId "com.example.timemanagerapp"
+ // You can update the following values to match your application needs.
+ // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
+ minSdkVersion flutter.minSdkVersion
+ targetSdkVersion flutter.targetSdkVersion
+ versionCode flutterVersionCode.toInteger()
+ versionName flutterVersionName
+ }
+
+ buildTypes {
+ release {
+ // TODO: Add your own signing config for the release build.
+ // Signing with the debug keys for now, so `flutter run --release` works.
+ signingConfig signingConfigs.debug
+ }
+ }
+}
+
+flutter {
+ source '../..'
+}
diff --git a/src/timemanagerapp/android/app/src/debug/AndroidManifest.xml b/src/timemanagerapp/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/src/timemanagerapp/android/app/src/main/AndroidManifest.xml b/src/timemanagerapp/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..f6f59e2
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/android/app/src/main/java/com/example/timemanagerapp/MainActivity.java b/src/timemanagerapp/android/app/src/main/java/com/example/timemanagerapp/MainActivity.java
new file mode 100644
index 0000000..95ba7af
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/main/java/com/example/timemanagerapp/MainActivity.java
@@ -0,0 +1,6 @@
+package com.example.timemanagerapp;
+
+import io.flutter.embedding.android.FlutterActivity;
+
+public class MainActivity extends FlutterActivity {
+}
diff --git a/src/timemanagerapp/android/app/src/main/res/drawable-v21/launch_background.xml b/src/timemanagerapp/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 0000000..f74085f
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/android/app/src/main/res/drawable/launch_background.xml b/src/timemanagerapp/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 0000000..304732f
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/src/timemanagerapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..db77bb4
Binary files /dev/null and b/src/timemanagerapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/src/timemanagerapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/src/timemanagerapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..17987b7
Binary files /dev/null and b/src/timemanagerapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/src/timemanagerapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/src/timemanagerapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..09d4391
Binary files /dev/null and b/src/timemanagerapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/src/timemanagerapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/src/timemanagerapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..d5f1c8d
Binary files /dev/null and b/src/timemanagerapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/src/timemanagerapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/src/timemanagerapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..4d6372e
Binary files /dev/null and b/src/timemanagerapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/src/timemanagerapp/android/app/src/main/res/values-night/styles.xml b/src/timemanagerapp/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..06952be
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/android/app/src/main/res/values/styles.xml b/src/timemanagerapp/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..cb1ef88
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/android/app/src/profile/AndroidManifest.xml b/src/timemanagerapp/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 0000000..399f698
--- /dev/null
+++ b/src/timemanagerapp/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/src/timemanagerapp/android/build.gradle b/src/timemanagerapp/android/build.gradle
new file mode 100644
index 0000000..f7eb7f6
--- /dev/null
+++ b/src/timemanagerapp/android/build.gradle
@@ -0,0 +1,31 @@
+buildscript {
+ ext.kotlin_version = '1.7.10'
+ repositories {
+ google()
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:7.3.0'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.buildDir = '../build'
+subprojects {
+ project.buildDir = "${rootProject.buildDir}/${project.name}"
+}
+subprojects {
+ project.evaluationDependsOn(':app')
+}
+
+tasks.register("clean", Delete) {
+ delete rootProject.buildDir
+}
diff --git a/src/timemanagerapp/android/gradle.properties b/src/timemanagerapp/android/gradle.properties
new file mode 100644
index 0000000..94adc3a
--- /dev/null
+++ b/src/timemanagerapp/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx1536M
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/src/timemanagerapp/android/gradle/wrapper/gradle-wrapper.properties b/src/timemanagerapp/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..3c472b9
--- /dev/null
+++ b/src/timemanagerapp/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
diff --git a/src/timemanagerapp/android/settings.gradle b/src/timemanagerapp/android/settings.gradle
new file mode 100644
index 0000000..55c4ca8
--- /dev/null
+++ b/src/timemanagerapp/android/settings.gradle
@@ -0,0 +1,20 @@
+pluginManagement {
+ def flutterSdkPath = {
+ def properties = new Properties()
+ file("local.properties").withInputStream { properties.load(it) }
+ def flutterSdkPath = properties.getProperty("flutter.sdk")
+ assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
+ return flutterSdkPath
+ }
+ settings.ext.flutterSdkPath = flutterSdkPath()
+
+ includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
+
+ plugins {
+ id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
+ }
+}
+
+include ":app"
+
+apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
diff --git a/src/新建文本文档.txt b/src/timemanagerapp/assets/data/新建文本文档.txt
similarity index 100%
rename from src/新建文本文档.txt
rename to src/timemanagerapp/assets/data/新建文本文档.txt
diff --git a/src/timemanagerapp/assets/fonts/新建文本文档.txt b/src/timemanagerapp/assets/fonts/新建文本文档.txt
new file mode 100644
index 0000000..e69de29
diff --git a/src/timemanagerapp/assets/images/新建文本文档.txt b/src/timemanagerapp/assets/images/新建文本文档.txt
new file mode 100644
index 0000000..e69de29
diff --git a/src/timemanagerapp/assets/pythoncode/getschedule.py b/src/timemanagerapp/assets/pythoncode/getschedule.py
new file mode 100644
index 0000000..80018e4
--- /dev/null
+++ b/src/timemanagerapp/assets/pythoncode/getschedule.py
@@ -0,0 +1,49 @@
+# example.py
+import base64
+import os
+import sys
+from pprint import pprint
+import sys
+
+from zfn_api import Client
+
+sys.stdout = open(sys.stdout.fileno(), mode='w', encoding='utf-8', buffering=1)
+
+cookies = {}
+base_url = 'http://jwgl.cauc.edu.cn'
+raspisanie = []
+ignore_type = []
+detail_category_type = []
+timeout = 5
+
+stu = Client(cookies=cookies, base_url=base_url, raspisanie=raspisanie, ignore_type=ignore_type, detail_category_type=detail_category_type, timeout=timeout)
+
+if cookies == {}:
+ lgn = stu.login(input(), input())
+ if lgn["code"] == 1001:
+ verify_data = lgn["data"]
+ with open(os.path.abspath("kaptcha.png"), "wb") as pic:
+ pic.write(base64.b64decode(verify_data.pop("kaptcha_pic")))
+ verify_data["kaptcha"] = input("输入验证码:")
+ ret = stu.login_with_kaptcha(**verify_data)
+ if ret["code"] != 1000:
+ pprint(ret)
+ sys.exit()
+ pprint(ret)
+ elif lgn["code"] != 1000:
+ pprint(lgn)
+ sys.exit()
+
+# result = stu.get_info('210340156') # 获取个人信息
+# # result = stu.get_grade(2021, 2) # 获取成绩信息,若接口错误请添加 use_personal_info=True,只填年份获取全年
+# result = stu.get_schedule(2022, 2) # 获取课程表信息
+# # result = stu.get_academia() # 获取学业生涯数据
+# # result = stu.get_notifications() # 获取通知消息
+result = stu.get_selected_courses(int(input()), int(input())) # 获取已选课程信息
+# # result = stu.get_block_courses(2021, 1, 1) # 获取选课板块课列表
+pprint(result)
+
+# # file_result = stu.get_academia_pdf()["data"] # 获取学业生涯(学生成绩总表)PDF文件
+# file_result = stu.get_schedule_pdf(2022, 1)["data"] # 获取课程表PDF文件
+# with open(os.path.abspath("preview.pdf"), "wb") as f:
+# f.write(file_result)
\ No newline at end of file
diff --git a/src/timemanagerapp/assets/pythoncode/main.py b/src/timemanagerapp/assets/pythoncode/main.py
new file mode 100644
index 0000000..19d65ad
--- /dev/null
+++ b/src/timemanagerapp/assets/pythoncode/main.py
@@ -0,0 +1,46 @@
+# example.py
+import base64
+import os
+import sys
+from pprint import pprint
+
+from zfn_api import Client
+
+cookies = {}
+base_url = 'http://jwgl.cauc.edu.cn'
+raspisanie = []
+ignore_type = []
+detail_category_type = []
+timeout = 5
+
+stu = Client(cookies=cookies, base_url=base_url, raspisanie=raspisanie, ignore_type=ignore_type, detail_category_type=detail_category_type, timeout=timeout)
+
+if cookies == {}:
+ lgn = stu.login("210340156", "123111@qaq")
+ if lgn["code"] == 1001:
+ verify_data = lgn["data"]
+ with open(os.path.abspath("kaptcha.png"), "wb") as pic:
+ pic.write(base64.b64decode(verify_data.pop("kaptcha_pic")))
+ verify_data["kaptcha"] = input("输入验证码:")
+ ret = stu.login_with_kaptcha(**verify_data)
+ if ret["code"] != 1000:
+ pprint(ret)
+ sys.exit()
+ pprint(ret)
+ elif lgn["code"] != 1000:
+ pprint(lgn)
+ sys.exit()
+
+# result = stu.get_info('210340156') # 获取个人信息
+# # result = stu.get_grade(2021, 2) # 获取成绩信息,若接口错误请添加 use_personal_info=True,只填年份获取全年
+# result = stu.get_schedule(2022, 2) # 获取课程表信息
+# # result = stu.get_academia() # 获取学业生涯数据
+# # result = stu.get_notifications() # 获取通知消息
+result = stu.get_selected_courses(2022, 2) # 获取已选课程信息
+# # result = stu.get_block_courses(2021, 1, 1) # 获取选课板块课列表
+pprint(result)
+
+# # file_result = stu.get_academia_pdf()["data"] # 获取学业生涯(学生成绩总表)PDF文件
+# file_result = stu.get_schedule_pdf(2022, 1)["data"] # 获取课程表PDF文件
+# with open(os.path.abspath("preview.pdf"), "wb") as f:
+# f.write(file_result)
\ No newline at end of file
diff --git a/src/timemanagerapp/assets/pythoncode/zfn_api.py b/src/timemanagerapp/assets/pythoncode/zfn_api.py
new file mode 100644
index 0000000..6dc408e
--- /dev/null
+++ b/src/timemanagerapp/assets/pythoncode/zfn_api.py
@@ -0,0 +1,1559 @@
+import base64
+import binascii
+import json
+import re
+import time
+import traceback
+import unicodedata
+from urllib.parse import urljoin
+
+import requests
+import rsa
+from pyquery import PyQuery as pq
+from requests import exceptions
+
+RASPIANIE = [
+ ["8:00", "8:40"],
+ ["8:45", "9:25"],
+ ["9:30", "10:10"],
+ ["10:30", "11:10"],
+ ["11:15", "11:55"],
+ ["14:30", "15:10"],
+ ["15:15", "15:55"],
+ ["16:05", "16:45"],
+ ["16:50", "17:30"],
+ ["18:40", "19:20"],
+ ["19:25", "20:05"],
+ ["20:10", "20:50"],
+ ["20:55", "21:35"],
+]
+
+
+class Client:
+ raspisanie = []
+ ignore_type = []
+
+ def __init__(self, cookies={}, **kwargs):
+ # 基础配置
+ self.base_url = kwargs.get("base_url")
+ self.raspisanie = kwargs.get("raspisanie", RASPIANIE)
+ self.ignore_type = kwargs.get("ignore_type", [])
+ self.detail_category_type = kwargs.get("detail_category_type", [])
+ self.timeout = kwargs.get("timeout", 3)
+ Client.raspisanie = self.raspisanie
+ Client.ignore_type = self.ignore_type
+
+ self.key_url = urljoin(self.base_url, "xtgl/login_getPublicKey.html")
+ self.login_url = urljoin(self.base_url, "xtgl/login_slogin.html")
+ self.kaptcha_url = urljoin(self.base_url, "kaptcha")
+ self.headers = requests.utils.default_headers()
+ self.headers["Referer"] = self.login_url
+ self.headers[
+ "User-Agent"
+ ] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
+ self.headers[
+ "Accept"
+ ] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"
+ self.sess = requests.Session()
+ self.sess.keep_alive = False
+ self.cookies = cookies
+
+ def login(self, sid, password):
+ """登录教务系统"""
+ need_verify = False
+ try:
+ # 登录页
+ req_csrf = self.sess.get(
+ self.login_url, headers=self.headers, timeout=self.timeout
+ )
+ if req_csrf.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ # 获取csrf_token
+ doc = pq(req_csrf.text)
+ csrf_token = doc("#csrftoken").attr("value")
+ pre_cookies = self.sess.cookies.get_dict()
+ # 获取publicKey并加密密码
+ req_pubkey = self.sess.get(
+ self.key_url, headers=self.headers, timeout=self.timeout
+ ).json()
+ modulus = req_pubkey["modulus"]
+ exponent = req_pubkey["exponent"]
+ if str(doc("input#yzm")) == "":
+ # 不需要验证码
+ encrypt_password = self.encrypt_password(password, modulus, exponent)
+ # 登录数据
+ login_data = {
+ "csrftoken": csrf_token,
+ "yhm": sid,
+ "mm": encrypt_password,
+ }
+ # 请求登录
+ req_login = self.sess.post(
+ self.login_url,
+ headers=self.headers,
+ data=login_data,
+ timeout=self.timeout,
+ )
+ doc = pq(req_login.text)
+ tips = doc("p#tips")
+ if str(tips) != "":
+ if "用户名或密码" in tips.text():
+ return {"code": 1002, "msg": "用户名或密码不正确"}
+ return {"code": 998, "msg": tips.text()}
+ self.cookies = self.sess.cookies.get_dict()
+ return {"code": 1000, "msg": "登录成功", "data": {"cookies": self.cookies}}
+ # 需要验证码,返回相关页面验证信息给用户,TODO: 增加更多验证方式
+ need_verify = True
+ req_kaptcha = self.sess.get(
+ self.kaptcha_url, headers=self.headers, timeout=self.timeout
+ )
+ kaptcha_pic = base64.b64encode(req_kaptcha.content).decode()
+ return {
+ "code": 1001,
+ "msg": "获取验证码成功",
+ "data": {
+ "sid": sid,
+ "csrf_token": csrf_token,
+ "cookies": pre_cookies,
+ "password": password,
+ "modulus": modulus,
+ "exponent": exponent,
+ "kaptcha_pic": kaptcha_pic,
+ "timestamp": time.time(),
+ },
+ }
+ except exceptions.Timeout:
+ msg = "获取验证码超时" if need_verify else "登录超时"
+ return {"code": 1003, "msg": msg}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ msg = "获取验证码时未记录的错误" if need_verify else "登录时未记录的错误"
+ return {"code": 999, "msg": f"{msg}:{str(e)}"}
+
+ def login_with_kaptcha(
+ self, sid, csrf_token, cookies, password, modulus, exponent, kaptcha, **kwargs
+ ):
+ """需要验证码的登陆"""
+ try:
+ encrypt_password = self.encrypt_password(password, modulus, exponent)
+ login_data = {
+ "csrftoken": csrf_token,
+ "yhm": sid,
+ "mm": encrypt_password,
+ "yzm": kaptcha,
+ }
+ req_login = self.sess.post(
+ self.login_url,
+ headers=self.headers,
+ cookies=cookies,
+ data=login_data,
+ timeout=self.timeout,
+ )
+ if req_login.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ # 请求登录
+ doc = pq(req_login.text)
+ tips = doc("p#tips")
+ if str(tips) != "":
+ if "验证码" in tips.text():
+ return {"code": 1004, "msg": "验证码输入错误"}
+ if "用户名或密码" in tips.text():
+ return {"code": 1002, "msg": "用户名或密码不正确"}
+ return {"code": 998, "msg": tips.text()}
+ self.cookies = self.sess.cookies.get_dict()
+ # 不同学校系统兼容差异
+ if not self.cookies.get("route"):
+ route_cookies = {
+ "JSESSIONID": self.cookies["JSESSIONID"],
+ "route": cookies["route"],
+ }
+ self.cookies = route_cookies
+ else:
+ return {"code": 1000, "msg": "登录成功", "data": {"cookies": self.cookies}}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "登录超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "验证码登录时未记录的错误:" + str(e)}
+
+ def get_info(self):
+ """获取个人信息"""
+ url = urljoin(self.base_url, "xsxxxggl/xsxxwh_cxCkDgxsxx.html?gnmkdm=N100801")
+ try:
+ req_info = self.sess.get(
+ url,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_info.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_info.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ info = req_info.json()
+ if info is None:
+ return self._get_info()
+ result = {
+ "sid": info.get("xh"),
+ "name": info.get("xm"),
+ "college_name": info.get("zsjg_id", info.get("jg_id")),
+ "major_name": info.get("zszyh_id", info.get("zyh_id")),
+ "class_name": info.get("bh_id", info.get("xjztdm")),
+ "status": info.get("xjztdm"),
+ "enrollment_date": info.get("rxrq"),
+ "candidate_number": info.get("ksh"),
+ "graduation_school": info.get("byzx"),
+ "domicile": info.get("jg"),
+ "postal_code": info.get("yzbm"),
+ "politics_status": info.get("zzmmm"),
+ "nationality": info.get("mzm"),
+ "education": info.get("pyccdm"),
+ "phone_number": info.get("sjhm"),
+ "parents_number": info.get("gddh"),
+ "email": info.get("dzyx"),
+ "birthday": info.get("csrq"),
+ "id_number": info.get("zjhm"),
+ }
+ return {"code": 1000, "msg": "获取个人信息成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取个人信息超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取个人信息时未记录的错误:" + str(e)}
+
+ def _get_info(self):
+ """获取个人信息"""
+ url = urljoin(self.base_url, "xsxxxggl/xsgrxxwh_cxXsgrxx.html?gnmkdm=N100801")
+ try:
+ req_info = self.sess.get(
+ url, headers=self.headers, cookies=self.cookies, timeout=self.timeout
+ )
+ if req_info.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_info.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ pending_result = {}
+ # 学生基本信息
+ for ul_item in doc.find("div.col-sm-6").items():
+ content = pq(ul_item).find("div.form-group")
+ # key = re.findall(r'^[\u4E00-\u9FA5A-Za-z0-9]+', pq(content).find('label.col-sm-4.control-label').text())[0]
+ key = pq(content).find("label.col-sm-4.control-label").text()
+ value = pq(content).find("div.col-sm-8 p.form-control-static").text()
+ # 到这一步,解析到的数据基本就是一个键值对形式的html数据了,比如"[学号:]:123456"
+ pending_result[key] = value
+ # 学生学籍信息,其他信息,联系方式
+ for ul_item in doc.find("div.col-sm-4").items():
+ content = pq(ul_item).find("div.form-group")
+ key = pq(content).find("label.col-sm-4.control-label").text()
+ value = pq(content).find("div.col-sm-8 p.form-control-static").text()
+ # 到这一步,解析到的数据基本就是一个键值对形式的html数据了,比如"[学号:]:123456"
+ pending_result[key] = value
+ if pending_result.get("学号:") == "":
+ return {
+ "code": 1014,
+ "msg": "当前学年学期无学生时盒数据,您可能已经毕业了。\n\n如果是专升本同学,请使用专升本后的新学号登录~",
+ }
+ result = {
+ "sid": pending_result["学号:"],
+ "name": pending_result["姓名:"],
+ # "birthday": "无" if pending_result.get("出生日期:") == '' else pending_result["出生日期:"],
+ # "id_number": "无" if pending_result.get("证件号码:") == '' else pending_result["证件号码:"],
+ # "candidate_number": "无" if pending_result.get("考生号:") == '' else pending_result["考生号:"],
+ # "status": "无" if pending_result.get("学籍状态:") == '' else pending_result["学籍状态:"],
+ # "entry_date": "无" if pending_result.get("入学日期:") == '' else pending_result["入学日期:"],
+ # "graduation_school": "无" if pending_result.get("毕业中学:") == '' else pending_result["毕业中学:"],
+ "domicile": "无"
+ if pending_result.get("籍贯:") == ""
+ else pending_result["籍贯:"],
+ "phone_number": "无"
+ if pending_result.get("手机号码:") == ""
+ else pending_result["手机号码:"],
+ "parents_number": "无",
+ "email": "无"
+ if pending_result.get("电子邮箱:") == ""
+ else pending_result["电子邮箱:"],
+ "political_status": "无"
+ if pending_result.get("政治面貌:") == ""
+ else pending_result["政治面貌:"],
+ "national": "无"
+ if pending_result.get("民族:") == ""
+ else pending_result["民族:"],
+ # "education": "无" if pending_result.get("培养层次:") == '' else pending_result["培养层次:"],
+ # "postal_code": "无" if pending_result.get("邮政编码:") == '' else pending_result["邮政编码:"],
+ # "grade": int(pending_result["学号:"][0:4]),
+ }
+ if pending_result.get("学院名称:") is not None:
+ # 如果在个人信息页面获取到了学院班级
+ result.update(
+ {
+ "college_name": "无"
+ if pending_result.get("学院名称:") == ""
+ else pending_result["学院名称:"],
+ "major_name": "无"
+ if pending_result.get("专业名称:") == ""
+ else pending_result["专业名称:"],
+ "class_name": "无"
+ if pending_result.get("班级名称:") == ""
+ else pending_result["班级名称:"],
+ }
+ )
+ else:
+ # 如果个人信息页面获取不到学院班级,则此处需要请求另外一个地址以获取学院、专业、班级等信息
+ _url = urljoin(
+ self.base_url,
+ "xszbbgl/xszbbgl_cxXszbbsqIndex.html?doType=details&gnmkdm=N106005",
+ )
+ _req_info = self.sess.post(
+ _url,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ data={"offDetails": "1", "gnmkdm": "N106005", "czdmKey": "00"},
+ )
+ _doc = pq(_req_info.text)
+ if _doc("p.error_title").text() != "无功能权限,":
+ # 通过学生证补办申请入口,来补全部分信息
+ for ul_item in _doc.find("div.col-sm-6").items():
+ content = pq(ul_item).find("div.form-group")
+ key = (
+ pq(content).find("label.col-sm-4.control-label").text()
+ + ":"
+ ) # 为了保持格式一致,这里加个冒号
+ value = (
+ pq(content).find("div.col-sm-8 label.control-label").text()
+ )
+ # 到这一步,解析到的数据基本就是一个键值对形式的html数据了,比如"[学号:]:123456"
+ pending_result[key] = value
+ result.update(
+ {
+ "college_name": "无"
+ if pending_result.get("学院:") is None
+ else pending_result["学院:"],
+ "major_name": "无"
+ if pending_result.get("专业:") is None
+ else pending_result["专业:"],
+ "class_name": "无"
+ if pending_result.get("班级:") is None
+ else pending_result["班级:"],
+ }
+ )
+ return {"code": 1000, "msg": "获取个人信息成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取个人信息超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取个人信息时未记录的错误:" + str(e)}
+
+ def get_grade(self, year: int, term: int = 0, use_personal_info: bool = False):
+ """
+ 获取成绩
+ use_personal_info: 是否使用获取个人信息接口获取成绩
+ """
+ url = urljoin(
+ self.base_url,
+ "cjcx/cjcx_cxDgXscj.html?doType=query&gnmkdm=N305005"
+ if use_personal_info
+ else "cjcx/cjcx_cxXsgrcj.html?doType=query&gnmkdm=N305005",
+ )
+ temp_term = term
+ term = term**2 * 3
+ term = "" if term == 0 else term
+ data = {
+ "xnm": str(year), # 学年数
+ "xqm": str(term), # 学期数,第一学期为3,第二学期为12, 整个学年为空''
+ "_search": "false",
+ "nd": int(time.time() * 1000),
+ "queryModel.showCount": "100", # 每页最多条数
+ "queryModel.currentPage": "1",
+ "queryModel.sortName": "",
+ "queryModel.sortOrder": "asc",
+ "time": "0", # 查询次数
+ }
+ try:
+ req_grade = self.sess.post(
+ url,
+ headers=self.headers,
+ data=data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_grade.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_grade.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ grade = req_grade.json()
+ grade_items = grade.get("items")
+ if not grade_items:
+ return {"code": 1005, "msg": "获取内容为空"}
+ result = {
+ "sid": grade_items[0]["xh"],
+ "name": grade_items[0]["xm"],
+ "year": year,
+ "term": temp_term,
+ "count": len(grade_items),
+ "courses": [
+ {
+ "course_id": i.get("kch_id"),
+ "title": i.get("kcmc"),
+ "teacher": i.get("jsxm"),
+ "class_name": i.get("jxbmc"),
+ "credit": self.align_floats(i.get("xf")),
+ "category": i.get("kclbmc"),
+ "nature": i.get("kcxzmc"),
+ "grade": self.parse_int(i.get("cj")),
+ "grade_point": self.align_floats(i.get("jd")),
+ "grade_nature": i.get("ksxz"),
+ "start_college": i.get("kkbmmc"),
+ "mark": i.get("kcbj"),
+ }
+ for i in grade_items
+ ],
+ }
+ return {"code": 1000, "msg": "获取成绩成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取成绩超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取成绩时未记录的错误:" + str(e)}
+
+ def get_schedule(self, year: int, term: int):
+ """获取课程表信息"""
+ url = urljoin(self.base_url, "kbcx/xskbcx_cxXsKb.html?gnmkdm=N2151")
+ temp_term = term
+ term = term**2 * 3
+ data = {"xnm": str(year), "xqm": str(term)}
+ try:
+ req_schedule = self.sess.post(
+ url,
+ headers=self.headers,
+ data=data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_schedule.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_schedule.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ schedule = req_schedule.json()
+ if not schedule.get("kbList"):
+ return {"code": 1005, "msg": "获取内容为空"}
+ result = {
+ "sid": schedule["xsxx"].get("XH"),
+ "name": schedule["xsxx"].get("XM"),
+ "year": year,
+ "term": temp_term,
+ "count": len(schedule["kbList"]),
+ "courses": [
+ {
+ "course_id": i.get("kch_id"),
+ "title": i.get("kcmc"),
+ "teacher": i.get("xm"),
+ "class_name": i.get("jxbmc"),
+ "credit": self.align_floats(i.get("xf")),
+ "weekday": self.parse_int(i.get("xqj")),
+ "time": self.display_course_time(i.get("jc")),
+ "sessions": i.get("jc"),
+ "list_sessions": self.list_sessions(i.get("jc")),
+ "weeks": i.get("zcd"),
+ "list_weeks": self.list_weeks(i.get("zcd")),
+ "evaluation_mode": i.get("khfsmc"),
+ "campus": i.get("xqmc"),
+ "place": i.get("cdmc"),
+ "hours_composition": i.get("kcxszc"),
+ "weekly_hours": self.parse_int(i.get("zhxs")),
+ "total_hours": self.parse_int(i.get("zxs")),
+ }
+ for i in schedule["kbList"]
+ ],
+ "extra_courses": [i.get("qtkcgs") for i in schedule.get("sjkList")],
+ }
+ result = self.split_merge_display(result)
+ return {"code": 1000, "msg": "获取课表成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取课表超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取课表时未记录的错误:" + str(e)}
+
+ def get_academia(self):
+ """获取学业生涯情况"""
+ url_main = urljoin(
+ self.base_url,
+ "xsxy/xsxyqk_cxXsxyqkIndex.html?gnmkdm=N105515&layout=default",
+ )
+ url_info = urljoin(
+ self.base_url, "xsxy/xsxyqk_cxJxzxjhxfyqKcxx.html?gnmkdm=N105515"
+ )
+ try:
+ req_main = self.sess.get(
+ url_main,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ stream=True,
+ )
+ if req_main.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc_main = pq(req_main.text)
+ if doc_main("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ if str(doc_main("div.alert-danger")) != "":
+ return {"code": 998, "msg": doc_main("div.alert-danger").text()}
+ sid = doc_main("form#form input#xh_id").attr("value")
+ display_statistics = (
+ doc_main("div#alertBox").text().replace(" ", "").replace("\n", "")
+ )
+ sid = doc_main("input#xh_id").attr("value")
+ statistics = self.get_academia_statistics(display_statistics)
+ type_statistics = self.get_academia_type_statistics(req_main.text)
+ details = {}
+ for type in type_statistics.keys():
+ details[type] = self.sess.post(
+ url_info,
+ headers=self.headers,
+ data={"xfyqjd_id": type_statistics[type]["id"]},
+ cookies=self.cookies,
+ timeout=self.timeout,
+ stream=True,
+ ).json()
+ result = {
+ "sid": sid,
+ "statistics": statistics,
+ "details": [
+ {
+ "type": type,
+ "credits": type_statistics[type]["credits"],
+ "courses": [
+ {
+ "course_id": i.get("KCH"),
+ "title": i.get("KCMC"),
+ "situation": self.parse_int(i.get("XDZT")),
+ "display_term": self.get_display_term(
+ sid, i.get("JYXDXNM"), i.get("JYXDXQMC")
+ ),
+ "credit": self.align_floats(i.get("XF")),
+ "category": self.get_course_category(type, i),
+ "nature": i.get("KCXZMC"),
+ "max_grade": self.parse_int(i.get("MAXCJ")),
+ "grade_point": self.align_floats(i.get("JD")),
+ }
+ for i in details[type]
+ ],
+ }
+ for type in type_statistics.keys()
+ if len(details[type]) > 0
+ ],
+ }
+ return {"code": 1000, "msg": "获取学业情况成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取学业情况超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取学业情况时未记录的错误:" + str(e)}
+
+ def get_academia_pdf(self):
+ """获取学业生涯(学生成绩总表)pdf"""
+ url_view = urljoin(self.base_url, "bysxxcx/xscjzbdy_dyXscjzbView.html")
+ url_window = urljoin(self.base_url, "bysxxcx/xscjzbdy_dyCjdyszxView.html")
+ url_policy = urljoin(self.base_url, "xtgl/bysxxcx/xscjzbdy_cxXsCount.html")
+ url_filetype = urljoin(self.base_url, "bysxxcx/xscjzbdy_cxGswjlx.html")
+ url_common = urljoin(self.base_url, "common/common_cxJwxtxx.html")
+ url_file = urljoin(self.base_url, "bysxxcx/xscjzbdy_dyList.html")
+ url_progress = urljoin(self.base_url, "xtgl/progress_cxProgressStatus.html")
+ data = {
+ "gsdygx": "10628-zw-mrgs",
+ "ids": "",
+ "bdykcxzDms": "",
+ "cytjkcxzDms": "",
+ "cytjkclbDms": "",
+ "cytjkcgsDms": "",
+ "bjgbdykcxzDms": "",
+ "bjgbdyxxkcxzDms": "",
+ "djksxmDms": "",
+ "cjbzmcDms": "",
+ "cjdySzxs": "",
+ "wjlx": "pdf",
+ }
+
+ try:
+ data_view = {"time": str(round(time.time() * 1000)), "gnmkdm": "N558020"}
+ data_params = data_view
+ del data_params["time"]
+ # View接口
+ req_view = self.sess.post(
+ url_view,
+ headers=self.headers,
+ data=data_view,
+ params=data_view,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_view.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_view.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ # Window接口
+ data_window = {"xh": ""}
+ self.sess.post(
+ url_window,
+ headers=self.headers,
+ data=data_window,
+ params=data_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ # 许可接口
+ data_policy = data
+ del data_policy["wjlx"]
+ self.sess.post(
+ url_policy,
+ headers=self.headers,
+ data=data_policy,
+ params=data_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ # 文件类型接口
+ data_filetype = data_policy
+ self.sess.post(
+ url_filetype,
+ headers=self.headers,
+ data=data_filetype,
+ params=data_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ # Common接口
+ self.sess.post(
+ url_common,
+ headers=self.headers,
+ data=data_params,
+ params=data_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ # 获取PDF文件URL
+ req_file = self.sess.post(
+ url_file,
+ headers=self.headers,
+ data=data,
+ params=data_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ doc = pq(req_file.text)
+ if "错误" in doc("title").text():
+ error = doc("p.error_title").text()
+ return {"code": 998, "msg": error}
+ # 进度接口
+ data_progress = {
+ "key": "score_print_processed",
+ "gnmkdm": "N558020",
+ }
+ self.sess.post(
+ url_progress,
+ headers=self.headers,
+ data=data_progress,
+ params=data_progress,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ # 生成PDF文件URL
+ pdf = (
+ req_file.text.replace("#成功", "")
+ .replace('"', "")
+ .replace("/", "\\")
+ .replace("\\\\", "/")
+ )
+ # 下载PDF文件
+ req_pdf = self.sess.get(
+ urljoin(self.base_url, pdf),
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout + 2,
+ )
+ result = req_pdf.content # 二进制内容
+ return {"code": 1000, "msg": "获取学生成绩总表pdf成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取成绩总表pdf超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取成绩总表pdf时未记录的错误:" + str(e)}
+
+ def get_schedule_pdf(self, year: int, term: int, name: str = "导出"):
+ """获取课表pdf"""
+ url_policy = urljoin(self.base_url, "kbdy/bjkbdy_cxXnxqsfkz.html")
+ url_file = urljoin(self.base_url, "kbcx/xskbcx_cxXsShcPdf.html")
+ origin_term = term
+ term = term**2 * 3
+ data = {
+ "xm": name,
+ "xnm": str(year),
+ "xqm": str(term),
+ "xnmc": f"{year}-{year + 1}",
+ "xqmmc": str(origin_term),
+ "jgmc": "undefined",
+ "xxdm": "",
+ "xszd.sj": "true",
+ "xszd.cd": "true",
+ "xszd.js": "true",
+ "xszd.jszc": "false",
+ "xszd.jxb": "true",
+ "xszd.xkbz": "true",
+ "xszd.kcxszc": "true",
+ "xszd.zhxs": "true",
+ "xszd.zxs": "true",
+ "xszd.khfs": "true",
+ "xszd.xf": "true",
+ "xszd.skfsmc": "false",
+ "kzlx": "dy",
+ }
+
+ try:
+ # 许可接口
+ pilicy_params = {"gnmkdm": "N2151"}
+ req_policy = self.sess.post(
+ url_policy,
+ headers=self.headers,
+ data=data,
+ params=pilicy_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_policy.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_policy.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ # 获取PDF文件URL
+ file_params = {"doType": "table"}
+ req_file = self.sess.post(
+ url_file,
+ headers=self.headers,
+ data=data,
+ params=file_params,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ doc = pq(req_file.text)
+ if "错误" in doc("title").text():
+ error = doc("p.error_title").text()
+ return {"code": 998, "msg": error}
+ result = req_file.content # 二进制内容
+ return {"code": 1000, "msg": "获取课程表pdf成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取课程表pdf超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取课程表pdf时未记录的错误:" + str(e)}
+
+ def get_notifications(self):
+ """获取通知消息"""
+ url = urljoin(self.base_url, "xtgl/index_cxDbsy.html?doType=query")
+ data = {
+ "sfyy": "0", # 是否已阅,未阅未1,已阅为2
+ "flag": "1",
+ "_search": "false",
+ "nd": int(time.time() * 1000),
+ "queryModel.showCount": "1000", # 最多条数
+ "queryModel.currentPage": "1", # 当前页数
+ "queryModel.sortName": "cjsj",
+ "queryModel.sortOrder": "desc", # 时间倒序, asc正序
+ "time": "0",
+ }
+ try:
+ req_notification = self.sess.post(
+ url,
+ headers=self.headers,
+ data=data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_notification.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_notification.text)
+ if doc("h5").text() == "用户登录" or "错误" in doc("title").text():
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ notifications = req_notification.json()
+ result = [
+ {**self.split_notifications(i), "create_time": i.get("cjsj")}
+ for i in notifications.get("items")
+ ]
+ return {"code": 1000, "msg": "获取消息成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取消息超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": "获取消息时未记录的错误:" + str(e)}
+
+ def get_selected_courses(self, year: int, term: int):
+ """获取已选课程信息"""
+ try:
+ url = urljoin(
+ self.base_url,
+ "xsxk/zzxkyzb_cxZzxkYzbChoosedDisplay.html?gnmkdm=N253512",
+ )
+ temp_term = term
+ term = term**2 * 3
+ data = {"xkxnm": str(year), "xkxqm": str(term)}
+ req_selected = self.sess.post(
+ url,
+ data=data,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_selected.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_selected.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ selected = req_selected.json()
+ result = {
+ "year": year,
+ "term": temp_term,
+ "count": len(selected),
+ "courses": [
+ {
+ "course_id": i.get("kch"),
+ "class_id": i.get("jxb_id"),
+ "do_id": i.get("do_jxb_id"),
+ "title": i.get("kcmc"),
+ "teacher_id": (re.findall(r"(.*?\d+)/", i.get("jsxx")))[0],
+ "teacher": (re.findall(r"/(.*?)/", i.get("jsxx")))[0],
+ "credit": float(i.get("xf", 0)),
+ "category": i.get("kklxmc"),
+ "capacity": int(i.get("jxbrs", 0)),
+ "selected_number": int(i.get("yxzrs", 0)),
+ "place": self.get_place(i.get("jxdd")),
+ "time": self.get_course_time(i.get("sksj")),
+ "optional": int(i.get("zixf", 0)),
+ "waiting": i.get("sxbj"),
+ }
+ for i in selected
+ ],
+ }
+ return {"code": 1000, "msg": "获取已选课程成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取已选课程超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": f"获取已选课程时未记录的错误:{str(e)}"}
+
+ def get_block_courses(self, year: int, term: int, block: int):
+ """获取板块课选课列表"""
+ # TODO: 优化代码
+ try:
+ # 获取head_data
+ url_head = urljoin(
+ self.base_url,
+ "xsxk/zzxkyzb_cxZzxkYzbIndex.html?gnmkdm=N253512&layout=default",
+ )
+ req_head_data = self.sess.get(
+ url_head,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_head_data.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_head_data.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ if str(doc("div.nodata")) != "":
+ return {"code": 998, "msg": doc("div.nodata").text()}
+ got_credit_list = [i for i in doc("font[color='red']").items()]
+ if len(got_credit_list) == 0:
+ return {"code": 1005, "msg": "板块课内容为空"}
+ head_data = {"got_credit": got_credit_list[2].string}
+
+ kklxdm_list = []
+ xkkz_id_list = []
+ for tab_content in doc("a[role='tab']").items():
+ onclick_content = tab_content.attr("onclick")
+ r = re.findall(r"'(.*?)'", str(onclick_content))
+ kklxdm_list.append(r[0].strip())
+ xkkz_id_list.append(r[1].strip())
+ head_data["bkk1_kklxdm"] = kklxdm_list[0]
+ head_data["bkk2_kklxdm"] = kklxdm_list[1]
+ head_data["bkk3_kklxdm"] = kklxdm_list[2]
+ head_data["bkk1_xkkz_id"] = xkkz_id_list[0]
+ head_data["bkk2_xkkz_id"] = xkkz_id_list[1]
+ head_data["bkk3_xkkz_id"] = xkkz_id_list[2]
+
+ for head_data_content in doc("input[type='hidden']"):
+ name = head_data_content.attr("name")
+ value = head_data_content.attr("value")
+ head_data[str(name)] = str(value)
+
+ url_display = urljoin(
+ self.base_url, "xsxk/zzxkyzb_cxZzxkYzbDisplay.html?gnmkdm=N253512"
+ )
+ display_req_data = {
+ "xkkz_id": head_data[f"bkk{block}_xkkz_id"],
+ "xszxzt": "1",
+ "kspage": "0",
+ }
+ req_display_data = self.sess.post(
+ url_display,
+ headers=self.headers,
+ data=display_req_data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ doc_display = pq(req_display_data.text)
+ display_data = {}
+ for display_data_content in doc_display("input[type='hidden']").items():
+ name = display_data_content.get("name")
+ value = display_data_content.get("value")
+ display_data[str(name)] = str(value)
+ head_data.update(display_data)
+
+ # 获取课程列表
+ url_kch = urljoin(
+ self.base_url, "xsxk/zzxkyzb_cxZzxkYzbPartDisplay.html?gnmkdm=N253512"
+ )
+ url_bkk = urljoin(
+ self.base_url, "xsxk/zzxkyzb_cxJxbWithKchZzxkYzb.html?gnmkdm=N253512"
+ )
+ term = term**2 * 3
+ kch_data = {
+ "bklx_id": head_data["bklx_id"],
+ "xqh_id": head_data["xqh_id"],
+ "zyfx_id": head_data["zyfx_id"],
+ "njdm_id": head_data["njdm_id"],
+ "bh_id": head_data["bh_id"],
+ "xbm": head_data["xbm"],
+ "xslbdm": head_data["xslbdm"],
+ "ccdm": head_data["ccdm"],
+ "xsbj": head_data["xsbj"],
+ "xkxnm": str(year),
+ "xkxqm": str(term),
+ "kklxdm": head_data[f"bkk{block}_kklxdm"],
+ "kkbk": head_data["kkbk"],
+ "rwlx": head_data["rwlx"],
+ "kspage": "1",
+ "jspage": "10",
+ }
+ kch_res = self.sess.post(
+ url_kch,
+ headers=self.headers,
+ data=kch_data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ jkch_res = kch_res.json()
+ bkk_data = {
+ "bklx_id": head_data["bklx_id"],
+ "xkxnm": str(year),
+ "xkxqm": str(term),
+ "xkkz_id": head_data[f"bkk{block}_xkkz_id"],
+ "xqh_id": head_data["xqh_id"],
+ "zyfx_id": head_data["zyfx_id"],
+ "njdm_id": head_data["njdm_id"],
+ "bh_id": head_data["bh_id"],
+ "xbm": head_data["xbm"],
+ "xslbdm": head_data["xslbdm"],
+ "ccdm": head_data["ccdm"],
+ "xsbj": head_data["xsbj"],
+ "kklxdm": head_data[f"bkk{block}_kklxdm"],
+ "kch_id": jkch_res["tmpList"][0]["kch_id"],
+ "kkbk": head_data["kkbk"],
+ "rwlx": head_data["rwlx"],
+ "zyh_id": head_data["zyh_id"],
+ }
+ bkk_res = self.sess.post(
+ url_bkk,
+ headers=self.headers,
+ data=bkk_data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ jbkk_res = bkk_res.json()
+ if block != 3 and (len(jkch_res["tmpList"]) != len(jbkk_res)):
+ return {"code": 999, "msg": "板块课编号及长度错误"}
+ temp_list = jkch_res["tmpList"]
+ block_list = jbkk_res
+ for i in range(len(temp_list)):
+ temp_list[i].update(block_list[i])
+
+ result = {
+ "count": len(temp_list),
+ "courses": [
+ {
+ "course_id": j["kch_id"],
+ "class_id": j.get("jxb_id"),
+ "do_id": j.get("do_jxb_id"),
+ "title": j.get("kcmc"),
+ "teacher_id": (re.findall(r"(.*?\d+)/", j.get("jsxx")))[0],
+ "teacher": (re.findall(r"/(.*?)/", j.get("jsxx")))[0],
+ "credit": float(j.get("xf"), 0),
+ "kklxdm": head_data[f"bkk{block}_kklxdm"],
+ "capacity": int(i.get("jxbrl", 0)),
+ "selected_number": int(i.get("yxzrs", 0)),
+ "place": self.get_place(i.get("jxdd")),
+ "time": self.get_course_time(i.get("sksj")),
+ }
+ for j in temp_list
+ ],
+ }
+ return {"code": 1000, "msg": "获取板块课信息成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "获取板块课信息超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": f"获取板块课信息时未记录的错误:{str(e)}"}
+
+ def select_course(
+ self,
+ sid: str,
+ course_id: str,
+ do_id: str,
+ kklxdm: str,
+ year: int,
+ term: int,
+ ):
+ """选课"""
+ try:
+ url_select = urljoin(
+ self.base_url, "xsxk/zzxkyzb_xkBcZyZzxkYzb.html?gnmkdm=N253512"
+ )
+ term = term**2 * 3
+ select_data = {
+ "jxb_ids": do_id,
+ "kch_id": course_id,
+ # 'rwlx': '3',
+ # 'rlkz': '0',
+ # 'rlzlkz': '1',
+ # 'sxbj': '1',
+ # 'xxkbj': '0',
+ # 'cxbj': '0',
+ "qz": "0",
+ # 'xkkz_id': '9B247F4EFD6291B9E055000000000001',
+ "xkxnm": str(year),
+ "xkxqm": str(term),
+ "njdm_id": str(sid[0:2]),
+ "zyh_id": str(sid[2:6]),
+ "kklxdm": str(kklxdm),
+ # 'xklc': '1',
+ }
+ req_select = self.sess.post(
+ url_select,
+ headers=self.headers,
+ data=select_data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_select.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_select.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ result = req_select.json()
+ return {"code": 1000, "msg": "选课成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "选课超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": f"选课时未记录的错误:{str(e)}"}
+
+ def cancel_course(self, do_id: str, course_id: str, year: int, term: int):
+ """取消选课"""
+ try:
+ url_cancel = urljoin(
+ self.base_url, "xsxk/zzxkyzb_tuikBcZzxkYzb.html?gnmkdm=N253512"
+ )
+ term = term**2 * 3
+ cancel_data = {
+ "jxb_ids": do_id,
+ "kch_id": course_id,
+ "xkxnm": str(year),
+ "xkxqm": str(term),
+ }
+ req_cancel = self.sess.post(
+ url_cancel,
+ headers=self.headers,
+ data=cancel_data,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ if req_cancel.status_code != 200:
+ return {"code": 2333, "msg": "教务系统挂了"}
+ doc = pq(req_cancel.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ result = {"status": re.findall(r"(\d+)", req_cancel.text)[0]}
+ return {"code": 1000, "msg": "退课成功", "data": result}
+ except exceptions.Timeout:
+ return {"code": 1003, "msg": "选课超时"}
+ except (
+ exceptions.RequestException,
+ json.decoder.JSONDecodeError,
+ AttributeError,
+ ):
+ traceback.print_exc()
+ return {"code": 2333, "msg": "请重试,若多次失败可能是系统错误维护或需更新接口"}
+ except Exception as e:
+ traceback.print_exc()
+ return {"code": 999, "msg": f"选课时未记录的错误:{str(e)}"}
+
+ # ============= utils =================
+
+ def get_gpa(self):
+ """获取GPA"""
+ url = urljoin(
+ self.base_url,
+ "xsxy/xsxyqk_cxXsxyqkIndex.html?gnmkdm=N105515&layout=default",
+ )
+ req_gpa = self.sess.get(
+ url,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ doc = pq(req_gpa.text)
+ if doc("h5").text() == "用户登录":
+ return {"code": 1006, "msg": "未登录或已过期,请重新登录"}
+ allc_str = [allc.text() for allc in doc("font[size='2px']").items()]
+ try:
+ gpa = float(allc_str[2])
+ return gpa
+ except Exception:
+ return "init"
+
+ def get_course_category(self, type, item):
+ """根据课程号获取类别"""
+ if type not in self.detail_category_type:
+ return item.get("KCLBMC")
+ if not item.get("KCH"):
+ return None
+ url = urljoin(self.base_url, f"jxjhgl/common_cxKcJbxx.html?id={item['KCH']}")
+ req_category = self.sess.get(
+ url,
+ headers=self.headers,
+ cookies=self.cookies,
+ timeout=self.timeout,
+ )
+ doc = pq(req_category.text)
+ ths = doc("th")
+ try:
+ data_list = [(th.text).strip() for th in ths]
+ return data_list[6]
+ except:
+ return None
+
+ @classmethod
+ def encrypt_password(cls, pwd, n, e):
+ """对密码base64编码"""
+ message = str(pwd).encode()
+ rsa_n = binascii.b2a_hex(binascii.a2b_base64(n))
+ rsa_e = binascii.b2a_hex(binascii.a2b_base64(e))
+ key = rsa.PublicKey(int(rsa_n, 16), int(rsa_e, 16))
+ encropy_pwd = rsa.encrypt(message, key)
+ result = binascii.b2a_base64(encropy_pwd)
+ return result
+
+ @classmethod
+ def parse_int(cls, digits):
+ if not digits:
+ return None
+ if not digits.isdigit():
+ return digits
+ return int(digits)
+
+ @classmethod
+ def align_floats(cls, floats):
+ if not floats:
+ return None
+ if floats == "无":
+ return "0.0"
+ return format(float(floats), ".1f")
+
+ @classmethod
+ def display_course_time(cls, sessions):
+ if not sessions:
+ return None
+ args = re.findall(r"(\d+)", sessions)
+ start_time = cls.raspisanie[int(args[0]) + 1][0]
+ end_time = cls.raspisanie[int(args[0]) + 1][1]
+ return f"{start_time}~{end_time}"
+
+ @classmethod
+ def list_sessions(cls, sessions):
+ if not sessions:
+ return None
+ args = re.findall(r"(\d+)", sessions)
+ return [n for n in range(int(args[0]), int(args[1]) + 1)]
+
+ @classmethod
+ def list_weeks(cls, weeks):
+ """返回课程所含周列表"""
+ if not weeks:
+ return None
+ args = re.findall(r"[^,]+", weeks)
+ week_list = []
+ for item in args:
+ if "-" in item:
+ weeks_pair = re.findall(r"(\d+)", item)
+ if len(weeks_pair) != 2:
+ continue
+ if "单" in item:
+ for i in range(int(weeks_pair[0]), int(weeks_pair[1]) + 1):
+ if i % 2 == 1:
+ week_list.append(i)
+ elif "双" in item:
+ for i in range(int(weeks_pair[0]), int(weeks_pair[1]) + 1):
+ if i % 2 == 0:
+ week_list.append(i)
+ else:
+ for i in range(int(weeks_pair[0]), int(weeks_pair[1]) + 1):
+ week_list.append(i)
+ else:
+ week_num = re.findall(r"(\d+)", item)
+ if len(week_num) == 1:
+ week_list.append(int(week_num[0]))
+ return week_list
+
+ @classmethod
+ def get_academia_statistics(cls, display_statistics):
+ display_statistics = "".join(display_statistics.split())
+ gpa_list = re.findall(r"([0-9]{1,}[.][0-9]*)", display_statistics)
+ if len(gpa_list) == 0 or not cls.is_number(gpa_list[0]):
+ gpa = None
+ else:
+ gpa = float(gpa_list[0])
+ plan_list = re.findall(
+ r"计划总课程(\d+)门通过(\d+)门?.*未通过(\d+)门?.*未修(\d+)?.*在读(\d+)门?.*计划外?.*通过(\d+)门?.*未通过(\d+)门",
+ display_statistics,
+ )
+ if len(plan_list) == 0 or len(plan_list[0]) < 7:
+ return {"gpa": gpa}
+ plan_list = plan_list[0]
+ return {
+ "gpa": gpa, # 平均学分绩点GPA
+ "planed_courses": {
+ "total": int(plan_list[0]), # 计划内总课程数
+ "passed": int(plan_list[1]), # 计划内已过课程数
+ "failed": int(plan_list[2]), # 计划内未过课程数
+ "missed": int(plan_list[3]), # 计划内未修课程数
+ "in": int(plan_list[4]), # 计划内在读课程数
+ },
+ "unplaned_courses": {
+ "passed": int(plan_list[5]), # 计划外已过课程数
+ "failed": int(plan_list[6]), # 计划外未过课程数
+ },
+ }
+
+ @classmethod
+ def get_academia_type_statistics(cls, content: str):
+ finder = re.findall(
+ r"\"(.*) .*要求学分.*:([0-9]{1,}[.][0-9]*|0| ).*获得学分.*:([0-9]{1,}[.][0-9]*|0| ).*未获得学分.*:([0-9]{1,}[.][0-9]*|0| )[\s\S]*?",
+ content,
+ )
+ finder_list = list({}.fromkeys(finder).keys())
+ academia_list = [
+ list(i)
+ for i in finder_list
+ if i[0] != "" # 类型名称不为空
+ and len(i[0]) <= 20 # 避免正则到首部过长类型名称
+ and "span" not in i[-1] # 避免正则到尾部过长类型名称
+ and i[0] not in cls.ignore_type # 忽略的类型名称
+ ]
+ result = {
+ i[0]: {
+ "id": i[-1],
+ "credits": {
+ "required": i[1] if cls.is_number(i[1]) and i[1] != "0" else None,
+ "earned": i[2] if cls.is_number(i[2]) and i[2] != "0" else None,
+ "missed": i[3] if cls.is_number(i[3]) and i[3] != "0" else None,
+ },
+ }
+ for i in academia_list
+ }
+ return result
+
+ @classmethod
+ def get_display_term(cls, sid, year, term):
+ """
+ 计算培养方案具体学期转化成中文
+ note: 留级和当兵等情况会不准确
+ """
+ if (sid and year and term) is None:
+ return None
+ grade = int(sid[0:2])
+ year = int(year[2:4])
+ term = int(term)
+ dict = {
+ grade: "大一上" if term == 1 else "大一下",
+ grade + 1: "大二上" if term == 1 else "大二下",
+ grade + 2: "大三上" if term == 1 else "大三下",
+ grade + 3: "大四上" if term == 1 else "大四下",
+ }
+ return dict.get(year)
+
+ @classmethod
+ def split_merge_display(cls, schedule):
+ """
+ 拆分同周同天同课程不同时段数据合并的问题
+ """
+ repetIndex = []
+ count = 0
+ for items in schedule["courses"]:
+ for index in range(len(schedule["courses"])):
+ if (schedule["courses"]).index(items) == count: # 如果对比到自己就忽略
+ continue
+ elif (
+ items["course_id"]
+ == schedule["courses"][index]["course_id"] # 同周同天同课程
+ and items["weekday"] == schedule["courses"][index]["weekday"]
+ and items["weeks"] == schedule["courses"][index]["weeks"]
+ ):
+ repetIndex.append(index) # 满足条件记录索引
+ count += 1 # 记录当前对比课程的索引
+ if len(repetIndex) % 2 != 0: # 暂时考虑一天两个时段上同一门课,不满足条件不进行修改
+ return schedule
+ for r in range(0, len(repetIndex), 2): # 索引数组两两成对,故步进2循环
+ fir = repetIndex[r]
+ sec = repetIndex[r + 1]
+ if len(re.findall(r"(\d+)", schedule["courses"][fir]["sessions"])) == 4:
+ schedule["courses"][fir]["sessions"] = (
+ re.findall(r"(\d+)", schedule["courses"][fir]["sessions"])[0]
+ + "-"
+ + re.findall(r"(\d+)", schedule["courses"][fir]["sessions"])[1]
+ + "节"
+ )
+ schedule["courses"][fir]["list_sessions"] = cls.list_sessions(
+ schedule["courses"][fir]["sessions"]
+ )
+ schedule["courses"][fir]["time"] = cls.display_course_time(
+ schedule["courses"][fir]["sessions"]
+ )
+
+ schedule["courses"][sec]["sessions"] = (
+ re.findall(r"(\d+)", schedule["courses"][sec]["sessions"])[2]
+ + "-"
+ + re.findall(r"(\d+)", schedule["courses"][sec]["sessions"])[3]
+ + "节"
+ )
+ schedule["courses"][sec]["list_sessions"] = cls.list_sessions(
+ schedule["courses"][sec]["sessions"]
+ )
+ schedule["courses"][sec]["time"] = cls.display_course_time(
+ schedule["courses"][sec]["sessions"]
+ )
+ return schedule
+
+ @classmethod
+ def split_notifications(cls, item):
+ if not item.get("xxnr"):
+ return {"type": None, "content": None}
+ content_list = re.findall(r"(.*):(.*)", item["xxnr"])
+ if len(content_list) == 0:
+ return {"type": None, "content": item["xxnr"]}
+ return {"type": content_list[0][0], "content": content_list[0][1]}
+
+ @classmethod
+ def get_place(cls, place):
+ return place.split("
")[0] if "
" in place else place
+
+ @classmethod
+ def get_course_time(cls, time):
+ return "、".join(time.split("
")) if "
" in time else time
+
+ @classmethod
+ def is_number(cls, s):
+ if s == "":
+ return False
+ try:
+ float(s)
+ return True
+ except ValueError:
+ pass
+ try:
+ for i in s:
+ unicodedata.numeric(i)
+ return True
+ except (TypeError, ValueError):
+ pass
+ return False
+
+
+if __name__ == "__main__":
+ from pprint import pprint
+ import json
+ import base64
+ import sys
+ import os
+
+ base_url = "https://xxxx.xxx.edu.cn" # 教务系统URL
+ sid = "123456" # 学号
+ password = "abc654321" # 密码
+ lgn_cookies = (
+ {
+ # "insert_cookie": "",
+ # "route": "",
+ "JSESSIONID": ""
+ }
+ if False
+ else None
+ ) # cookies登录,调整成True使用cookies登录,反之使用密码登录
+ test_year = 2022 # 查询学年
+ test_term = 2 # 查询学期(1-上|2-下)
+
+ # 初始化
+ lgn = Client(lgn_cookies if lgn_cookies is not None else {}, base_url=base_url)
+ # 判断是否需要使用cookies登录
+ if lgn_cookies is None:
+ # 登录
+ pre_login = lgn.login(sid, password)
+ # 判断登录结果
+ if pre_login["code"] == 1001:
+ # 需要验证码
+ pre_dict = pre_login["data"]
+ with open(os.path.abspath("temp.json"), mode="w", encoding="utf-8") as f:
+ f.write(json.dumps(pre_dict))
+ with open(os.path.abspath("kaptcha.png"), "wb") as pic:
+ pic.write(base64.b64decode(pre_dict["kaptcha_pic"]))
+ kaptcha = input("输入验证码:")
+ result = lgn.login_with_kaptcha(
+ pre_dict["sid"],
+ pre_dict["csrf_token"],
+ pre_dict["cookies"],
+ pre_dict["password"],
+ pre_dict["modulus"],
+ pre_dict["exponent"],
+ kaptcha,
+ )
+ if result["code"] != 1000:
+ pprint(result)
+ sys.exit()
+ lgn_cookies = lgn.cookies
+ elif pre_login["code"] == 1000:
+ # 不需要验证码,直接登录
+ lgn_cookies = lgn.cookies
+ else:
+ # 出错
+ pprint(pre_login)
+ sys.exit()
+
+ # 下面是各个函数调用,想调用哪个,取消注释即可
+ """ 获取个人信息 """
+ result = lgn.get_info()
+
+ """ 获取成绩单PDF """
+ # result = lgn.get_academia_pdf()
+ # if result["code"] == 1000:
+ # with open(os.path.abspath("grade.pdf"), "wb") as pdf:
+ # pdf.write(result["data"])
+ # result = "已保存到本地"
+
+ """ 获取学业情况 """
+ # result = lgn.get_academia()
+
+ """ 获取GPA """
+ # result = lgn.get_gpa()
+
+ """ 获取课程表 """
+ # result = lgn.get_schedule(test_year, test_term)
+
+ """ 获取成绩 """
+ # result = lgn.get_grade(test_year, test_term)
+
+ # 输出结果
+ pprint(result)
diff --git a/src/timemanagerapp/ios/.gitignore b/src/timemanagerapp/ios/.gitignore
new file mode 100644
index 0000000..7a7f987
--- /dev/null
+++ b/src/timemanagerapp/ios/.gitignore
@@ -0,0 +1,34 @@
+**/dgph
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/ephemeral/
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3
diff --git a/src/timemanagerapp/ios/Flutter/AppFrameworkInfo.plist b/src/timemanagerapp/ios/Flutter/AppFrameworkInfo.plist
new file mode 100644
index 0000000..9625e10
--- /dev/null
+++ b/src/timemanagerapp/ios/Flutter/AppFrameworkInfo.plist
@@ -0,0 +1,26 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ App
+ CFBundleIdentifier
+ io.flutter.flutter.app
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ App
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ MinimumOSVersion
+ 11.0
+
+
diff --git a/src/timemanagerapp/ios/Flutter/Debug.xcconfig b/src/timemanagerapp/ios/Flutter/Debug.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/src/timemanagerapp/ios/Flutter/Debug.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/src/timemanagerapp/ios/Flutter/Release.xcconfig b/src/timemanagerapp/ios/Flutter/Release.xcconfig
new file mode 100644
index 0000000..592ceee
--- /dev/null
+++ b/src/timemanagerapp/ios/Flutter/Release.xcconfig
@@ -0,0 +1 @@
+#include "Generated.xcconfig"
diff --git a/src/timemanagerapp/ios/Runner.xcodeproj/project.pbxproj b/src/timemanagerapp/ios/Runner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..f1609ce
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcodeproj/project.pbxproj
@@ -0,0 +1,614 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 97C146ED1CF9000F007C117D;
+ remoteInfo = Runner;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
+ 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
+ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 97C146EB1CF9000F007C117D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 9740EEB11CF90186004384FC /* Flutter */ = {
+ isa = PBXGroup;
+ children = (
+ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
+ 9740EEB21CF90195004384FC /* Debug.xcconfig */,
+ 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
+ 9740EEB31CF90195004384FC /* Generated.xcconfig */,
+ );
+ name = Flutter;
+ sourceTree = "";
+ };
+ 331C8082294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ 331C807B294A618700263BE5 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ sourceTree = "";
+ };
+ 97C146E51CF9000F007C117D = {
+ isa = PBXGroup;
+ children = (
+ 9740EEB11CF90186004384FC /* Flutter */,
+ 97C146F01CF9000F007C117D /* Runner */,
+ 97C146EF1CF9000F007C117D /* Products */,
+ 331C8082294A63A400263BE5 /* RunnerTests */,
+ );
+ sourceTree = "";
+ };
+ 97C146EF1CF9000F007C117D /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146EE1CF9000F007C117D /* Runner.app */,
+ 331C8081294A63A400263BE5 /* RunnerTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 97C146F01CF9000F007C117D /* Runner */ = {
+ isa = PBXGroup;
+ children = (
+ 97C146FA1CF9000F007C117D /* Main.storyboard */,
+ 97C146FD1CF9000F007C117D /* Assets.xcassets */,
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
+ 97C147021CF9000F007C117D /* Info.plist */,
+ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
+ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
+ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
+ 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+ );
+ path = Runner;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 331C8080294A63A400263BE5 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ 331C807D294A63A400263BE5 /* Sources */,
+ 331C807E294A63A400263BE5 /* Frameworks */,
+ 331C807F294A63A400263BE5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ 97C146ED1CF9000F007C117D /* Runner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
+ buildPhases = (
+ 9740EEB61CF901F6004384FC /* Run Script */,
+ 97C146EA1CF9000F007C117D /* Sources */,
+ 97C146EB1CF9000F007C117D /* Frameworks */,
+ 97C146EC1CF9000F007C117D /* Resources */,
+ 9705A1C41CF9048500538489 /* Embed Frameworks */,
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Runner;
+ productName = Runner;
+ productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 97C146E61CF9000F007C117D /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 1430;
+ ORGANIZATIONNAME = "";
+ TargetAttributes = {
+ 331C8080294A63A400263BE5 = {
+ CreatedOnToolsVersion = 14.0;
+ TestTargetID = 97C146ED1CF9000F007C117D;
+ };
+ 97C146ED1CF9000F007C117D = {
+ CreatedOnToolsVersion = 7.3.1;
+ LastSwiftMigration = 1100;
+ };
+ };
+ };
+ buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
+ compatibilityVersion = "Xcode 9.3";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 97C146E51CF9000F007C117D;
+ productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 97C146ED1CF9000F007C117D /* Runner */,
+ 331C8080294A63A400263BE5 /* RunnerTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 331C807F294A63A400263BE5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EC1CF9000F007C117D /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
+ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
+ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
+ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
+ );
+ name = "Thin Binary";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
+ };
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 331C807D294A63A400263BE5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 97C146EA1CF9000F007C117D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
+ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 97C146ED1CF9000F007C117D /* Runner */;
+ targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C146FB1CF9000F007C117D /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 97C147001CF9000F007C117D /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 249021D3217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Profile;
+ };
+ 249021D4217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.timemanagerapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
+ 331C8088294A63A400263BE5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.timemanagerapp.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Debug;
+ };
+ 331C8089294A63A400263BE5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.timemanagerapp.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Release;
+ };
+ 331C808A294A63A400263BE5 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ GENERATE_INFOPLIST_FILE = YES;
+ MARKETING_VERSION = 1.0;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.timemanagerapp.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Profile;
+ };
+ 97C147031CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 97C147041CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 97C147061CF9000F007C117D /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.timemanagerapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Debug;
+ };
+ 97C147071CF9000F007C117D /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.timemanagerapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 331C8088294A63A400263BE5 /* Debug */,
+ 331C8089294A63A400263BE5 /* Release */,
+ 331C808A294A63A400263BE5 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147031CF9000F007C117D /* Debug */,
+ 97C147041CF9000F007C117D /* Release */,
+ 249021D3217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 97C147061CF9000F007C117D /* Debug */,
+ 97C147071CF9000F007C117D /* Release */,
+ 249021D4217E4FDB00AE95B9 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 97C146E61CF9000F007C117D /* Project object */;
+}
diff --git a/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/src/timemanagerapp/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/src/timemanagerapp/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
new file mode 100644
index 0000000..87131a0
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/ios/Runner.xcworkspace/contents.xcworkspacedata b/src/timemanagerapp/ios/Runner.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..1d526a1
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/src/timemanagerapp/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/src/timemanagerapp/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/src/timemanagerapp/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/src/timemanagerapp/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/src/timemanagerapp/ios/Runner/AppDelegate.swift b/src/timemanagerapp/ios/Runner/AppDelegate.swift
new file mode 100644
index 0000000..70693e4
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/AppDelegate.swift
@@ -0,0 +1,13 @@
+import UIKit
+import Flutter
+
+@UIApplicationMain
+@objc class AppDelegate: FlutterAppDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ GeneratedPluginRegistrant.register(with: self)
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+}
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..d36b1fa
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,122 @@
+{
+ "images" : [
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-20x20@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-29x29@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-40x40@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "Icon-App-60x60@3x.png",
+ "scale" : "3x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-20x20@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-29x29@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-40x40@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-76x76@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Icon-App-83.5x83.5@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "1024x1024",
+ "idiom" : "ios-marketing",
+ "filename" : "Icon-App-1024x1024@1x.png",
+ "scale" : "1x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
new file mode 100644
index 0000000..dc9ada4
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
new file mode 100644
index 0000000..7353c41
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
new file mode 100644
index 0000000..797d452
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
new file mode 100644
index 0000000..6ed2d93
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
new file mode 100644
index 0000000..4cd7b00
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
new file mode 100644
index 0000000..fe73094
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
new file mode 100644
index 0000000..321773c
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
new file mode 100644
index 0000000..797d452
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
new file mode 100644
index 0000000..502f463
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
new file mode 100644
index 0000000..0ec3034
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
new file mode 100644
index 0000000..0ec3034
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
new file mode 100644
index 0000000..e9f5fea
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
new file mode 100644
index 0000000..84ac32a
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
new file mode 100644
index 0000000..8953cba
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
new file mode 100644
index 0000000..0467bf1
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
new file mode 100644
index 0000000..0bedcf2
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@2x.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "filename" : "LaunchImage@3x.png",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
new file mode 100644
index 0000000..9da19ea
Binary files /dev/null and b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ
diff --git a/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
new file mode 100644
index 0000000..89c2725
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
@@ -0,0 +1,5 @@
+# Launch Screen Assets
+
+You can customize the launch screen with your own desired assets by replacing the image files in this directory.
+
+You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/src/timemanagerapp/ios/Runner/Base.lproj/LaunchScreen.storyboard b/src/timemanagerapp/ios/Runner/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..f2e259c
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/ios/Runner/Base.lproj/Main.storyboard b/src/timemanagerapp/ios/Runner/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..f3c2851
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Base.lproj/Main.storyboard
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/timemanagerapp/ios/Runner/Info.plist b/src/timemanagerapp/ios/Runner/Info.plist
new file mode 100644
index 0000000..fab11c2
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Info.plist
@@ -0,0 +1,49 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleDisplayName
+ Timemanagerapp
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ timemanagerapp
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ $(FLUTTER_BUILD_NAME)
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
+ LSRequiresIPhoneOS
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ CADisableMinimumFrameDurationOnPhone
+
+ UIApplicationSupportsIndirectInputEvents
+
+
+
diff --git a/src/timemanagerapp/ios/Runner/Runner-Bridging-Header.h b/src/timemanagerapp/ios/Runner/Runner-Bridging-Header.h
new file mode 100644
index 0000000..308a2a5
--- /dev/null
+++ b/src/timemanagerapp/ios/Runner/Runner-Bridging-Header.h
@@ -0,0 +1 @@
+#import "GeneratedPluginRegistrant.h"
diff --git a/src/timemanagerapp/ios/RunnerTests/RunnerTests.swift b/src/timemanagerapp/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 0000000..86a7c3b
--- /dev/null
+++ b/src/timemanagerapp/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Flutter
+import UIKit
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
diff --git a/src/timemanagerapp/lib/controller/CourseController.dart b/src/timemanagerapp/lib/controller/CourseController.dart
new file mode 100644
index 0000000..01c5677
--- /dev/null
+++ b/src/timemanagerapp/lib/controller/CourseController.dart
@@ -0,0 +1,126 @@
+import 'package:timemanagerapp/controller/NetWorkController.dart';
+import 'package:timemanagerapp/database/dao/CourseDao.dart';
+import 'package:timemanagerapp/entity/Course.dart';
+import 'package:timemanagerapp/entity/CourseForm.dart';
+import 'package:timemanagerapp/setting/Setting.dart';
+import 'package:timemanagerapp/util/GetCourseByLogin.dart';
+
+import '../util/dataUtil.dart';
+
+class CourseController {
+ static CourseController getInstance() {
+ return new CourseController();
+ }
+
+ GetCourseByLogin getCourseByLogin = GetCourseByLogin();
+ IdGenerator idGenerator = IdGenerator();
+ List courseList = []; //实时维护的courseList缓存
+ NetWorkController netWorkController = NetWorkController();
+
+ DateTime termstartdate = Setting.startdate; //Setting.getStartDate();
+
+ // 课表的时间范围
+ final List> raspiyane = [
+ ["8:00", "8:45"], //1
+ ["8:50", "9:35"], //2
+ ["10:05", "10:50"], //3
+ ["10:55", "11:40"], //4
+
+ ["13:30", "14:15"], //5
+ ["14:20", "15:05"], //6
+ ["15:35", "16:20"], //7
+ ["16:25", "17:10"], //8
+
+ ["18:30", "19:15"],
+ ["19:20", "20:05"],
+ ["20:10", "20:55"],
+ ["21:10", "21:50"],
+ ["22:05", "22:35"],
+ ];
+
+ Future addCourseForm(CourseForm courseForm) async {
+ List courseListToInsert = [];
+ for (int week = courseForm.getStartWeek(); week <= courseForm.getEndWeek(); week++) {
+ for(int day in courseForm.selectedDays){
+ // 计算具体的日期和时间
+ final startDate = termstartdate.add(Duration(
+ days: (7 * (week - 1) + day! - 1),
+ hours: int.parse(raspiyane[courseForm.getStartTime() - 1][0].split(':')[0]),
+ minutes: int.parse(raspiyane[courseForm.getStartTime() - 1][0].split(':')[1]),
+ ));
+
+ final endDate = termstartdate.add(Duration(
+ days: (7 * (week - 1) + day! - 1),
+ hours: int.parse(raspiyane[courseForm.getEndTime() - 1][1].split(':')[0]),
+ minutes: int.parse(raspiyane[courseForm.getEndTime() - 1][1].split(':')[1]),
+ ));
+ int courseId = await idGenerator.generateId();
+ Course course = Course(
+ name: courseForm.getCourse(),
+ userId: Setting.user!.getId!,
+ courseId: courseId,
+ teacher: courseForm.getTeacher(),
+ location: courseForm.getLocation(),
+ start: startDate,
+ end: endDate,
+ credit: courseForm.getCredit(),
+ remark: courseForm.getNote()
+ );
+ courseListToInsert.add(course);
+ }
+ }
+ await insertCourseList(courseListToInsert);
+ }
+
+ Future> getCourses() async {
+ List