aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/access_links_controller.rb14
-rw-r--r--app/controllers/api/v1/access_points_controller.rb13
-rw-r--r--app/controllers/api/v1/group_of_lines_controller.rb12
3 files changed, 39 insertions, 0 deletions
diff --git a/app/controllers/api/v1/access_links_controller.rb b/app/controllers/api/v1/access_links_controller.rb
new file mode 100644
index 000000000..1b9c98538
--- /dev/null
+++ b/app/controllers/api/v1/access_links_controller.rb
@@ -0,0 +1,14 @@
+class Api::V1::AccessLinksController < Api::V1::ChouetteController
+
+ defaults :resource_class => Chouette::AccessLink, :finder => :find_by_objectid!
+
+protected
+
+ def collection
+ @access_links ||= ( @referential ? @referential.access_links.search(params[:q]).result(:distinct => true) : [])
+
+ end
+
+end
+
+
diff --git a/app/controllers/api/v1/access_points_controller.rb b/app/controllers/api/v1/access_points_controller.rb
new file mode 100644
index 000000000..4c3f5adc0
--- /dev/null
+++ b/app/controllers/api/v1/access_points_controller.rb
@@ -0,0 +1,13 @@
+class Api::V1::AccessPointsController < Api::V1::ChouetteController
+
+ defaults :resource_class => Chouette::AccessPoint, :finder => :find_by_objectid!
+
+protected
+
+ def collection
+ @access_points ||= ( @referential ? @referential.access_points.search(params[:q]).result(:distinct => true) : [])
+
+ end
+
+end
+
diff --git a/app/controllers/api/v1/group_of_lines_controller.rb b/app/controllers/api/v1/group_of_lines_controller.rb
new file mode 100644
index 000000000..b3760e1b0
--- /dev/null
+++ b/app/controllers/api/v1/group_of_lines_controller.rb
@@ -0,0 +1,12 @@
+class Api::V1::GroupOfLinesController < Api::V1::ChouetteController
+
+ defaults :resource_class => Chouette::GroupOfLine, :finder => :find_by_objectid!
+
+protected
+
+ def collection
+ @group_of_lines ||= ( @referential ? @referential.group_of_lines.search(params[:q]).result(:distinct => true) : [])
+
+ end
+
+end \ No newline at end of file