feat: [juil] 건설PMIS 날씨 위젯 WeatherService API 연동

- 기존 대시보드 WeatherService를 활용한 JSON API 추가
- React 날씨 위젯에서 /juil/construction-pmis/weather 호출
- 기상청 API 기반 오늘/내일 날씨, 기온, 강수확률 표시
- Blade weather-icon과 동일한 SVG 아이콘 React 컴포넌트 구현
This commit is contained in:
김보곤
2026-03-12 11:09:06 +09:00
parent e499e2eb83
commit 85c1a8acbe
3 changed files with 116 additions and 39 deletions

View File

@@ -3,6 +3,8 @@
namespace App\Http\Controllers\Juil;
use App\Http\Controllers\Controller;
use App\Services\WeatherService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\View\View;
@@ -44,4 +46,11 @@ public function constructionPmis(Request $request): View|Response
return view('juil.construction-pmis');
}
public function pmisWeather(WeatherService $weatherService): JsonResponse
{
$forecasts = $weatherService->getWeeklyForecast();
return response()->json(['forecasts' => array_slice($forecasts, 0, 2)]);
}
}