This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Esun\AiMascotCampaign\Controller\Adminhtml\Participant;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\Page;
use Magento\Framework\View\Result\PageFactory;
class Index extends Action
{
public const ADMIN_RESOURCE = 'Esun_AiMascotCampaign::participants';
public function __construct(Context $context, private readonly PageFactory $pageFactory)
{
parent::__construct($context);
}
public function execute(): Page
{
$page = $this->pageFactory->create();
$page->setActiveMenu(self::ADMIN_RESOURCE);
$page->getConfig()->getTitle()->prepend(__('AI Mascot Participants'));
return $page;
}
}
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace Esun\AiMascotCampaign\Controller\Register;
use Esun\AiMascotCampaign\Model\CampaignContext;
use Magento\Customer\Model\Session as CustomerSession;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\Controller\Result\Redirect;
use Magento\Framework\Controller\Result\RedirectFactory;
class Start implements HttpGetActionInterface
{
public function __construct(
private readonly CampaignContext $campaignContext,
private readonly CustomerSession $customerSession,
private readonly RedirectFactory $redirectFactory
) {
}
public function execute(): Redirect
{
if ($this->customerSession->isLoggedIn()) {
return $this->redirectFactory->create()->setPath(
'customer/account',
['_secure' => true]
);
}
$this->campaignContext->start();
return $this->redirectFactory->create()->setPath(
'customer/account/create',
['_secure' => true]
);
}
}