feat: 대시보드 API 및 FCM 푸시 알림 API 구현
Dashboard API: - DashboardController, DashboardService 추가 - /dashboard/summary, /charts, /approvals 엔드포인트 Push Notification API: - FCM 토큰 관리 (등록/해제/목록) - 알림 설정 관리 (유형별 on/off, 알림음 설정) - 알림 유형: deposit, withdrawal, order, approval, attendance, notice, system - 알림음: default, deposit, withdrawal, order, approval, urgent - PushDeviceToken, PushNotificationSetting 모델 - Swagger 문서 추가
This commit is contained in:
43
app/Http/Requests/Push/RegisterTokenRequest.php
Normal file
43
app/Http/Requests/Push/RegisterTokenRequest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Push;
|
||||
|
||||
use App\Models\PushDeviceToken;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class RegisterTokenRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'token' => ['required', 'string', 'min:10'],
|
||||
'platform' => [
|
||||
'required',
|
||||
'string',
|
||||
Rule::in([
|
||||
PushDeviceToken::PLATFORM_IOS,
|
||||
PushDeviceToken::PLATFORM_ANDROID,
|
||||
PushDeviceToken::PLATFORM_WEB,
|
||||
]),
|
||||
],
|
||||
'device_name' => ['nullable', 'string', 'max:255'],
|
||||
'app_version' => ['nullable', 'string', 'max:50'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'token.required' => __('error.push.token_required'),
|
||||
'token.min' => __('error.push.token_invalid'),
|
||||
'platform.required' => __('error.push.platform_required'),
|
||||
'platform.in' => __('error.push.platform_invalid'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user