ClimateNetTumoLabs / django-app

1 stars 0 forks source link

Needed Functionality for backend #8

Open eriktumosaryan opened 4 months ago

eriktumosaryan commented 4 months ago

Write all functions that you think we need to create good backend code. We need all request types that is possible.

HovhannesApinyan commented 4 months ago

@eriktumosaryan Here are the types of requests that should be supported, along with their functionalities:

  1. Get the Latest Value:

    • Purpose: Fetch the most recent data entry.
    • Method: GET
    • Endpoint: /data/latest
  2. Get Data for the Last 24 Hours (or Today's Data):

    • Purpose: Retrieve data entries from the past 24 hours or for the current day.
    • Method: GET
    • Endpoint: /data/24hours or /data/today
    • The data should be grouped by hour. The decision between 24 hours or today's data depends on the specific use case and user requirements.
  3. Get Data for the Last 7 Days:

    • Purpose: Fetch data entries from the past week.
    • Method: GET
    • Endpoint: /data/7days
    • Data should be grouped by day. Consider if nighttime data is necessary for the context. If certain hours are irrelevant, they could be filtered out.
  4. Get Data for a Specified Period:

    • Purpose: Retrieve data entries for a user-defined period.
    • Method: GET
    • Endpoint: /data/period
    • This request would need start_time and end_time parameters. Data should be ordered by day. To avoid code duplication with the 7-day request, you could have a general function that both endpoints call, passing different parameters for the time range.
eriktumosaryan commented 4 months ago

@sarzumanyan Jan Please read this recommendations Maybe its will be good for you

sarzumanyan commented 4 months ago

device_inner/<device_id>/period working device_inner/<device_id>/nearby working device_inner/<device_id>/24hours working device_inner/<device_id>/latest working device_inner/list working