Add dummy location support API #147

This commit is contained in:
Kendrick Chan 2018-06-17 11:23:06 +08:00
parent a9efe274e3
commit 3f616a8283
2 changed files with 27 additions and 0 deletions

View file

@ -114,3 +114,8 @@ api_resend_code:
path: /api/resend_code
controller: App\Controller\APIController:resendCode
methods: [POST]
api_location_support:
path: /api/location_support
controller: App\Controller\APIController:locationSupport
methods: [GET]

View file

@ -1477,4 +1477,26 @@ class APIController extends Controller
return $res->getReturnResponse();
}
public function locationSupport(Request $req)
{
$required_params = [
'longitude',
'latitude',
];
$em = $this->getDoctrine()->getManager();
$res = $this->checkParamsAndKey($req, $em, $required_params);
if ($res->isError())
return $res->getReturnResponse();
$data = [
'longitude' => $req->query->get('longitude'),
'latitude' => $req->query->get('latitude'),
'supported' => true,
];
$res->setData($data);
return $res->getReturnResponse();
}
}