ZoologicalFooding / ZoologicalFooding-main

1 stars 0 forks source link

As a developer, I would like to develop a backend providing APIs over HTTP to manage the system. #4

Open onurTe opened 4 years ago

onurTe commented 4 years ago

As a developer, I would like to develop a backend providing APIs over HTTP to manage the system.

The features it should support are as follows:

ListMembers:

An API endpoint to list members in the system. This should access the database and retrieve the list of members in the system and return them. The call should return <member id, member first_name, member last_name, member address, member email, member pass, member containerList> pairs so that the name can be used to visualize the member in a ui while the id can be used in the consecutive calls from the client.

The return data should be a JSON similar to :

{ members : [ { first_name: "baris", last_name : "onen", adress : "tobbetu", email : "baris@etu", pass : "12", id: "15", food_container_list : "" }, { first_name: "onur", last_name : "tetik", adress : "tobbetu", email : "onur@etu", pass : "17", id: "16", food_container_list : "" } ] }

ListContainers:

An API endpoint to list food containers in the system. This should access the database and retrieve the list of containers in the system and return them. The call should return <food container id, food container name, food container type,food container lng, food container lat, food container weight, food container address,food container, member_list> pairs so that the name can be used to visualize the food containers in a ui while the id can be used in the consecutive calls from the client.

The return data should be a JSON similar to :

{ foodcontainers : [ { container_id: "1", name : "containerFirst", type : "dog", lng : "12.2324.2422", lat : "125.5216.61361", weight : "20", address : "tobbetu", member_list : "baris" }, { container_id: "2", name : "containerSecond", type : "cat", lng : "23.252.22626", lat : "252.6262.262", weight : "22", address : "cukurambar", member_list : "onur" } ] }

FoodContainerDetail:

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/foodContainers?Id=1

The return data should be a JSON similar to :

{ foodcontainers_first : [ { name : "containerFirst", type : "dog", lng : "12.2324.2422", lat : "125.5216.61361", weight : "20", address : "tobbetu", fills_list : "baris,onur" } ] }

_HTTP_Post, Put, Delete Methods for FoodContainerswill made

MemberDetail:

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/member?Id=15

The return data should be a JSON similar to :

{ members_first : [ { first_name: "baris", last_name : "onen", adress : "tobbetu", email : "baris@etu", pass : "12", food_container_list : "foodcontainer1,foodcontainer2" } ] }

HTTP Post, Put, Delete Methods for MemberDetail will made

In our system, reorganization and additions will be made according to the conditions.