{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "cc3ee99d", "metadata": {}, "outputs": [], "source": [ "from requests import * " ] }, { "cell_type": "code", "execution_count": 42, "id": "5af4df03", "metadata": {}, "outputs": [], "source": [ "for i in [\"233157541\",\"233157542\",\"233157544\",\"233157545\",\"233157546\"]:\n", " get(f\"http://139.159.182.121:8092/card/getTime?controllerSN={i}\")" ] }, { "cell_type": "code", "execution_count": 13, "id": "8d2a2506", "metadata": {}, "outputs": [], "source": [ "data={\"name\":\"测试\",\"endDate\":1759161600000,\"content\":None,\"userType\":1,\"dateState\":\"0\",\"userIds\":[130,163,195,196,198,197,161,446,226,507,535,162,106,176,206,105,116,204,222,510,508,509,523,200,135,513,208,164,210,512,207,527,447,521,212,118,450,139,437,177,179,514,515,107,102,219,530,108,187,147,126,189,110,458,462,457,528,143,124,217,448,525,526,550,517,113,534,541,320,150,456,540,524,522,529,186,105,140,151,689,166,151,521,520,805,130],\"status\":0,\"type\":6,\"userName\":\"钟伟\",\"userId\":473,\"teamId\":19}" ] }, { "cell_type": "code", "execution_count": 10, "id": "e69ccb4b", "metadata": {}, "outputs": [], "source": [ "with open(\"demo1.docx\",\"rb\") as f:\n", " file = f.read()" ] }, { "cell_type": "code", "execution_count": null, "id": "1c7bc78e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'{\"success\":false,\"msg\":\"文件太大\",\"code\":10004,\"data\":null}'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" }, { "ename": "", "evalue": "", "output_type": "error", "traceback": [ "\u001b[1;31m在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。\n", "\u001b[1;31m请查看单元格中的代码,以确定故障的可能原因。\n", "\u001b[1;31m单击此处了解详细信息。\n", "\u001b[1;31m有关更多详细信息,请查看 Jupyter log。" ] } ], "source": [ "post(f\"{ip}/word/process/convert\",files={\"file\":(\n", " \"demo1.docx\",\n", " file, 'application/octet-stream'\n", ")},headers=header).text" ] }, { "cell_type": "code", "execution_count": 11, "id": "eeed45e5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'{\"success\":false,\"msg\":\"Transaction was marked for rollback only; cannot commit; nested exception is org.hibernate.TransactionException: Transaction was marked for rollback only; cannot commit\",\"code\":10000,\"data\":null}'" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "post(f\"{ip}/applicatonTitle/add\",json=data,headers=header).text" ] }, { "cell_type": "code", "execution_count": null, "id": "20286e94", "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 }