Commit 3bff7a28 authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Documentation updated for search routes

parent d245f596
......@@ -26,8 +26,9 @@ exports.default = function(req, res) {
};
/**
* @api {get} /search/around
* @apiName SearchAround
* @api {get} /search/around Around a point
* @apiDescription Retrieve all pictures around a given point, within a given radius.
* @apiName GetSearchAround
* @apiGroup Search
*
* @apiParam {Number} lat The latitude (WGS84)
......@@ -36,6 +37,10 @@ exports.default = function(req, res) {
* @apiParam {Long} [mindate] The minimum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)
* @apiParam {Long} [maxdate] The maximum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)
* @apiParam {String} [use] The list of fetchers to use (comma-separated)
* @apiParam {String} [ignore] The list of fetchers to ignore (comma-separated)
*
* @apiSuccess {String} status The response status (OK)
* @apiSuccess {Array} pictures The retrieved pictures, see <a href="https://framagit.org/PanierAvide/Pic4Carto.js/blob/master/doc/API.md#picture">details about the Picture object</a>.
*/
exports.searchAround = function(req, res) {
console.log("[SEARCH] "
......@@ -75,6 +80,24 @@ exports.searchAround = function(req, res) {
}
};
/**
* @api {get} /search/bbox Bounding box
* @apiDescription Retrieve all pictures in a bounding box.
* @apiName GetSearchBbox
* @apiGroup Search
*
* @apiParam {Number} south The minimal latitude (WGS84)
* @apiParam {Number} west The minimal longitude (WGS84)
* @apiParam {Number} north The maximal latitude (WGS84)
* @apiParam {Number} east The maximal longitude (WGS84)
* @apiParam {Long} [mindate] The minimum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)
* @apiParam {Long} [maxdate] The maximum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)
* @apiParam {String} [use] The list of fetchers to use (comma-separated)
* @apiParam {String} [ignore] The list of fetchers to ignore (comma-separated)
*
* @apiSuccess {String} status The response status (OK)
* @apiSuccess {Array} pictures The retrieved pictures, see <a href="https://framagit.org/PanierAvide/Pic4Carto.js/blob/master/doc/API.md#picture">details about the Picture object</a>.
*/
exports.searchBbox = function(req, res) {
console.log("[SEARCH] BBox "
+req.query.south+", "+req.query.west+", "+req.query.north+", "+req.query.east
......
......@@ -2,8 +2,9 @@ define({ "api": [
{
"type": "get",
"url": "/search/around",
"title": "",
"name": "SearchAround",
"title": "Around a point",
"description": "<p>Retrieve all pictures around a given point, within a given radius.</p>",
"name": "GetSearchAround",
"group": "Search",
"parameter": {
"fields": {
......@@ -34,7 +35,141 @@ define({ "api": [
"type": "Long",
"optional": true,
"field": "mindate",
"description": "<p>The minimum timestamp for a given time range</p>"
"description": "<p>The minimum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "Long",
"optional": true,
"field": "maxdate",
"description": "<p>The maximum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "use",
"description": "<p>The list of fetchers to use (comma-separated)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "ignore",
"description": "<p>The list of fetchers to ignore (comma-separated)</p>"
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "String",
"optional": false,
"field": "status",
"description": "<p>The response status (OK)</p>"
},
{
"group": "Success 200",
"type": "Array",
"optional": false,
"field": "pictures",
"description": "<p>The retrieved pictures, see <a href=\"https://framagit.org/PanierAvide/Pic4Carto.js/blob/master/doc/API.md#picture\">details about the Picture object</a>.</p>"
}
]
}
},
"version": "0.0.0",
"filename": "api/controllers/P4CaaSController.js",
"groupTitle": "Search"
},
{
"type": "get",
"url": "/search/bbox",
"title": "Bounding box",
"description": "<p>Retrieve all pictures in a bounding box.</p>",
"name": "GetSearchBbox",
"group": "Search",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "south",
"description": "<p>The minimal latitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "west",
"description": "<p>The minimal longitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "north",
"description": "<p>The maximal latitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "east",
"description": "<p>The maximal longitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Long",
"optional": true,
"field": "mindate",
"description": "<p>The minimum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "Long",
"optional": true,
"field": "maxdate",
"description": "<p>The maximum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "use",
"description": "<p>The list of fetchers to use (comma-separated)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "ignore",
"description": "<p>The list of fetchers to ignore (comma-separated)</p>"
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "String",
"optional": false,
"field": "status",
"description": "<p>The response status (OK)</p>"
},
{
"group": "Success 200",
"type": "Array",
"optional": false,
"field": "pictures",
"description": "<p>The retrieved pictures, see <a href=\"https://framagit.org/PanierAvide/Pic4Carto.js/blob/master/doc/API.md#picture\">details about the Picture object</a>.</p>"
}
]
}
......
......@@ -2,8 +2,9 @@
{
"type": "get",
"url": "/search/around",
"title": "",
"name": "SearchAround",
"title": "Around a point",
"description": "<p>Retrieve all pictures around a given point, within a given radius.</p>",
"name": "GetSearchAround",
"group": "Search",
"parameter": {
"fields": {
......@@ -34,7 +35,141 @@
"type": "Long",
"optional": true,
"field": "mindate",
"description": "<p>The minimum timestamp for a given time range</p>"
"description": "<p>The minimum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "Long",
"optional": true,
"field": "maxdate",
"description": "<p>The maximum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "use",
"description": "<p>The list of fetchers to use (comma-separated)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "ignore",
"description": "<p>The list of fetchers to ignore (comma-separated)</p>"
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "String",
"optional": false,
"field": "status",
"description": "<p>The response status (OK)</p>"
},
{
"group": "Success 200",
"type": "Array",
"optional": false,
"field": "pictures",
"description": "<p>The retrieved pictures, see <a href=\"https://framagit.org/PanierAvide/Pic4Carto.js/blob/master/doc/API.md#picture\">details about the Picture object</a>.</p>"
}
]
}
},
"version": "0.0.0",
"filename": "api/controllers/P4CaaSController.js",
"groupTitle": "Search"
},
{
"type": "get",
"url": "/search/bbox",
"title": "Bounding box",
"description": "<p>Retrieve all pictures in a bounding box.</p>",
"name": "GetSearchBbox",
"group": "Search",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "south",
"description": "<p>The minimal latitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "west",
"description": "<p>The minimal longitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "north",
"description": "<p>The maximal latitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "east",
"description": "<p>The maximal longitude (WGS84)</p>"
},
{
"group": "Parameter",
"type": "Long",
"optional": true,
"field": "mindate",
"description": "<p>The minimum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "Long",
"optional": true,
"field": "maxdate",
"description": "<p>The maximum timestamp for a given time range, in seconds since 1st january 1970 (Epoch)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "use",
"description": "<p>The list of fetchers to use (comma-separated)</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": true,
"field": "ignore",
"description": "<p>The list of fetchers to ignore (comma-separated)</p>"
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "String",
"optional": false,
"field": "status",
"description": "<p>The response status (OK)</p>"
},
{
"group": "Success 200",
"type": "Array",
"optional": false,
"field": "pictures",
"description": "<p>The retrieved pictures, see <a href=\"https://framagit.org/PanierAvide/Pic4Carto.js/blob/master/doc/API.md#picture\">details about the Picture object</a>.</p>"
}
]
}
......
......@@ -8,7 +8,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-06-08T17:29:49.562Z",
"time": "2017-06-09T10:18:58.997Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
......
......@@ -8,7 +8,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-06-08T17:29:49.562Z",
"time": "2017-06-09T10:18:58.997Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment