提交其他文件
This commit is contained in:
57
app/api/controller/CommonController.php
Normal file
57
app/api/controller/CommonController.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
use app\api\logic\CommonLogic;
|
||||
use app\api\validate\CommonValidate;
|
||||
class CommonController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['get7Time','cityAddress','speaker','qrcode','ce_ttlock'];
|
||||
/**
|
||||
* @notes 获取时间查询
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/10/20 17:02
|
||||
*/
|
||||
public function get7Time(){
|
||||
$params = (new CommonValidate())->post()->goCheck('addGroup');
|
||||
$result = CommonLogic::get7Time($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(CommonLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 城市解析
|
||||
* @return \think\response\Json
|
||||
* @author 胥聪
|
||||
* @date 2025/11/29 16:30
|
||||
*/
|
||||
public function cityAddress(){
|
||||
$data = $this->request->post();
|
||||
$result = CommonLogic::getCityAddress($data);
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
|
||||
public function speaker(){
|
||||
$result = CommonLogic::speaker();
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
|
||||
public function qrcode(){
|
||||
$result = CommonLogic::qrcode();
|
||||
return $this->success('查询成功', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \think\response\Json
|
||||
* 用户门锁控制
|
||||
*/
|
||||
public function ce_ttlock(){
|
||||
$data = $this->request->post();
|
||||
$result = CommonLogic::ce_ttlock($data);
|
||||
if ($result === false) {
|
||||
return $this->fail(CommonLogic::getError());
|
||||
}
|
||||
return $this->success('', [], 1, 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user