Mohammedallyl commited on
Commit
cf39b33
1 Parent(s): c56bf06

Update Logic/Locations/GetMapOfuser.py

Browse files
Files changed (1) hide show
  1. Logic/Locations/GetMapOfuser.py +8 -2
Logic/Locations/GetMapOfuser.py CHANGED
@@ -11,6 +11,7 @@ class DataType(BaseModel):
11
  @UserGetLocationRouter.post("/GetMapLocations")
12
  def adduser(Data:DataType):
13
  try:
 
14
  Email=Data.Email
15
  Password=Data.Password
16
  Day=Data.Day
@@ -23,6 +24,7 @@ def adduser(Data:DataType):
23
  cursor=connect.execute(f'''
24
  SELECT UserId,Password FROM Users where Email='{Email}'
25
  ''')
 
26
  Data=cursor.fetchall()
27
  if len(Data) !=0 :
28
  if Data[0][0]==None:
@@ -42,7 +44,6 @@ def adduser(Data:DataType):
42
 
43
  # PositionsMean=cursor2.fetchall()
44
  connect.close()
45
- print(DataCollected)
46
  if len(DataCollected)==0:
47
  return {
48
  "Status":True,
@@ -50,10 +51,15 @@ def adduser(Data:DataType):
50
 
51
  "PositionData":[],
52
  "Time":[],
53
- "Mean":[51.505, -0.09]
54
 
55
  }
56
  }
 
 
 
 
 
57
  PositionData=[ [ item[0],item[1]]for item in DataCollected]
58
  PositionsMean=list(mean(array(PositionData),axis=0))
59
  Houre=[ item[2] for item in DataCollected]
 
11
  @UserGetLocationRouter.post("/GetMapLocations")
12
  def adduser(Data:DataType):
13
  try:
14
+
15
  Email=Data.Email
16
  Password=Data.Password
17
  Day=Data.Day
 
24
  cursor=connect.execute(f'''
25
  SELECT UserId,Password FROM Users where Email='{Email}'
26
  ''')
27
+
28
  Data=cursor.fetchall()
29
  if len(Data) !=0 :
30
  if Data[0][0]==None:
 
44
 
45
  # PositionsMean=cursor2.fetchall()
46
  connect.close()
 
47
  if len(DataCollected)==0:
48
  return {
49
  "Status":True,
 
51
 
52
  "PositionData":[],
53
  "Time":[],
54
+ "Mean":[12.3,50]
55
 
56
  }
57
  }
58
+ print("DataCollectedprint(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)")
59
+ print("DataCollectedprint(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)")
60
+ print("DataCollectedprint(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)")
61
+ print("DataCollectedprint(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)print(DataCollected)")
62
+ print(DataCollected)
63
  PositionData=[ [ item[0],item[1]]for item in DataCollected]
64
  PositionsMean=list(mean(array(PositionData),axis=0))
65
  Houre=[ item[2] for item in DataCollected]