From 326e6631c0407d70bd57e3ceb7c17152192a0665 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 25 May 2026 16:57:50 +0300 Subject: [PATCH] vault backup: 2026-05-25 16:57:50 --- .obsidian/workspace.json | 28 +++++++-- ...абота с API для проекта Attendance Mephi.md | 63 +++++++++++++++++++ 2 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 00 Inbox/Работа с API для проекта Attendance Mephi.md diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 73ace9c..6e22bf4 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -13,16 +13,32 @@ "state": { "type": "markdown", "state": { - "file": "90 Library/Programming/Ruby On Rails/Rails credentials edit не открывает редактор.md", + "file": "AGENTS.md", "mode": "preview", "source": false, "backlinks": false }, "icon": "lucide-file", - "title": "Rails credentials edit не открывает редактор" + "title": "AGENTS" + } + }, + { + "id": "1040e2dbdf162887", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "00 Inbox/Работа с API для проекта Attendance Mephi.md", + "mode": "preview", + "source": false, + "backlinks": false + }, + "icon": "lucide-file", + "title": "Работа с API для проекта Attendance Mephi" } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -258,11 +274,12 @@ "terminal:Open terminal": false } }, - "active": "df1bd513cd92a47d", + "active": "1040e2dbdf162887", "lastOpenFiles": [ + "AGENTS.md", + "00 Inbox/Работа с API для проекта Attendance Mephi.md", "INDEX.md", "00 Inbox/Hello.md", - "00 Inbox/Untitled.md", "00 Inbox/Подготовка Speaking.md", "99 System/Archive/Подготовка Speaking.md", "99 System/Archive/Налоги - СР2.md", @@ -295,7 +312,6 @@ "00 Inbox/UntitledUntitled.md", "90 Library/08 Study/УИР.md", "00 Inbox/ВДО no кредитам.md", - "99 System/Archive/ВДО no кредитам.md", "raw_files_3.txt", "raw_links_3.txt", "raw_links_2.txt", diff --git a/00 Inbox/Работа с API для проекта Attendance Mephi.md b/00 Inbox/Работа с API для проекта Attendance Mephi.md new file mode 100644 index 0000000..64aa95c --- /dev/null +++ b/00 Inbox/Работа с API для проекта Attendance Mephi.md @@ -0,0 +1,63 @@ +--- +status: seed +type: concept +tags: [] +created: 2025-12-17 +updated: 2026-05-25 +title: +--- +**API Импорт** + +Команда Rails: + +```sh +/home/ada/.local/bin/mise exec ruby -- bin/rails runner '...' +``` + +Семестр берётся из `Term.actual`. Для старта `2026-02-07` код семестра: `20252`. + +**Credentials** + +```yaml +api: + home_mephi: + host: + code: + token: + students_mephi: + host: + username: + password: +``` + +**Endpoints** + +```text +GET {home_mephi.host}/study_groups.json?term_code=20252&code=...&token=... +GET {home_mephi.host}/tutors.json?term_code=20252&code=...&token=... +GET {students_mephi.host}/get_list_by_group_name?group=...&term=20252 +GET {home_mephi.host}/tutors/{staff_id}/schedules.json?term_code=20252&date=YYYY-MM-DD&code=...&token=... +``` + +`students_mephi` использует Basic Auth: `username/password`. + +**Ручная загрузка** + +```sh +/home/ada/.local/bin/mise exec ruby -- bin/rails runner 'ImportGroupsService.execute' +/home/ada/.local/bin/mise exec ruby -- bin/rails runner 'ImportTutorsService.execute' +/home/ada/.local/bin/mise exec ruby -- bin/rails runner 'ImportStudentsService.execute' +/home/ada/.local/bin/mise exec ruby -- bin/rails runner 'term = Term.actual; ImportDisciplineService.execute(nil, term)' +``` + +Расписание на сегодня: + +```sh +/home/ada/.local/bin/mise exec ruby -- bin/rails runner 'term = Term.actual; ImportScheduleService.execute(Date.today, term)' +``` + +Расписание за весь семестр до сегодня: + +```sh +/home/ada/.local/bin/mise exec ruby -- bin/rails runner 'term = Term.actual; finish = [term.get_finish_date, Date.today].min; (term.start_date..finish).each { |date| ImportScheduleService.execute(date, term) unless date.wday == 0 }' +``` \ No newline at end of file