| xqd
@@ -4,6 +4,7 @@
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
|
|
|
|
|
+use App\Services\DynamicService;
|
|
|
use App\Services\GeohashService;
|
|
|
use App\Services\HomeService;
|
|
|
use App\Services\RedisService;
|
| xqd
@@ -31,9 +32,9 @@ class HomeController extends Controller
|
|
|
if(!isset($request->longitude) || $request->longitude==""){
|
|
|
throw new Exception("参数错误");
|
|
|
}
|
|
|
- if(!isset($request->uniqueID) || $request->uniqueID==""){
|
|
|
- throw new Exception("参数错误");
|
|
|
- }
|
|
|
+// if(!isset($request->uniqueID) || $request->uniqueID==""){
|
|
|
+// throw new Exception("参数错误");
|
|
|
+// }
|
|
|
$user = auth('api')->user();
|
|
|
if(!$user){
|
|
|
RedisService::redis()->SETEX('user_location_' . $request->uniqueID, 600, json_encode(['latitude' => $request->latitude, 'longitude' => $request->longitude]));
|
| xqd
@@ -64,6 +65,12 @@ class HomeController extends Controller
|
|
|
return response()->json($res);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户详情
|
|
|
+ * @param Request $request
|
|
|
+ * @return \Illuminate\Http\JsonResponse|void
|
|
|
+ */
|
|
|
public function user_detail(Request $request){
|
|
|
try {
|
|
|
$res = $this->homeService->user_detail($request->user_id);
|
| xqd
@@ -73,5 +80,26 @@ class HomeController extends Controller
|
|
|
return response()->json($res);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户动态
|
|
|
+ * @param Request $request
|
|
|
+ * @return \Illuminate\Http\JsonResponse|void
|
|
|
+ */
|
|
|
+ public function user_dynamic(Request $request){
|
|
|
+ try {
|
|
|
+ $where = array();
|
|
|
+ $where['type'] = $request->post('type',1); //类型 type 1全部 2关注 3附近
|
|
|
+ $where['look_type'] =$request->post('look_type',3);//查看类型 type 1只看男士 2只看女士 3全部
|
|
|
+ $where['tag_id'] =$request->post('tag_id',0); //话题标签
|
|
|
+ $where['user_id'] =$request->user_id;
|
|
|
+ $dynamicService = new DynamicService();
|
|
|
+ $res = $dynamicService->dynamic_list($where);
|
|
|
+ }catch (\Exception $exception){
|
|
|
+ return $this->response->errorForbidden($exception->getMessage());
|
|
|
+ }
|
|
|
+ return response()->json($res);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|