2025-12-18 15:31:59 +09:00
|
|
|
<?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()
|
|
|
|
|
{
|
2026-03-09 11:21:20 +09:00
|
|
|
return ApiResponse::handle(function () {
|
|
|
|
|
return $this->barobillService->getSetting();
|
|
|
|
|
}, __('message.fetched'));
|
2025-12-18 15:31:59 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 바로빌 설정 저장
|
|
|
|
|
*/
|
|
|
|
|
public function save(SaveBarobillSettingRequest $request)
|
|
|
|
|
{
|
2026-03-09 11:21:20 +09:00
|
|
|
return ApiResponse::handle(function () use ($request) {
|
|
|
|
|
return $this->barobillService->saveSetting($request->validated());
|
|
|
|
|
}, __('message.saved'));
|
2025-12-18 15:31:59 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 연동 테스트
|
|
|
|
|
*/
|
|
|
|
|
public function testConnection()
|
|
|
|
|
{
|
2026-03-09 11:21:20 +09:00
|
|
|
return ApiResponse::handle(function () {
|
|
|
|
|
return $this->barobillService->testConnection();
|
|
|
|
|
}, __('message.barobill.connection_success'));
|
2025-12-18 15:31:59 +09:00
|
|
|
}
|
|
|
|
|
}
|