{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8600f90d",
   "metadata": {},
   "outputs": [],
   "source": [
    "from myrequest import create\n",
    "from requests import post,get"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "863abedc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "认证成功，token已设置\n"
     ]
    }
   ],
   "source": [
    "a = create(\"http://192.168.0.244:8100\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1ce7cf88",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "efcadb57",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = get(\"https://band.hxzhxy.cn/lock/ark/listPages?arkName=&teamId=19&binding=&bindStu=&accredit=&screen=0&pageSize=4000&pageNumber=0&orderDirection=asc&access_token=32100fad-6c69-4f55-8cf9-dd9e6196d3a6\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "0731474e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "student_list = data.json()\n",
    "with open(\"本部学生柜锁.json\", \"w\", encoding=\"utf-8\") as f:\n",
    "    f.write(json.dumps(student_list, ensure_ascii=False, indent=4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7ab8340e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
