generated from nventive/Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(311699): Add Weather CRUD endpoints
- Loading branch information
1 parent
591fa53
commit 295d00a
Showing
9 changed files
with
205 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"sdk": { | ||
"version": "9.0.100", | ||
"rollForward": "disable" | ||
"rollForward": "major" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
using Placeholder.Core; | ||
using Placeholder.Core.Models; | ||
|
||
namespace Placeholder.Core; | ||
|
||
internal class WeatherService : IWeatherService | ||
internal class WeatherService(IWeatherRepository weatherRepository) : IWeatherService | ||
{ | ||
private readonly IWeatherRepository _weatherRepository; | ||
public WeatherService(IWeatherRepository weatherRepository) | ||
private readonly IWeatherRepository _weatherRepository = weatherRepository; | ||
|
||
public async Task<IEnumerable<Weather>> GetWeathers() | ||
{ | ||
return await _weatherRepository.GetWeathers(); | ||
} | ||
|
||
public async Task<Weather?> GetWeather(DateTime date) | ||
{ | ||
return await _weatherRepository.GetWeather(date); | ||
} | ||
|
||
public async Task<Weather?> CreateWeather(Weather weather) | ||
{ | ||
return await _weatherRepository.CreateWeather(weather); | ||
} | ||
|
||
public async Task<Weather?> UpdateWeather(Weather weather) | ||
{ | ||
_weatherRepository = weatherRepository; | ||
return await _weatherRepository.UpdateWeather(weather); | ||
} | ||
|
||
public async Task<Weather[]> GetWeather() | ||
public async Task DeleteWeather(DateTime date) | ||
{ | ||
return await _weatherRepository.GetWeather(); | ||
await _weatherRepository.DeleteWeather(date); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters