1 <?php
2 3 4 5 6 7 8 9 10
11
12 MainFactory::load_class('HttpApiV2Controller');
13
14 15 16 17 18 19 20 21 22
23 class DefaultApiV2Controller extends HttpApiV2Controller
24 {
25 public function get()
26 {
27 $this->_returnHelpResponse();
28 }
29
30
31 public function post()
32 {
33 $this->_returnHelpResponse();
34 }
35
36
37 public function put()
38 {
39 $this->_returnHelpResponse();
40 }
41
42
43 public function patch()
44 {
45 $this->_returnHelpResponse();
46 }
47
48
49 public function delete()
50 {
51 $this->_returnHelpResponse();
52 }
53
54
55 public function head()
56 {
57 $this->_returnHelpResponse();
58 }
59
60
61 public function options()
62 {
63 $this->_returnHelpResponse();
64 }
65
66
67 protected function _returnHelpResponse()
68 {
69 $apiUrl = GM_HTTP_SERVER . $this->api->request->getRootUri() . '/v2/';
70
71 $response = array(
72 'addresses' => $apiUrl . 'addresses',
73 'attachments' => $apiUrl . 'attachments',
74 'categories' => $apiUrl . 'categories',
75 'category_images' => $apiUrl . 'category_images',
76 'category_icons' => $apiUrl . 'category_icons',
77 'countries' => $apiUrl . 'countries',
78 'customers' => $apiUrl . 'customers',
79 'emails' => $apiUrl . 'emails',
80 'orders' => $apiUrl . 'orders',
81 'product_images' => $apiUrl . 'product_images',
82 'products' => $apiUrl . 'products',
83 'zones' => $apiUrl . 'zones',
84 );
85
86 $this->_writeResponse($response);
87 }
88 }