123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?php
- namespace App\Http\Controllers\V2_17_3\Friends;
- use App\Http\Controllers\Controller;
- use App\Http\Controllers\Core\Auth;
- use App\Managers\FriendManager;
- use Illuminate\Http\Request;
- class FriendController extends Controller
- {
- public function getListCnt()
- {
- $uid = Auth::auth();
- $fs = new FriendManager();
- $data = $fs->getUnreadCount($uid);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- public function overview()
- {
- $uid = Auth::auth();
- $data = null;
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 获取好友列表
- * @param Request $request
- * @return array
- */
- public function getAllList(Request $request)
- {
- $uid = Auth::auth();
- $pages = array(
- 'limit' => 20,
- 'page' => $request->get('page', 1)
- );
- $fs = new FriendManager();
- $data = $fs->getAllList($uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 获取相互喜欢好友列表
- * @param Request $request
- * @return array
- * @deprecated Friend/GetEachLikeList
- */
- public function getEachLikeList(Request $request)
- {
- $uid = Auth::auth();
- $pages = array(
- 'limit' => 20,
- 'page' => $request->get('page', 1)
- );
- $fs = new FriendManager();
- $data = $fs->getEachLikeList($uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * @param Request $request
- * @return array
- * @deprecated Friend/GetStarList
- */
- public function getStarList(Request $request)
- {
- $uid = Auth::auth();
- $pages = array(
- 'limit' => 20,
- 'page' => $request->get('page', 1)
- );
- $fs = new FriendManager();
- $data = $fs->getStarList($uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 好友交互历史
- * @param int $friend_uid
- * @param Request $request
- * @return array
- * @deprecated Friend/GetChatHistory
- */
- public function getHistory(int $friend_uid, Request $request)
- {
- $uid = Auth::auth();
- $pages = array(
- 'limit' => 1000,
- 'page' => $request->get('page', 1)
- );
- $fs = new FriendManager();
- $data = $fs->getHistory($uid, $friend_uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- }
|