1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- namespace App\Http\Services\V1_1;
- use App\Generated\V1_1\Messages\UserHome\GetPopularityMessage;
- use App\Generated\V1_1\Messages\UserHome\GetVisitorListMessage;
- use App\Generated\V1_1\Messages\UserHome\GetLikeMeListMessage;
- use App\Generated\V1_1\Messages\UserHome\GetMyLikeListMessage;
- use App\Generated\V1_1\Messages\UserHome\RemindComplementCardMessage;
- use App\Http\Controllers\Core\Auth;
- use App\Managers\UserManager;
- use App\Services\Home\FeedService;
- use App\Services\User\HomeService;
- class UserHomeService
- {
- protected $userManager;
- public function __construct(UserManager $userManager)
- {
- $this->userManager = $userManager;
- }
- /**
- * 获取喜欢我的列表
- * @param GetLikeMeListMessage $message
- */
- public function getLikeMeList(GetLikeMeListMessage $message)
- {
- $uid = Auth::auth();
- $page = $message->getPage() ?? 1;
- $limit = $message->getLimit() ?? 20;
- $data = $this->userManager->getLikeMeList($uid, $page, $limit);
- $message->setResponse($data);
- }
- /**
- * 获取我喜欢的列表
- * @param GetMyLikeListMessage $message
- */
- public function getMyLikeList(GetMyLikeListMessage $message)
- {
- $uid = Auth::auth();
- $page = $message->getPage() ?? 1;
- $limit = $message->getLimit() ?? 20;
- $data = $this->userManager->getMyLikeList($uid, $page, $limit);
- $message->setResponse($data);
- }
- /**
- * 获取访客列表
- * @param GetVisitorListMessage $message
- */
- public function getVisitorList(GetVisitorListMessage $message)
- {
- $page = $message->getPage() ?? 1;
- $limit = $message->getLimit() ?? 20;
- $uid = $message->getUid() ?? Auth::auth();
- $data = $this->userManager->getVisitorList($uid, $page, $limit);
- $message->setResponse($data);
- }
- /**
- * 提醒TA补全信息
- * @param RemindComplementCardMessage $message
- */
- public function remindComplementCard(RemindComplementCardMessage $message)
- {
- $uid = Auth::auth();
- $type = $message->getType();
- $remind_uid = $message->getRemind_uid();
- $feedService = new FeedService();
- $feedService->remindType4($uid, $remind_uid, $type);
- }
- public function getPopularity(GetPopularityMessage $message)
- {
- $uid = Auth::auth();
- $hus = new HomeService();
- $data = $hus->getPopularity($uid);
- $message->setResponse(
- $data['popularity_share_end_at'],
- $data['popularity_sign_end_at'],
- $data['popularity_supvip_endat'],
- $data['popularity'],
- $data['base']
- );
- }
- }
|