|
|
@@ -4,16 +4,45 @@
|
|
|
namespace Heanup\App\Api\Controller;
|
|
|
|
|
|
|
|
|
-use Heanup\App\Api\Controller;
|
|
|
+use Heanup\App\Api\RestfulController;
|
|
|
use Heanup\Frame\Logger;
|
|
|
|
|
|
-class ReceivedSms extends Controller
|
|
|
+class ReceivedSms extends RestfulController
|
|
|
{
|
|
|
protected function main()
|
|
|
{
|
|
|
- Logger::setLog(file_get_contents("php://input"),APP_DIR . "/test_msg.txt");
|
|
|
+
|
|
|
$this->showSuccess();
|
|
|
// file_put_contents(APP_DIR . "/test_msg.txt", file_get_contents("php://input").PHP_EOL,FILE_APPEND);
|
|
|
}
|
|
|
|
|
|
+ protected function getData()
|
|
|
+ {
|
|
|
+ $data=file(APP_DIR . "/test_msg.txt");
|
|
|
+ $result=[];
|
|
|
+ foreach ($data as $datum) {
|
|
|
+ $temp=explode("$$$", $datum);
|
|
|
+ $result[]=[
|
|
|
+ 'from'=>$temp[1],
|
|
|
+ 'to'=>$temp[2],
|
|
|
+ 'msg'=>$temp[0]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $this->showSuccess($result);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function postData()
|
|
|
+ {
|
|
|
+ Logger::setLog(file_get_contents("php://input"),APP_DIR . "/test_msg.txt");
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function putData()
|
|
|
+ {
|
|
|
+ // TODO: Implement putData() method.
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function deleteData()
|
|
|
+ {
|
|
|
+ // TODO: Implement deleteData() method.
|
|
|
+ }
|
|
|
}
|