123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace App\Http\Services\V1;
- use App\Generated\V1\Messages\UserHome\GetPopularityMessage;
- use App\Generated\V1\Messages\UserHome\GetVisitorListMessage;
- use App\Generated\V1\Messages\UserHome\GetLikeMeListMessage;
- use App\Generated\V1\Messages\UserHome\GetMyLikeListMessage;
- use App\Generated\V1\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']
- );
- }
- }
|