1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace App\Http\Services\V1_1;
- use App\Generated\V1_1\Messages\UserNotice\SysnoticeListMessage;
- use App\Generated\V1_1\Messages\UserNotice\SysnoticeDescMessage;
- use App\Http\Controllers\Controller;
- use App\Http\Controllers\Core\Auth;
- use App\Managers\UserNoticeManager;
- use App\Models\QQ\FormIdModel;
- use App\Models\User\AuthKey;
- use App\Models\User\Openid;
- use App\Services\User\NoticeService;
- use App\Services\Vendor\GeTui\ApiService;
- use Illuminate\Http\Request;
- class UserNoticeService
- {
- protected $userNoticeManager;
- public function __construct(UserNoticeManager $userNoticeManager)
- {
- $this->userNoticeManager = $userNoticeManager;
- }
- public function sysnoticeList(SysnoticeListMessage $message)
- {
- $page = $message->getPage() ?: 1;
- $unread = $message->getUnread() ?: 0;
- $uid = Auth::auth();
- $pages = array(
- 'page' => $page,
- 'limit' => 20
- );
- $data = $this->userNoticeManager->systemList($uid, $pages, $unread);
- if ($pages['page'] == 1) {
- $likemeOverView = $this->userNoticeManager->likeMeOverView($uid);
- $inviteOverView = $this->userNoticeManager->inviteOverView($uid);
- }
- $message->setResponse([
- 'likeme_overview' => $likemeOverView ?? null,
- 'invite_overview' => $inviteOverView ?? null,
- 'system' => $data
- ]);
- }
- public function sysnoticeDesc(SysnoticeDescMessage $message)
- {
- $uid = Auth::auth();
- $data = $this->userNoticeManager->systemListDesc($uid);
- $message->setResponse($data);
- }
- }
|