chore(payment): NHN KCP와 NICE 결제 플러그인 개발 브랜치 분리
정식 develop에서는 기본 번들 정책에 따라 제거된 결제 플러그인을 별도 개발 브랜치에서 계속 유지보수할 수 있도록 복원한다.
This commit is contained in:
1 parent
49b21e788c
commit
657f546efc
651 files changed
+49118
-20476
No files matched your search
@@ -187,7 +187,7 @@ class AdminTemplateAssetController extends AdminBaseController
|
||||
/**
|
||||
* 편집기 프리뷰 전용 CSS 서빙 — 다크 셀렉터를 프리뷰 마커로 치환.
|
||||
*
|
||||
* 관리자 admin 환경이 다크 테마면 `<html class="dark">` 가 조상으로 남아, 프리뷰
|
||||
* PO admin 환경이 다크 테마면 `<html class="dark">` 가 조상으로 남아, 프리뷰
|
||||
* 프레임에서 `.dark` 를 빼도(라이트 토글) Tailwind `.dark &` 가 활성돼 프리뷰가
|
||||
* 라이트로 격리되지 않는다. 이를 해소하기 위해, 편집기 진입 시에만 components.css 의
|
||||
* 다크 조상 셀렉터(`.dark`)를 프리뷰 전용 마커(`.g7le-preview-dark`)로 치환해 서빙한다.
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Api\Admin;
|
||||
|
||||
use App\Http\Controllers\Api\Base\AdminBaseController;
|
||||
use App\Http\Requests\Settings\RegenerateAppKeyRequest;
|
||||
use App\Http\Requests\Settings\RestoreSettingsRequest;
|
||||
use App\Http\Requests\Settings\SaveSettingsRequest;
|
||||
use App\Http\Requests\Settings\TestDriverConnectionRequest;
|
||||
use App\Http\Requests\Settings\TestMailRequest;
|
||||
@@ -14,7 +13,7 @@ use App\Services\DriverConnectionTester;
|
||||
use App\Services\DriverRegistryService;
|
||||
use App\Services\SettingsService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
/**
|
||||
@@ -138,9 +137,7 @@ class SettingsController extends AdminBaseController
|
||||
$systemInfo = $this->settingsService->getSystemInfo();
|
||||
|
||||
return $this->success('common.success', $systemInfo);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('시스템 정보 조회 실패', ['error' => $e->getMessage()]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->error('common.error_occurred', 500, $e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -267,13 +264,16 @@ class SettingsController extends AdminBaseController
|
||||
/**
|
||||
* 백업에서 설정을 복원합니다.
|
||||
*
|
||||
* @param RestoreSettingsRequest $request 복원 요청 데이터 (백업 경로)
|
||||
* @return JsonResponse 복원 결과 JSON 응답
|
||||
*/
|
||||
public function restore(RestoreSettingsRequest $request): JsonResponse
|
||||
public function restore(Request $request): JsonResponse
|
||||
{
|
||||
try {
|
||||
$backupPath = $request->validated('backup_path');
|
||||
$backupPath = $request->input('backup_path');
|
||||
|
||||
if (empty($backupPath)) {
|
||||
return $this->error('settings.backup_path_required', 422);
|
||||
}
|
||||
|
||||
$result = $this->settingsService->restoreSettings($backupPath);
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Api\Base;
|
||||
|
||||
use App\Helpers\ResponseHelper;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -21,11 +20,11 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* 성공 응답을 생성합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param mixed $data 응답 데이터
|
||||
* @param int $statusCode HTTP 상태 코드
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param mixed $data 응답 데이터
|
||||
* @param int $statusCode HTTP 상태 코드
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function success(
|
||||
string $messageKey = 'common.success',
|
||||
@@ -39,11 +38,11 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* 실패 응답을 생성합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param int $statusCode HTTP 상태 코드
|
||||
* @param mixed $errors 오류 정보
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param int $statusCode HTTP 상태 코드
|
||||
* @param mixed $errors 오류 정보
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function error(
|
||||
string $messageKey = 'common.failed',
|
||||
@@ -57,11 +56,11 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* 리소스와 함께 성공 응답을 생성합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param mixed $resource JSON 리소스
|
||||
* @param int $statusCode HTTP 상태 코드
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param mixed $resource JSON 리소스
|
||||
* @param int $statusCode HTTP 상태 코드
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function successWithResource(
|
||||
string $messageKey = 'common.success',
|
||||
@@ -75,7 +74,7 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* 현재 인증된 사용자를 반환합니다.
|
||||
*
|
||||
* @return User|null
|
||||
* @return \App\Models\User|null
|
||||
*/
|
||||
protected function getCurrentUser()
|
||||
{
|
||||
@@ -85,9 +84,9 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* Not Found 응답을 생성합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function notFound(
|
||||
string $messageKey = 'common.not_found',
|
||||
@@ -99,9 +98,9 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* Unauthorized 응답을 생성합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function unauthorized(
|
||||
string $messageKey = 'common.unauthorized',
|
||||
@@ -113,9 +112,9 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* Forbidden 응답을 생성합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function forbidden(
|
||||
string $messageKey = 'common.forbidden',
|
||||
@@ -127,10 +126,10 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* Validation Error 응답을 생성합니다.
|
||||
*
|
||||
* @param mixed $errors 검증 오류
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse
|
||||
* @param mixed $errors 검증 오류
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function validationError(
|
||||
mixed $errors,
|
||||
@@ -143,9 +142,9 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* 파일 응답을 반환합니다 (ETag 및 캐싱 헤더 포함).
|
||||
*
|
||||
* @param string $filePath 파일 경로
|
||||
* @param string $mimeType MIME 타입
|
||||
* @param int $maxAge 캐시 유지 시간 (초, 기본: 1년)
|
||||
* @param string $filePath 파일 경로
|
||||
* @param string $mimeType MIME 타입
|
||||
* @param int $maxAge 캐시 유지 시간 (초, 기본: 1년)
|
||||
*/
|
||||
protected function fileResponse(string $filePath, string $mimeType, int $maxAge = 31536000): BinaryFileResponse|Response
|
||||
{
|
||||
@@ -177,35 +176,35 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* JSON 응답을 반환합니다 (캐싱 헤더 포함).
|
||||
*
|
||||
* @param mixed $data JSON으로 변환할 데이터
|
||||
* @param int $maxAge 캐시 유지 시간 (초, 기본: 1시간)
|
||||
* @param int $status HTTP 상태 코드
|
||||
* @param mixed $data JSON으로 변환할 데이터
|
||||
* @param int $maxAge 캐시 유지 시간 (초, 기본: 1시간)
|
||||
* @param int $status HTTP 상태 코드
|
||||
* @return JsonResponse JSON 응답
|
||||
*/
|
||||
protected function cachedJsonResponse(mixed $data, int $maxAge = 3600, int $status = 200): JsonResponse
|
||||
{
|
||||
return response()->json($data, $status, [
|
||||
'Cache-Control' => "public, max-age={$maxAge}",
|
||||
], ResponseHelper::JSON_ENCODE_OPTIONS);
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* ETag를 생성합니다.
|
||||
*
|
||||
* @param mixed $data 해시할 데이터
|
||||
* @param mixed $data 해시할 데이터
|
||||
* @return string ETag 값 (따옴표 포함)
|
||||
*/
|
||||
protected function generateETag(mixed $data): string
|
||||
{
|
||||
$content = is_string($data) ? $data : json_encode($data);
|
||||
|
||||
return '"'.md5($content).'"';
|
||||
return '"' . md5($content) . '"';
|
||||
}
|
||||
|
||||
/**
|
||||
* 클라이언트 캐시가 유효한지 확인합니다.
|
||||
*
|
||||
* @param string $etag 현재 ETag 값
|
||||
* @param string $etag 현재 ETag 값
|
||||
* @return bool 캐시가 유효하면 true
|
||||
*/
|
||||
protected function isNotModified(string $etag): bool
|
||||
@@ -218,8 +217,8 @@ abstract class BaseApiController extends Controller
|
||||
/**
|
||||
* 304 Not Modified 응답을 반환합니다.
|
||||
*
|
||||
* @param string $etag ETag 값
|
||||
* @param int $maxAge 캐시 TTL (초)
|
||||
* @param string $etag ETag 값
|
||||
* @param int $maxAge 캐시 TTL (초)
|
||||
* @return Response 304 응답
|
||||
*/
|
||||
protected function notModifiedResponse(string $etag, int $maxAge = 3600): Response
|
||||
@@ -234,10 +233,10 @@ abstract class BaseApiController extends Controller
|
||||
*
|
||||
* 클라이언트의 ETag가 일치하면 304 Not Modified를 반환합니다.
|
||||
*
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param mixed $data 응답 데이터
|
||||
* @param int $maxAge 캐시 TTL (초, 기본: 1시간)
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @param string $messageKey 메시지 키
|
||||
* @param mixed $data 응답 데이터
|
||||
* @param int $maxAge 캐시 TTL (초, 기본: 1시간)
|
||||
* @param array $messageParams 메시지 매개변수
|
||||
* @return JsonResponse|Response JSON 응답 또는 304 응답
|
||||
*/
|
||||
protected function successWithCache(
|
||||
@@ -257,7 +256,7 @@ abstract class BaseApiController extends Controller
|
||||
'success' => true,
|
||||
'message' => __($messageKey, $messageParams),
|
||||
'data' => $data,
|
||||
], 200, [], ResponseHelper::JSON_ENCODE_OPTIONS)
|
||||
])
|
||||
->header('ETag', $etag)
|
||||
->header('Cache-Control', "public, max-age={$maxAge}")
|
||||
->header('Vary', 'Accept-Encoding, Accept-Language');
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Api\Public;
|
||||
|
||||
use App\Http\Controllers\Api\Base\PublicBaseController;
|
||||
use App\Http\Requests\Public\Module\ServeModuleAssetRequest;
|
||||
use App\Services\ExtensionBundleService;
|
||||
use App\Services\ModuleService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -18,54 +17,11 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
class PublicModuleController extends PublicBaseController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ModuleService $moduleService,
|
||||
private readonly ExtensionBundleService $bundleService
|
||||
private readonly ModuleService $moduleService
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 활성 모듈 프론트엔드 IIFE 병합 번들(JS)을 서빙합니다.
|
||||
*
|
||||
* 활성 global 모듈 에셋이 없으면 빈 200 응답(text/javascript)을 반환한다
|
||||
* (프론트는 빈 스크립트 로드로 무해). 그 외에는 병합 파일을 fileResponse 로
|
||||
* 서빙(ETag/304/환경별 Cache-Control 재사용).
|
||||
*
|
||||
* @return BinaryFileResponse|Response 병합 JS 파일 응답 또는 빈 응답
|
||||
*/
|
||||
public function serveBundleJs(): BinaryFileResponse|Response
|
||||
{
|
||||
$this->logApiUsage('modules.bundle', ['kind' => 'js']);
|
||||
|
||||
$version = $this->bundleService->getCurrentVersion();
|
||||
$path = $this->bundleService->getBundleFilePath('module', 'js', $version);
|
||||
|
||||
if ($path === '') {
|
||||
return response('', 200)->header('Content-Type', 'text/javascript');
|
||||
}
|
||||
|
||||
return $this->fileResponse($path, 'text/javascript', 31536000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 활성 모듈 프론트엔드 병합 번들(CSS)을 서빙합니다.
|
||||
*
|
||||
* @return BinaryFileResponse|Response 병합 CSS 파일 응답 또는 빈 응답
|
||||
*/
|
||||
public function serveBundleCss(): BinaryFileResponse|Response
|
||||
{
|
||||
$this->logApiUsage('modules.bundle', ['kind' => 'css']);
|
||||
|
||||
$version = $this->bundleService->getCurrentVersion();
|
||||
$path = $this->bundleService->getBundleFilePath('module', 'css', $version);
|
||||
|
||||
if ($path === '') {
|
||||
return response('', 200)->header('Content-Type', 'text/css');
|
||||
}
|
||||
|
||||
return $this->fileResponse($path, 'text/css', 31536000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 모듈 에셋 서빙
|
||||
*
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Api\Public;
|
||||
|
||||
use App\Http\Controllers\Api\Base\PublicBaseController;
|
||||
use App\Http\Requests\Public\Plugin\ServePluginAssetRequest;
|
||||
use App\Services\ExtensionBundleService;
|
||||
use App\Services\PluginService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -18,53 +17,11 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
class PublicPluginController extends PublicBaseController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly PluginService $pluginService,
|
||||
private readonly ExtensionBundleService $bundleService
|
||||
private readonly PluginService $pluginService
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 활성 플러그인 프론트엔드 IIFE 병합 번들(JS)을 서빙합니다.
|
||||
*
|
||||
* 활성 global 플러그인 에셋이 없으면 빈 200 응답(text/javascript)을 반환한다.
|
||||
* 그 외에는 병합 파일을 fileResponse 로 서빙(ETag/304/환경별 Cache-Control 재사용).
|
||||
*
|
||||
* @return BinaryFileResponse|Response 병합 JS 파일 응답 또는 빈 응답
|
||||
*/
|
||||
public function serveBundleJs(): BinaryFileResponse|Response
|
||||
{
|
||||
$this->logApiUsage('plugins.bundle', ['kind' => 'js']);
|
||||
|
||||
$version = $this->bundleService->getCurrentVersion();
|
||||
$path = $this->bundleService->getBundleFilePath('plugin', 'js', $version);
|
||||
|
||||
if ($path === '') {
|
||||
return response('', 200)->header('Content-Type', 'text/javascript');
|
||||
}
|
||||
|
||||
return $this->fileResponse($path, 'text/javascript', 31536000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 활성 플러그인 프론트엔드 병합 번들(CSS)을 서빙합니다.
|
||||
*
|
||||
* @return BinaryFileResponse|Response 병합 CSS 파일 응답 또는 빈 응답
|
||||
*/
|
||||
public function serveBundleCss(): BinaryFileResponse|Response
|
||||
{
|
||||
$this->logApiUsage('plugins.bundle', ['kind' => 'css']);
|
||||
|
||||
$version = $this->bundleService->getCurrentVersion();
|
||||
$path = $this->bundleService->getBundleFilePath('plugin', 'css', $version);
|
||||
|
||||
if ($path === '') {
|
||||
return response('', 200)->header('Content-Type', 'text/css');
|
||||
}
|
||||
|
||||
return $this->fileResponse($path, 'text/css', 31536000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 플러그인 에셋 서빙
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user