From c6af7a38fad709850810d9fda26cc9042fd0d332 Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Thu, 7 Dec 2023 17:12:11 +0800 Subject: [PATCH] update --- {src/db => db}/__init__.py | 0 db/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 176 bytes db/__pycache__/base.cpython-310.pyc | Bin 0 -> 814 bytes db/__pycache__/session.cpython-310.pyc | Bin 0 -> 1337 bytes {src/db => db}/base.py | 0 {src/db => db}/models/__init__.py | 0 db/models/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 183 bytes db/models/__pycache__/base.cpython-310.pyc | Bin 0 -> 1148 bytes .../__pycache__/lot_data_model.cpython-310.pyc | Bin 0 -> 3367 bytes {src/db => db}/models/base.py | 0 .../models/lot_data_model.py | 2 +- {src/db => db}/repository/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 223 bytes .../lot_data_repository.cpython-310.pyc | Bin 0 -> 1844 bytes {src/db => db}/repository/lot_data_repository.py | 4 ++-- {src/db => db}/session.py | 2 +- src/__pycache__/api.cpython-310.pyc | Bin 0 -> 1037 bytes src/{db => }/api.py | 6 +++--- src/sensor_to_local.py | 2 +- src/sensor_to_server.py | 4 ++-- 20 files changed, 10 insertions(+), 10 deletions(-) rename {src/db => db}/__init__.py (100%) create mode 100644 db/__pycache__/__init__.cpython-310.pyc create mode 100644 db/__pycache__/base.cpython-310.pyc create mode 100644 db/__pycache__/session.cpython-310.pyc rename {src/db => db}/base.py (100%) rename {src/db => db}/models/__init__.py (100%) create mode 100644 db/models/__pycache__/__init__.cpython-310.pyc create mode 100644 db/models/__pycache__/base.cpython-310.pyc create mode 100644 db/models/__pycache__/lot_data_model.cpython-310.pyc rename {src/db => db}/models/base.py (100%) rename src/db/models/log_data_model.py => db/models/lot_data_model.py (99%) rename {src/db => db}/repository/__init__.py (100%) create mode 100644 db/repository/__pycache__/__init__.cpython-310.pyc create mode 100644 db/repository/__pycache__/lot_data_repository.cpython-310.pyc rename {src/db => db}/repository/lot_data_repository.py (92%) rename {src/db => db}/session.py (96%) create mode 100644 src/__pycache__/api.cpython-310.pyc rename src/{db => }/api.py (75%) diff --git a/src/db/__init__.py b/db/__init__.py similarity index 100% rename from src/db/__init__.py rename to db/__init__.py diff --git a/db/__pycache__/__init__.cpython-310.pyc b/db/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..371f42c75a2c2f1e269cc5bf9a5699f2b536b375 GIT binary patch literal 176 zcmd1j<>g`kg0h;>R1p0bL?8o3AjbiSi&=m~3PUi1CZpd5q!&A5D9}mzA>~nho|k*bX8QHxRcz z0YZW!Jknk{@d_Lec3Y_tBh7fmGduI`H&)$ljGWM)a~KkYe)(WiA{RV!YCb!2i8$g| zAnH#duq2dV?*}4~Aq{0jqnkJs4cVm48y|}nZSjb<0nOuY9cc5$cR~~1gyakQN@y1d zba{)nKOr7p6PiMkcX$UidoLM&H({*g# ziqgW%F+P~=SEd^#Fuhm zTslzG`46N$_kT`r0f=(O%Is`a%$SyETFs%bCR?oROjUQ`f00KkS;ekEKgsws^Zz?s ztm@XbU~XmHIJQ%Q9}AS!7UQv6vvnlf*ZK; IH;uN)KYcvjfdBvi literal 0 HcmV?d00001 diff --git a/db/__pycache__/session.cpython-310.pyc b/db/__pycache__/session.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58f58b79c3b0b60b9f0c2f746344f9d5fb8bd7d2 GIT binary patch literal 1337 zcmZWp&2Q936rVT#+>Lh=Aqb^aRiyTSC6t985kg2voT>;B3Dmu$UXPPq7_XNZueOOC zsdNKDsTw#SByLdkkn~WFMeU*ghi_GrCixRu6^Zw3FHPuJo_X)h%=`GgpPe)sb%x`Q z&3n;r24jDca&(xeT*X)4!AURylEu&lAel=Z8*QVI4Qa+!+bU#J+OgAifJKI|B4>#U zTR7|H7}~CIMQxq6YiPI7UKdmAX1iW#o@k&pC7KJ&pFYHRYzJ~{q=JF=A#a9BKaIXl zcypu=F=fg|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1$aq8%Yo(T>uvXh%uxuvCmMiEL6az~g_@9D2|u)ZpRA zbZU^I%;oz9gy2LKqShWOy_uFJiAoijNR_}d5)BfW1W52~pc0~C8X=**9W9Jnl*WV> z@wF&wahecX%-7C zEr;5GuMMKsi`tN{4WrhF+6G_Sh*}=CO}=&yYW=9)>uZ})8$hk#Yg4>`=P_i5&|PAyk;sadB?a~q7Vjs5D|PVA1SCwaCTTWgp)(cRf) z7|BmJUTZCU;=T4}`@?G@sd8dMQIvY!qw~lItv3%c3F7Na!?bDw?uF*Xc6T2r4 zG+wy1cu^T0SAM!aCmO50HuRaAt6MYJYww-+yh|UgOvUH}%85TKFdC2_l*O&hFjY!#AxY~aERO|gYZ|-I9rA6kfIvJ#Nc8@h2E7rXAti z?wGf82b(pVJ7gC9zAf{ZvS)N`qLZ3$y>sU7D2l^8rs57#Ri02)(1@NHbGTx)Anq`R`unQb<9%?!d>Xyr3)AI09!`55|OTb_wG1w?94=?}# zk2u=^unFK^fC9i)fb9VAFtVKju1E})3*nc)muj|2ONL(4^wQL9wWcw1irL4+esoIp zS+{0ee)G1LVY{lSS=tO`<0Ud(662(XQv#W2t_I_##;*D-i->!{*MVLnq`Z9h&yb8) z{GV|^iiaW1e+6`ngUFSjFp!RA1i(N@=xnGWjEcrc_@oTRB`hV5mJ&mr5IjlZ$WzD@ z$kWJ^$TP@O$a|2dk!O)-kmr#1An!$)fe-Ka=?*S_ZaCk%5C%(>2 z0YrXZni20P^YV+*G5Ml2FOwkh0P+y>Ao4Ks5b_A}F!Ct!2=W;6DDpV+81e-2IPxU& z1o9N}B=R)!6!Hx6H1Zzg8RS{yJ;-y&v&ehr+t+L$A z`OOt$EH?*63SIYEV}j*o->TjQx34g|^5O z&T&ICsx@lPihmo^yQak-2^NOaU;=pQul0t<_IAwnuTVxDaL}w26J5y$^ZEY){5bq( literal 0 HcmV?d00001 diff --git a/src/db/models/base.py b/db/models/base.py similarity index 100% rename from src/db/models/base.py rename to db/models/base.py diff --git a/src/db/models/log_data_model.py b/db/models/lot_data_model.py similarity index 99% rename from src/db/models/log_data_model.py rename to db/models/lot_data_model.py index 2a23712..e99e179 100755 --- a/src/db/models/log_data_model.py +++ b/db/models/lot_data_model.py @@ -1,6 +1,6 @@ from pydantic import BaseModel, Field from sqlalchemy import * -from src.db.base import Base +from db.base import Base class LOT_DATA(BaseModel): diff --git a/src/db/repository/__init__.py b/db/repository/__init__.py similarity index 100% rename from src/db/repository/__init__.py rename to db/repository/__init__.py diff --git a/db/repository/__pycache__/__init__.cpython-310.pyc b/db/repository/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0822d04d72e7fca8484f812e4f38eccc4a837917 GIT binary patch literal 223 zcmd1j<>g`kg6!^?RAnIj7{oyaOhAqU5Et_Ri4=wu#vFzah7_h?22JLdj6fkx##@Y9 zewvI?!a4aR@hOQViSb3L1^LC9CHX~_D;bKIfoj0SuQ>gT{M=OioXm{GO#Oh$C|tkmR^V*P^3l8pR3C>M&ryk0@&Ee@O9 S{FKt1R6CHfib3w?VE_P$-#udh literal 0 HcmV?d00001 diff --git a/db/repository/__pycache__/lot_data_repository.cpython-310.pyc b/db/repository/__pycache__/lot_data_repository.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4300806090e9f8c63fe9d64f8c0cf360302a2e7 GIT binary patch literal 1844 zcmah}&u`pB6!whmUB}toCWTg|6le=V_`ohg9HWS;;a1X0&1ofMc|DV?v-Ua}Pe5Ba zr{;!0;y*|vF8P<{%84^KF7UnCU)gO0mgenyv-X?seeauBw%ehDXYli>Ont}sgMyon zhu~YRY78SB!E&cyeOB;3XB6|?Exf+R9O(&H@;a_-fS>MM_Lo_cO_zn1h*sy*R zekeArAHZ*kw)HpQcf=j*hhpos6K(&AGo6T=&Wo1^@!qq8XYuzh_r7~!f_WS<)A}jX z!?==Fm6c=Ti9{zUr|)Kui(e|@Iac*Cj7AZeQ?q0CJNuQL^V+%OHNRq14i4q}*G}Xr zN@0RH7Fnv}*tm%hk!zZ>a}=m@3?B_t1CBL+XT4!r$X=celdSh@k`5D9yi(<{Om)>e zndo6To`q{sUh23=#>tUXU-!hIr{qalWx7<89{oiX#ml|!$;7mPCLRr9UB+TSP%5f$ z%k41Lg7Z%O#DT5<3pl9P(d>#H^O_0v3%hi$9I(LEUHs$CnBZW--3Prq69gy#%O zaF$B=ji2Jk z)^n`t8<-_=HPh_a9a&rR5xe4-9>{cOWV)72ulD|%O!Xd;s`tqd7rtbS?!uNP3pb aU79-;$!5!GG44VJjgavGt2z5^blAU0$Atg@ literal 0 HcmV?d00001 diff --git a/src/db/repository/lot_data_repository.py b/db/repository/lot_data_repository.py similarity index 92% rename from src/db/repository/lot_data_repository.py rename to db/repository/lot_data_repository.py index dc236f8..2647c6b 100755 --- a/src/db/repository/lot_data_repository.py +++ b/db/repository/lot_data_repository.py @@ -1,5 +1,5 @@ -from src.db.models.log_data_model import LOT_DATA_MODEL, LOT_DATA -from src.db.session import with_session +from db.models.lot_data_model import LOT_DATA_MODEL, LOT_DATA +from db.session import with_session @with_session diff --git a/src/db/session.py b/db/session.py similarity index 96% rename from src/db/session.py rename to db/session.py index 78b04d0..47cb59f 100755 --- a/src/db/session.py +++ b/db/session.py @@ -1,6 +1,6 @@ from functools import wraps from contextlib import contextmanager -from src.db.base import SessionLocal +from db.base import SessionLocal from sqlalchemy.orm import Session diff --git a/src/__pycache__/api.cpython-310.pyc b/src/__pycache__/api.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4eea617bbf43b19766925cae84aa58407c85a73b GIT binary patch literal 1037 zcmZ`&O>fgc5Zzrn$tHEmr%;b@^d*)!BScHNp|m2EDtxgV?~)koIP5Mej*xEN{aJCzp;5q;=KrietpY7eBrNJtZ>S#=;}CXL)8QNN5#noCH; zU!R;s$A@Q!l`CQsClm{;7O*48^(8#|2(}3~WJ>11#n3r9Cq3d4!^+2$%mABsh6*~R zf?cz7QYUYL@r+*5-s-%d7i8gd)89~I!74W?gshxg4}3?VXbS69%~zijIW}oAS}@f> zgvtd`ci{HtBp4RC46<|>r@?8N3}cm_s^Yy&j1I=785W~ecq_^Z6Xo$J9!T{x&?*Vy zaoQP|l>@TXA+z3xjZqGteR@Fo7xq`(11Q0k)(d;w$Z-t8q=|A&>73mXnrZ4A-M zo%T5nE6&~{z*hw7)Y}^I0PwEA7w(IGCx@BIbf*u~Z_|ct0F@jUIyHqVmvdx`qM$JO vo4?=)V3o+GQ0Tg~SfM@&YwR>;TeRZxXYl(^nS72fhDL8Z@({aoIQRHJ%Tw9s literal 0 HcmV?d00001 diff --git a/src/db/api.py b/src/api.py similarity index 75% rename from src/db/api.py rename to src/api.py index fe47791..93e0cd6 100644 --- a/src/db/api.py +++ b/src/api.py @@ -1,6 +1,6 @@ -from src.db.models.base import BaseResponse -from src.db.models.log_data_model import LOT_DATA -from src.db.repository import add_kb_to_db, get_kb_detail, delete_kb_detail_by_time +from db.models.base import BaseResponse +from db.repository import add_kb_to_db, get_kb_detail, delete_kb_detail_by_time +from db.models.lot_data_model import LOT_DATA def add(data: LOT_DATA): diff --git a/src/sensor_to_local.py b/src/sensor_to_local.py index 71aae79..8e25a1a 100644 --- a/src/sensor_to_local.py +++ b/src/sensor_to_local.py @@ -3,7 +3,7 @@ import time import serial -from db.api import add +from src.api import add from db.models.log_data_model import LOT_DATA if __name__ == '__main__': diff --git a/src/sensor_to_server.py b/src/sensor_to_server.py index 518a669..6046279 100644 --- a/src/sensor_to_server.py +++ b/src/sensor_to_server.py @@ -6,8 +6,8 @@ import time import serial import paho.mqtt.client as mqtt -from db.api import add -from db.models.log_data_model import LOT_DATA +from api import add +from db.models.lot_data_model import LOT_DATA def t():