diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java b/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java index 7a47f81..ea5a9e8 100644 --- a/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java +++ b/MyCity/app/src/main/java/gq/yigit/mycity/MainActivity.java @@ -26,7 +26,6 @@ import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; -import gq.yigit.mycity.navigation.MapsFragment; import gq.yigit.mycity.navigation.TransitFragment; import gq.yigit.mycity.tools.*; import gq.yigit.mycity.tools.WebRequest.responseListener; @@ -49,7 +48,6 @@ public class MainActivity extends AppCompatActivity OnListFragmentInteractionListener, MainFragment.OnFragmentInteractionListener, RateFragment.OnFragmentInteractionListener, - MapsFragment.OnFragmentInteractionListener, UtilityMain.OnFragmentInteractionListener, TransitFragment.OnFragmentInteractionListener, OnFragmentInteractionListener, @@ -176,12 +174,7 @@ public class MainActivity extends AppCompatActivity fragmentTransaction.replace(R.id.app_bar_main, fragment); fragmentTransaction.commit(); fragmentTransaction.addToBackStack(null); - } else if (id == R.id.navigation) { - MapsFragment fragment = new MapsFragment(); - fragmentTransaction.replace(R.id.app_bar_main, fragment); - fragmentTransaction.commit(); - fragmentTransaction.addToBackStack(null); - } else if (id == R.id.rating) { + } else if (id == R.id.rating) { RateFragment fragment = new RateFragment(); fragmentTransaction.replace(R.id.app_bar_main, fragment); fragmentTransaction.commit(); diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java b/MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java deleted file mode 100644 index 51e1a30..0000000 --- a/MyCity/app/src/main/java/gq/yigit/mycity/navigation/MapsFragment.java +++ /dev/null @@ -1,109 +0,0 @@ -package gq.yigit.mycity.navigation; - -import android.content.Context; -import android.net.Uri; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import gq.yigit.mycity.R; - -/** - * A simple {@link Fragment} subclass. - * Activities that contain this fragment must implement the - * {@link MapsFragment.OnFragmentInteractionListener} interface - * to handle interaction events. - * Use the {@link MapsFragment#newInstance} factory method to - * create an instance of this fragment. - */ -public class MapsFragment extends Fragment { - // TODO: Rename parameter arguments, choose names that match - // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER - private static final String ARG_PARAM1 = "param1"; - private static final String ARG_PARAM2 = "param2"; - - // TODO: Rename and change types of parameters - private String mParam1; - private String mParam2; - - private OnFragmentInteractionListener mListener; - - public MapsFragment() { - // Required empty public constructor - } - - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @param param1 Parameter 1. - * @param param2 Parameter 2. - * @return A new instance of fragment MapsFragment. - */ - // TODO: Rename and change types and number of parameters - public static MapsFragment newInstance(String param1, String param2) { - MapsFragment fragment = new MapsFragment(); - Bundle args = new Bundle(); - args.putString(ARG_PARAM1, param1); - args.putString(ARG_PARAM2, param2); - fragment.setArguments(args); - return fragment; - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - if (getArguments() != null) { - mParam1 = getArguments().getString(ARG_PARAM1); - mParam2 = getArguments().getString(ARG_PARAM2); - } - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_maps, container, false); - } - - // TODO: Rename method, update argument and hook method into UI event - public void onButtonPressed(Uri uri) { - if (mListener != null) { - mListener.onFragmentInteraction(uri); - } - } - - @Override - public void onAttach(Context context) { - super.onAttach(context); - if (context instanceof OnFragmentInteractionListener) { - mListener = (OnFragmentInteractionListener) context; - } else { - throw new RuntimeException(context.toString() - + " must implement OnFragmentInteractionListener"); - } - } - - @Override - public void onDetach() { - super.onDetach(); - mListener = null; - } - - /** - * This interface must be implemented by activities that contain this - * fragment to allow an interaction in this fragment to be communicated - * to the activity and potentially other fragments contained in that - * activity. - *

- * See the Android Training lesson Communicating with Other Fragments for more information. - */ - public interface OnFragmentInteractionListener { - // TODO: Update argument type and name - void onFragmentInteraction(Uri uri); - } -} diff --git a/MyCity/app/src/main/res/layout/fragment_layout.xml b/MyCity/app/src/main/res/layout/fragment_layout.xml new file mode 100644 index 0000000..d2602cd --- /dev/null +++ b/MyCity/app/src/main/res/layout/fragment_layout.xml @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/MyCity/app/src/main/res/menu/activity_main_drawer.xml b/MyCity/app/src/main/res/menu/activity_main_drawer.xml index 6e32444..ad3e68a 100644 --- a/MyCity/app/src/main/res/menu/activity_main_drawer.xml +++ b/MyCity/app/src/main/res/menu/activity_main_drawer.xml @@ -9,10 +9,6 @@ android:id="@+id/transit" android:icon="@drawable/subway" android:title="Public Transit"/> - + + + + Denunction Map + + + + + +

+ + + + + diff --git a/client_side/interface/UserData/index.html b/client_side/interface/UserData/index.html deleted file mode 100644 index 2e47c27..0000000 --- a/client_side/interface/UserData/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - UserInterface - - - - - -
- - - - - - - - - - - - - - - -
Name:TC:Status:
Health info:
-
-
- - diff --git a/client_side/interface/UserData/index.js b/client_side/interface/UserData/index.js deleted file mode 100644 index 334ff75..0000000 --- a/client_side/interface/UserData/index.js +++ /dev/null @@ -1,4 +0,0 @@ -var exampleSocket = new WebSocket("ws://localhost:3000", "protocolOne"); -exampleSocket.onmessage = function (event) { - console.log(event.data); -} \ No newline at end of file diff --git a/client_side/interface/UserData/package-lock.json b/client_side/interface/UserData/package-lock.json deleted file mode 100644 index dd2b26b..0000000 --- a/client_side/interface/UserData/package-lock.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "2.1.23", - "negotiator": "0.6.1" - } - }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" - }, - "arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" - }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" - }, - "backo2": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" - }, - "base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" - }, - "base64id": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", - "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=" - }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "requires": { - "callsite": "1.0.0" - } - }, - "blob": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" - }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" - }, - "component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "2.1.1" - } - }, - "engine.io": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.3.2.tgz", - "integrity": "sha512-AsaA9KG7cWPXWHp5FvHdDWY3AMWeZ8x+2pUVLcn71qE5AtAzgGbxuclOytygskw8XGmiQafTmnI9Bix3uihu2w==", - "requires": { - "accepts": "1.3.5", - "base64id": "1.0.0", - "cookie": "0.3.1", - "debug": "3.1.0", - "engine.io-parser": "2.1.3", - "ws": "6.1.4" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "engine.io-client": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.3.2.tgz", - "integrity": "sha512-y0CPINnhMvPuwtqXfsGuWE8BB66+B6wTtCofQDRecMQPYX3MYUZXFNKDhdrSe3EVjgOu4V3rxdeqN/Tr91IgbQ==", - "requires": { - "component-emitter": "1.2.1", - "component-inherit": "0.0.3", - "debug": "3.1.0", - "engine.io-parser": "2.1.3", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "6.1.4", - "xmlhttprequest-ssl": "1.5.5", - "yeast": "0.1.2" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "engine.io-parser": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz", - "integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==", - "requires": { - "after": "0.8.2", - "arraybuffer.slice": "0.0.7", - "base64-arraybuffer": "0.1.5", - "blob": "0.0.5", - "has-binary2": "1.0.3" - } - }, - "has-binary2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", - "requires": { - "isarray": "2.0.1" - } - }, - "has-cors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" - }, - "mime-db": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.39.0.tgz", - "integrity": "sha512-DTsrw/iWVvwHH+9Otxccdyy0Tgiil6TWK/xhfARJZF/QFhwOgZgOIvA2/VIGpM8U7Q8z5nDmdDWC6tuVMJNibw==" - }, - "mime-types": { - "version": "2.1.23", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.23.tgz", - "integrity": "sha512-ROk/m+gMVSrRxTkMlaQOvFmFmYDc7sZgrjjM76abqmd2Cc5fCV7jAMA5XUccEtJ3cYiYdgixUVI+fApc2LkXlw==", - "requires": { - "mime-db": "1.39.0" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" - }, - "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "requires": { - "better-assert": "1.0.2" - } - }, - "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "requires": { - "better-assert": "1.0.2" - } - }, - "socket.io": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.2.0.tgz", - "integrity": "sha512-wxXrIuZ8AILcn+f1B4ez4hJTPG24iNgxBBDaJfT6MsyOhVYiTXWexGoPkd87ktJG8kQEcL/NBvRi64+9k4Kc0w==", - "requires": { - "debug": "4.1.1", - "engine.io": "3.3.2", - "has-binary2": "1.0.3", - "socket.io-adapter": "1.1.1", - "socket.io-client": "2.2.0", - "socket.io-parser": "3.3.0" - } - }, - "socket.io-adapter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", - "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=" - }, - "socket.io-client": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.2.0.tgz", - "integrity": "sha512-56ZrkTDbdTLmBIyfFYesgOxsjcLnwAKoN4CiPyTVkMQj3zTUh0QAx3GbvIvLpFEOvQWu92yyWICxB0u7wkVbYA==", - "requires": { - "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", - "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "3.1.0", - "engine.io-client": "3.3.2", - "has-binary2": "1.0.3", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "socket.io-parser": "3.3.0", - "to-array": "0.1.4" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "socket.io-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", - "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", - "requires": { - "component-emitter": "1.2.1", - "debug": "3.1.0", - "isarray": "2.0.1" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" - }, - "ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", - "requires": { - "async-limiter": "1.0.0" - } - }, - "xmlhttprequest-ssl": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", - "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" - }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" - } - } -} diff --git a/client_side/interface/UserData/qr_info.html b/client_side/interface/UserData/qr_info.html new file mode 100644 index 0000000..668a892 --- /dev/null +++ b/client_side/interface/UserData/qr_info.html @@ -0,0 +1,49 @@ + + + + + + UserInterface + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
Name:TC:
Phone Number:E-Mail:
Health info:
+
+ +
+ + diff --git a/client_side/modules/qr/user_data.py b/client_side/modules/qr/user_data.py index 525ffbb..c1dd1bb 100644 --- a/client_side/modules/qr/user_data.py +++ b/client_side/modules/qr/user_data.py @@ -1,6 +1,15 @@ +from flask import Flask, jsonify, request, abort from multiprocessing import Process +import requests import reader +import json + +import urllib3 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + +app = Flask(__name__) +user = {} class Reader(): def __init__(self): @@ -8,23 +17,24 @@ class Reader(): p1 = Process(target=read.detect) p1.start() - def received(self,data): - print(data) - -qr_reader = Reader() - -while 1: - continue - - - - - - - + def received(self, data): + r = requests.get('https://0.0.0.0:5000/users/{}'.format(data), verify=False) + requests.get('http://0.0.0.0:3000/set', data={'data': r.text}) +qr_reader = Reader() +@app.route('/set') +def set_data(): + global user + user = json.loads(request.form['data']) + return '' +@app.route('/get') +def get_qr(): + if user == {}: + abort(404) + return jsonify(user) +app.run(host='0.0.0.0', port=3000) \ No newline at end of file diff --git a/server_side/api/images/muhtarlik.jpg b/server_side/api/images/muhtarlik.jpg new file mode 100644 index 0000000..7d95405 Binary files /dev/null and b/server_side/api/images/muhtarlik.jpg differ diff --git a/server_side/api/images/park.jpg b/server_side/api/images/park.jpg new file mode 100644 index 0000000..d44e7bc Binary files /dev/null and b/server_side/api/images/park.jpg differ diff --git a/server_side/api/modules/databases/bus_locations.json b/server_side/api/modules/databases/bus_locations.json new file mode 100644 index 0000000..d877d19 --- /dev/null +++ b/server_side/api/modules/databases/bus_locations.json @@ -0,0 +1,6 @@ +{ + "bus_1": { + "latitude": 39.9404, + "longitude": 32.9101 + } +} \ No newline at end of file diff --git a/server_side/api/modules/databases/denunciations.json b/server_side/api/modules/databases/denunciations.json index 08765f1..bd05f52 100644 --- a/server_side/api/modules/databases/denunciations.json +++ b/server_side/api/modules/databases/denunciations.json @@ -15,8 +15,8 @@ "info": "Vandalism", "priority": "3", "location": { - "latitude": "35.3", - "longitude": "37.7" + "latitude": 39.95, + "longitude": 32.87 } } ] \ No newline at end of file diff --git a/server_side/api/modules/databases/users.json b/server_side/api/modules/databases/users.json index f59873a..ed7289c 100644 --- a/server_side/api/modules/databases/users.json +++ b/server_side/api/modules/databases/users.json @@ -2,7 +2,7 @@ "efe": { "id": "9vard12ty0ad2yvwp3q53rsf3h43r2vq", "realname": "Efe Aydın", - "avatar": "/img/user1.png", + "avatar": "/img/9vard12ty0ad2yvwp3q53rsf3h43r2vq.png", "password": "827ccb0eea8a706c4c34a16891f84e7b", "email": "efeaydin@mycity.com", "TC": "11111111111", diff --git a/server_side/api/modules/databases/votings.json b/server_side/api/modules/databases/votings.json index f3afb31..2229195 100644 --- a/server_side/api/modules/databases/votings.json +++ b/server_side/api/modules/databases/votings.json @@ -1,43 +1,40 @@ [ { "id": 1, - "name": "Test Voting", - "desc": "Sample voting description", - "img": "/img/voting.jpg", + "name": "Muhtarl\u0131k Se\u00e7imi", + "desc": "Emek Mahallesi Muhtarl\u0131k Se\u00e7imi", + "img": "/img/muhtarlik.jpg", "voters": [ "9vard12ty0ad2yvwp3q53rsf3h43r2vq" ], "votes": { "1": { - "name": "Sample Vote 1", - "desc": "Sample description", - "votes": 3 + "name": "Efe Ayd\u0131n", + "desc": "Mahallenizin gen\u00e7 muhtar aday\u0131...", + "votes": 4 }, "2": { - "name": "Sample Vote 2", - "desc": "Sample description", - "votes": 0 + "name": "Zeynep T\u00fcfek\u00e7i", + "desc": "Tecr\u00fcbe ve bilgi sahibi muhtar...", + "votes": 5 } } }, { "id": 2, - "name": "wooting", - "desc": "wooting desc", - "img": "/img/voting.jpg", - "voters": [ - "9vard12ty0ad2yvwp3q53rsf3h43r2vq" - ], + "name": "Park Ad\u0131 Oylamas\u0131", + "desc": "Mahallemizin yeni park\u0131n\u0131n ad\u0131", + "img": "/img/park.jpg", + "voters": [], "votes": { "1": { - "name": "woote 1", - "desc": "woote desc", + "name": "Mutlu Park", + "desc": "Mutlu park, mutlu isimlerle olur.", "votes": 3 }, "2": { - "id": 1, - "name": "woote 2", - "desc": "woote 3", + "name": "Yi\u011fit \u00c7olako\u011flu Park\u0131", + "desc": "Mahallemizin say\u0131n destek\u00e7isinin ad\u0131", "votes": 0 } } diff --git a/server_side/api/modules/user_info.py b/server_side/api/modules/user_info.py index d4450ff..e734fc7 100644 --- a/server_side/api/modules/user_info.py +++ b/server_side/api/modules/user_info.py @@ -3,8 +3,6 @@ import copy import json import base64 - - from api.modules import utils from flask import Flask, request @@ -53,7 +51,7 @@ class Users(Resource): class User(Resource): def get(self, user_id): try: - user = utils.find_by_id( users.values(), user_id ) + user = copy.deepcopy(utils.find_by_id( users.values(), user_id )) if not user: raise Exception('User not found!') del user['password']