- BarobillSettingController: show/save/testConnection 클로저 방식 전환 - TaxInvoiceController: 전체 액션(index/show/store/update/destroy/issue/bulkIssue/cancel/checkStatus/summary) 클로저 방식 전환 - 중간 변수 할당 제거, 일관된 응답 패턴 적용 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
use App\Helpers\ApiResponse;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\BarobillSetting\SaveBarobillSettingRequest;
|
|
use App\Services\BarobillService;
|
|
|
|
class BarobillSettingController extends Controller
|
|
{
|
|
public function __construct(
|
|
private BarobillService $barobillService
|
|
) {}
|
|
|
|
/**
|
|
* 바로빌 설정 조회
|
|
*/
|
|
public function show()
|
|
{
|
|
return ApiResponse::handle(function () {
|
|
return $this->barobillService->getSetting();
|
|
}, __('message.fetched'));
|
|
}
|
|
|
|
/**
|
|
* 바로빌 설정 저장
|
|
*/
|
|
public function save(SaveBarobillSettingRequest $request)
|
|
{
|
|
return ApiResponse::handle(function () use ($request) {
|
|
return $this->barobillService->saveSetting($request->validated());
|
|
}, __('message.saved'));
|
|
}
|
|
|
|
/**
|
|
* 연동 테스트
|
|
*/
|
|
public function testConnection()
|
|
{
|
|
return ApiResponse::handle(function () {
|
|
return $this->barobillService->testConnection();
|
|
}, __('message.barobill.connection_success'));
|
|
}
|
|
}
|