diff --git a/Assets/Assets.pyc b/Assets/Assets.pyc index 8070b12..75b926b 100644 Binary files a/Assets/Assets.pyc and b/Assets/Assets.pyc differ diff --git a/Queries/queries.py b/Queries/queries.py index 385137f..7caa290 100644 --- a/Queries/queries.py +++ b/Queries/queries.py @@ -82,4 +82,18 @@ def real_dayvalue(tag_id,time,end_time): "order": "asc", } ] + } + +def real_dayvalue_all(tag_id,time,end_time): + tag_id = tag_id.split(',') + return { + "start": time, + "end":end_time, + "tags": [ + { + #"filters": {"measurements": {"values": 4294967.295, "condition": "ne"}}, + "name": tag_id, + "order": "asc", + } + ] } \ No newline at end of file diff --git a/Queries/queries.pyc b/Queries/queries.pyc index 9053376..8982ac7 100644 Binary files a/Queries/queries.pyc and b/Queries/queries.pyc differ diff --git a/Queries/querybody.py b/Queries/querybody.py index 6a7ad86..c54b380 100644 --- a/Queries/querybody.py +++ b/Queries/querybody.py @@ -174,4 +174,13 @@ def query_real_dayvalue(tag_id,time,end_time): if response_data.raise_for_status() is None: return response_data.json() abort(make_response(jsonify({'response': {'message': ' Forwarding data from predix response.'}}), - response_data.raise_for_status)) \ No newline at end of file + response_data.raise_for_status)) + +def query_real_dayvalue_all(tag_id,time,end_time): + response_data = requests.post(QUERY_URL, + data=json.dumps(query.real_dayvalue_all(tag_id,time,end_time)), + headers=connection.create_header()) + if response_data.raise_for_status() is None: + return response_data.json() + abort(make_response(jsonify({'response': {'message': ' Forwarding data from predix response.'}}), + response_data.raise_for_status)) diff --git a/Queries/querybody.pyc b/Queries/querybody.pyc index 41b0dc4..9e2ed81 100644 Binary files a/Queries/querybody.pyc and b/Queries/querybody.pyc differ diff --git a/Reon/Reon.py b/Reon/Reon.py index 180b540..bf8107f 100644 --- a/Reon/Reon.py +++ b/Reon/Reon.py @@ -55,7 +55,11 @@ def get_aggregated_day(tag_id, get_time): end_time=time_list+86340000 return json.dumps(util.parse_data_latest(qb.query_real_dayvalue(tag_id,time_list,end_time))) - +def get_aggregated_day_all(tag_id, get_time): + df = datetime.datetime.strptime(get_time + ' 00:00:00', "%Y-%m-%d %H:%M:%S") + time_list=(int(time.mktime(utc_return_nowtime(df).timetuple()) * 1000)) + end_time=time_list+86340000 + return json.dumps(qb.query_real_dayvalue_all(tag_id,time_list,end_time)) diff --git a/Reon/Reon.pyc b/Reon/Reon.pyc index 2a77018..8cf48fa 100644 Binary files a/Reon/Reon.pyc and b/Reon/Reon.pyc differ diff --git a/ResponseDict.pyc b/ResponseDict.pyc index 6da1253..b7d84b4 100644 Binary files a/ResponseDict.pyc and b/ResponseDict.pyc differ diff --git a/_connect.pyc b/_connect.pyc index 37255f1..719cf22 100644 Binary files a/_connect.pyc and b/_connect.pyc differ diff --git a/app.py b/app.py index 25fb1c6..ba8bf29 100644 --- a/app.py +++ b/app.py @@ -39,7 +39,12 @@ def get_aggregated_day(): return reonService.get_aggregated_day(request.args.get('t'), request.args.get('time')) abort(make_response(jsonify(Auth_Token_Expired), 401)) - +@app.route("/api/aggregated_day_all") +def get_aggregated_day_all(): + if reonService.verify_auth_token(request.args.get('tok')): + return reonService.get_aggregated_day_all(request.args.get('t'), request.args.get('time')) + abort(make_response(jsonify(Auth_Token_Expired), 401)) + @app.route("/api/aggregated_week") def get_aggregated_week(): if reonService.verify_auth_token(request.args.get('tok')): diff --git a/app.pyc b/app.pyc index a07ffe2..869aaf8 100644 Binary files a/app.pyc and b/app.pyc differ diff --git a/token.json b/token.json new file mode 100644 index 0000000..8986cc9 --- /dev/null +++ b/token.json @@ -0,0 +1 @@ +{"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImxWeFNnIiwidHlwIjoiSldUIn0.eyJqdGkiOiJlYTM3NTM1NzUwMWI0ZWFlYmZmYzZmMjkyOTJlZGUwNyIsInN1YiI6IlJlb24iLCJzY29wZSI6WyJwcmVkaXgtYXNzZXQuem9uZXMuZjVjNTQ2M2MtODhlMC00ZTZkLThmOTEtMjcyMTE4OGI2YmRhLnVzZXIiLCJ1YWEucmVzb3VyY2UiLCJ1YWE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GyFQsxFKQnjpQL-8pRdOu9hDGC1whw3LYCqH_V0FdbpgWKfQIGq-sFdFx8vAKeoUlQzI1yF32UHm0d8I3SSexMUa_NZ8ziRZ5fqn2Gbiw", "expires": "2019-04-16T21:58:47.858000"} \ No newline at end of file diff --git a/util.pyc b/util.pyc index 3f3f996..c6eca8b 100644 Binary files a/util.pyc and b/util.pyc differ