searchLog($this->userId); return $this->success('',$result); } /** * @notes 首页信息 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author ljj * @date 2022/2/23 4:49 下午 */ public function index() { $get = $this->request->get(); $result = (new IndexLogic())->index($get); return $this->success('',$result); } /** * @notes 首页访客记录 * @author Tab * @date 2021/9/11 9:16 */ public function visit() { $result = IndexLogic::visit(); if ($result) { return $this->success(''); } return $this->fail(IndexLogic::getError(), [], 0, 0); } /** * @notes 地址解析(地址转坐标) * @return \think\response\Json * @author ljj * @date 2022/10/13 12:06 下午 * 本接口提供由文字地址到经纬度的转换能力,并同时提供结构化的省市区地址信息。 */ public function geocoder() { $get = $this->request->get(); if (!isset($get['address']) || $get['address'] == '') { return $this->fail('地址缺失'); } $result = IndexLogic::geocoder($get); if ($result['status'] !== 0) { return $this->fail($result['message']); } return $this->success('',$result); } /** * @notes 逆地址解析(坐标位置描述) * @return \think\response\Json * @author ljj * @date 2022/10/13 2:44 下午 * 本接口提供由经纬度到文字地址及相关位置信息的转换能力 */ public function geocoderCoordinate() { $get = $this->request->get(); if (!isset($get['location']) || $get['location'] == '') { return $this->fail('经纬度缺失'); } $result = IndexLogic::geocoderCoordinate($get); if ($result['status'] !== 0) { return $this->fail($result['message']); } return $this->success('',$result); } /** * @notes 搜索附近地址 * @return \think\response\Json * @author ljj * @date 2024/7/23 上午11:21 */ public function getNearbyLocation() { $params = $this->request->get(); $result = (new IndexLogic())->getNearbyLocation($params); if ($result['status'] !== 0) { return $this->fail($result['message']); } return $this->success('',$result); } /** * @notes 获取当前位置最近的城市 * @return \think\response\Json * @author cjhao * @date 2024/9/3 17:34 */ public function getNearbyCity() { $params = $this->request->get(); $result = (new IndexLogic())->getNearbyCity($params); if(false === $result){ return $this->fail(IndexLogic::getError()); } return $this->success('',$result); } /** * @notes 获取首页的服务列表 * @return \think\response\Json * @author cjhao * @date 2024/9/3 23:01 */ public function serverLists() { return $this->dataLists((new IndexServerLists())); } /** * @notes 收藏接口 * @return \think\response\Json * @author cjhao * @date 2024/9/5 09:32 */ public function collect() { $params = $this->request->post(); (new IndexLogic())->collect($params,$this->userId); return $this->success('操作成功'); } }