1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- /**
- * @Name
- * @Description
- * @Author 刘学玺
- * @Date 2024/8/22 18:17
- */
- namespace App\Http\Services\Backend\Server\System;
- use App\Exceptions\ApiException;
- use App\Http\Services\Backend\Server\System\Captcha\BlockPuzzleService;
- use App\Http\Services\Service;
- use Symfony\Component\HttpFoundation\Response;
- class CaptchaService extends Service
- {
- /**
- * @throws ApiException
- */
- public function get($params)
- {
- is_null($params) && self::error('MENU_EXISTS_CHILDREN', Response::HTTP_UNPROCESSABLE_ENTITY);
- empty($params['captchaType']) && self::error('MENU_EXISTS_CHILDREN', Response::HTTP_UNPROCESSABLE_ENTITY);
- $this->getService($params['captchaType'])->get($params);
- }
- protected function getService(String $captchaType) {
- // return (CaptchaService)CaptchaServiceFactory.instances.get(captchaType);
- return match ($captchaType) {
- 'blockPuzzle' => new BlockPuzzleService()
- };
- }
- }
|