feat(arc): 新增根据IMEI获取ARC设备信息接口
- 完善 api/model/Arc.php 模型配置 - 新增 api/controller/Arc.php getByImei 方法 - 支持 GET/POST 参数 imei 查询设备码信息 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,13 +74,27 @@ class Arc extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除指定资源
|
* 根据IMEI获取ARC设备信息
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param \think\Request $request
|
||||||
* @return \think\Response
|
* @return \think\Response
|
||||||
*/
|
*/
|
||||||
public function delete($id)
|
public function getByImei(Request $request)
|
||||||
{
|
{
|
||||||
//
|
$imei = $request->param('imei');
|
||||||
|
|
||||||
|
if (empty($imei)) {
|
||||||
|
return json(['code' => 400, 'msg' => 'IMEI参数不能为空', 'data' => null]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$arc = \app\api\model\Arc::where('imei', $imei)
|
||||||
|
->field('id, imei, app_id, sdk_key, active_key')
|
||||||
|
->find();
|
||||||
|
|
||||||
|
if (!$arc) {
|
||||||
|
return json(['code' => 404, 'msg' => '未找到对应设备信息', 'data' => null]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return json(['code' => 200, 'msg' => '获取成功', 'data' => $arc]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,19 @@ use think\Model;
|
|||||||
|
|
||||||
class Arc extends Model
|
class Arc extends Model
|
||||||
{
|
{
|
||||||
//
|
/**
|
||||||
|
* ARC设备模型
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'arc';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'datetime';
|
||||||
|
protected $dateFormat = 'Y-m-d H:i:s';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user