From 0312f57d98e610f1956b9332f041efefb4317b05 Mon Sep 17 00:00:00 2001 From: mk Date: Mon, 23 Sep 2024 11:42:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20mock=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weather/services/forecast/mock.ts | 620 ++++++++++++++++++ src/features/weather/services/search/mock.ts | 124 ++++ 2 files changed, 744 insertions(+) create mode 100644 src/features/weather/services/forecast/mock.ts create mode 100644 src/features/weather/services/search/mock.ts diff --git a/src/features/weather/services/forecast/mock.ts b/src/features/weather/services/forecast/mock.ts new file mode 100644 index 0000000..b05f7ca --- /dev/null +++ b/src/features/weather/services/forecast/mock.ts @@ -0,0 +1,620 @@ +import { ForecastWeatherData } from "@/features/weather/models" + +export const mock = { + location: { + name: "Tokyo", + region: "Tokyo", + country: "Japan", + lat: 35.69, + lon: 139.69, + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + current: { + last_updated_epoch: 1726101000, + last_updated: "2024-09-30 09:30", + temp_c: 31.4, + temp_f: 88.5, + is_day: 1, + condition: { + text: "Partly cloudy", + icon: "//cdn.weatherapi.com/weather/64x64/day/116.png", + code: 1003, + }, + wind_mph: 2.2, + wind_kph: 3.6, + wind_degree: 196, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 30, + precip_mm: 0, + precip_in: 0, + humidity: 71, + cloud: 50, + feelslike_c: 36.9, + feelslike_f: 98.5, + windchill_c: 30.4, + windchill_f: 86.6, + heatindex_c: 34.6, + heatindex_f: 94.3, + dewpoint_c: 22.9, + dewpoint_f: 73.1, + vis_km: 10, + vis_miles: 6, + uv: 8, + gust_mph: 2.4, + gust_kph: 3.9, + }, + forecast: { + forecastday: [ + { + date: "2024-10-01", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + { + date: "2024-10-02", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + { + date: "2024-10-03", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + { + date: "2024-10-04", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + { + date: "2024-10-05", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + { + date: "2024-10-06", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + { + date: "2024-10-07", + date_epoch: 1726099200, + day: { + maxtemp_c: 32.5, + maxtemp_f: 90.4, + mintemp_c: 28.3, + mintemp_f: 82.9, + avgtemp_c: 30, + avgtemp_f: 85.9, + maxwind_mph: 16.6, + maxwind_kph: 26.6, + totalprecip_mm: 0.24, + totalprecip_in: 0.01, + avgvis_km: 10, + avgvis_miles: 6, + avghumidity: 67, + daily_will_it_rain: 1, + daily_chance_of_rain: 86, + daily_will_it_snow: 0, + daily_chance_of_snow: 0, + condition: { + text: "Patchy rain nearby", + icon: "//cdn.weatherapi.com/weather/64x64/day/176.png", + code: 1063, + }, + uv: 7, + }, + astro: { + sunrise: "05:22 AM", + sunset: "05:53 PM", + moonrise: "01:53 PM", + moonset: "11:09 PM", + moon_phase: "Waxing Gibbous", + moon_illumination: 58, + is_moon_up: 0, + is_sun_up: 1, + }, + hour: [ + { + time_epoch: 1726074000, + time: "2024-09-30 02:00", + temp_c: 28.7, + temp_f: 83.6, + is_day: 0, + condition: { + text: "Clear ", + icon: "//cdn.weatherapi.com/weather/64x64/night/113.png", + code: 1000, + }, + wind_mph: 9.8, + wind_kph: 15.8, + wind_degree: 191, + wind_dir: "SSW", + pressure_mb: 1016, + pressure_in: 29.99, + precip_mm: 0, + precip_in: 0, + snow_cm: 0, + humidity: 74, + cloud: 17, + feelslike_c: 32.9, + feelslike_f: 91.1, + windchill_c: 28.7, + windchill_f: 83.6, + heatindex_c: 32.9, + heatindex_f: 91.1, + dewpoint_c: 23.7, + dewpoint_f: 74.6, + will_it_rain: 0, + chance_of_rain: 0, + will_it_snow: 0, + chance_of_snow: 0, + vis_km: 10, + vis_miles: 6, + gust_mph: 13.3, + gust_kph: 21.3, + uv: 0, + }, + ], + }, + ], + }, +} satisfies ForecastWeatherData diff --git a/src/features/weather/services/search/mock.ts b/src/features/weather/services/search/mock.ts new file mode 100644 index 0000000..18e4fbb --- /dev/null +++ b/src/features/weather/services/search/mock.ts @@ -0,0 +1,124 @@ +import { LocationData } from "@/features/weather/models" + +export const mock = [ + { + id: "2801268", + name: "London, City of London, Greater London, United Kingdom", + region: "City of London, Greater London", + country: "United Kingdom", + lat: 51.52, + lon: -0.11, + url: "london-city-of-london-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2796590", + name: "Holborn, Camden, Greater London, United Kingdom", + region: "Camden, Greater London", + country: "United Kingdom", + lat: 51.52, + lon: -0.12, + url: "holborn-camden-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2812957", + name: "St Giles, Camden, Greater London, United Kingdom", + region: "Camden, Greater London", + country: "United Kingdom", + lat: 51.52, + lon: -0.12, + url: "st-giles-camden-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2786308", + name: "Clerkenwell, Islington, Greater London, United Kingdom", + region: "Islington, Greater London", + country: "United Kingdom", + lat: 51.53, + lon: -0.11, + url: "clerkenwell-islington-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2791655", + name: "Finsbury, Islington, Greater London, United Kingdom", + region: "Islington, Greater London", + country: "United Kingdom", + lat: 51.53, + lon: -0.11, + url: "finsbury-islington-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2813087", + name: "St Pancras, Camden, Greater London, United Kingdom", + region: "Camden, Greater London", + country: "United Kingdom", + lat: 51.53, + lon: -0.12, + url: "st-pancras-camden-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2781746", + name: "Bloomsbury, Camden, Greater London, United Kingdom", + region: "Camden, Greater London", + country: "United Kingdom", + lat: 51.53, + lon: -0.12, + url: "bloomsbury-camden-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2813948", + name: "Strand, Westminster, Greater London, United Kingdom", + region: "Westminster, Greater London", + country: "United Kingdom", + lat: 51.51, + lon: -0.12, + url: "strand-westminster-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2811665", + name: "Shoreditch, Hackney, Greater London, United Kingdom", + region: "Hackney, Greater London", + country: "United Kingdom", + lat: 51.53, + lon: -0.09, + url: "shoreditch-hackney-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, + { + id: "2813028", + name: "St Luke's, Islington, Greater London, United Kingdom", + region: "Islington, Greater London", + country: "United Kingdom", + lat: 51.53, + lon: -0.09, + url: "st-lukes-islington-greater-london-united-kingdom", + tz_id: "Asia/Tokyo", + localtime_epoch: 1726101181, + localtime: "2024-09-30 09:33", + }, +] satisfies LocationData