interface for vehicle

This commit is contained in:
unknown 2023-08-19 13:30:28 +08:00
parent 84adb688b8
commit 2d2f14a132
7 changed files with 93 additions and 11 deletions

View File

@ -60,10 +60,4 @@ class GpsController extends BaseApiController
return $this->fail($result['msg']);
}
}
public function test() {
$res = push_message('170976fa8b98aae6535','这是条测试信息');
dump($res);
return !($res['code'] == 0);
}
}

View File

@ -17,8 +17,8 @@ namespace app\api\controller;
use app\api\logic\LogisticsLogic;
/**
* 文章管理
* Class ArticleController
* 物流管理
* Class LogisticsController
* @package app\api\controller
*/
class LogisticsController extends BaseApiController

View File

@ -0,0 +1,28 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\api\controller;
use app\api\logic\LogisticsLogic;
use app\api\logic\VehicleLogic;
/**
* 车辆管理
* Class VehicleController
* @package app\api\controller
*/
class VehicleController extends BaseApiController
{
public array $notNeedLogin = [''];
}

View File

@ -38,6 +38,11 @@ class InitMiddleware
{
//获取控制器
try {
// $local_ip = $_SERVER['SERVER_ADDR'];
// $request_id = $request->ip();
// if($local_ip !== $request_id){
// return false;
// }
$controller = str_replace('.', '\\', $request->controller());
$controller = '\\app\\api\\controller\\' . $controller . 'Controller';
$controllerClass = invoke($controller);

View File

@ -0,0 +1,29 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\api\logic;
use app\common\logic\BaseLogic;
use app\common\model\vehicle\Vehicle;
/**
* 车辆逻辑
* Class VehicleLogic
* @package app\api\logic
*/
class VehicleLogic extends BaseLogic
{
}

View File

@ -28,5 +28,3 @@ Route::rule('userMessage','Logistics/sendMessageToApp','get');
Route::rule('getCarInfo','Gps/getCarInfo','get');
Route::rule('getCarStatus','Gps/getCarStatus','get');
Route::rule('getCarHistory','Gps/getCarHistory','get');
Route::rule('test','Gps/test','get');

View File

@ -339,3 +339,31 @@ function push_message($reg_id,$message){
return ['code'=>0,'msg'=>$e->getMessage(),'data'=>[]];
}
}
/**
* 校验日期格式是否正确
*
* @param string $date 日期
* @param string $formats 需要检验的格式数组
* @return boolean
*/
function checkDateIsValid($date, $formats = array("Y-m-d")) {
$unixTime = strtotime($date);
if (!$unixTime) {
return false;
}
//校验日期的有效性只要满足其中一个格式就OK
foreach ($formats as $format) {
if (date($format, $unixTime) == $date) {
return true;
}
}
return false;
}