Is simple API for work with buiseness days
Add weekdays and weekends that do not match the calendar to the file .\data\dates.txt
File format is date;type one date per row where type is
0 - Unknown
1 - Off day
2 - Working day
- With dotnet Kestrel
dotnet run
- Publish as exeutable Kestrel
dotnet publish -c Release --output ./dist
.\dist\WorkingDays.exe
- Docker Kestrel
docker compose up # --build
If you dont want to mount the data folder, just comment or delete section volumes
in docker-compose.yml
Swagger: http://localhost:{port}/index.html
Currently implemented:
Get all dates from repository:
curl -X 'GET' \
'http://localhost:5024/days' \
-H 'accept: application/json'
Response body
[
{
"day": "2024-01-01T00:00:00",
"dayType": 1,
"dayTypeAsString": "Выходной день"
},
...
]
Checking the date 01.01.2024 status:
curl -X 'GET' \
'http://localhost:5024/days/20240101' \
-H 'accept: application/json'
Response body
{
"day": "2024-01-01T00:00:00",
"dayType": 1,
"dayTypeAsString": "Выходной день"
}
Adding 5 days to a date 31.12.2023:
curl -X 'GET' \
'http://localhost:5024/days/20231231/add/days/5' \
-H 'accept: application/json'
Response body
{
"day": "2024-01-05T00:00:00",
"dayType": 1,
"dayTypeAsString": "Выходной день"
}
Adding 10 business days to the date 31.12.2023:
curl -X 'GET' \
'http://localhost:5024/days/20231231/add/workingDays/10' \
-H 'accept: application/json'
Response body
{
"day": "2024-01-22T00:00:00",
"dayType": 2,
"dayTypeAsString": "Рабочий день"
}
- Serilog
- Swashbuckle Swagger
- Microsoft.AspNetCore.Cors