mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-06 23:46:18 +00:00
Add a test API to push messages to current user context
This permits to test easily some usecases. It should be disabled at release.
This commit is contained in:
parent
f8e3b4bfe1
commit
fdcb6b4f14
@ -43,7 +43,7 @@ $application->registerRoutes($this, array('routes' => array(
|
||||
array('name' => 'api#fetch_messages_count', 'url' => '/api/v2/messages/count', 'verb' => 'GET'), // Android APIv2
|
||||
|
||||
// Android API v3
|
||||
// @TODO
|
||||
array('name' => 'api#generate_sms_test_data', 'url' => '/api/v3/test/generate_sms_data', 'verb' => 'POST'), // Android APIv3
|
||||
|
||||
// Android API v4
|
||||
// @TODO future calls to sending calls recorded on the phone
|
||||
|
@ -229,4 +229,25 @@ class ApiController extends Controller {
|
||||
// @TODO
|
||||
return new JSONResponse(array("messages" => array()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @param $smsCount
|
||||
* @param $smsDatas
|
||||
* @return JSONResponse
|
||||
*
|
||||
* produce a bunch of data to test application
|
||||
*/
|
||||
public function generateSmsTestData () {
|
||||
return $this->push(2, array(
|
||||
array("_id" => 702, "type" => 1, "mbox" => 0, "read" => "true",
|
||||
"seen" => "true", "date" => 1654777777, "address" => "+33123456789",
|
||||
"body" => "hello dude"),
|
||||
array("_id" => 685, "type" => 1, "mbox" => 1, "read" => "true",
|
||||
"seen" => "true", "date" => 1654777777, "address" => "+33123456789",
|
||||
"body" => "😀🌍⭐🌎🌔🌒🐕🍖🥂🍻🎮🤸♂️🚇🈲❕📘📚📈🇸🇨🇮🇲"),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user