Fill out model partialy

This commit is contained in:
MaxchilKH 2020-05-22 18:57:32 +02:00
parent f9da73ea76
commit a9ba22a518
15 changed files with 92 additions and 66 deletions

View File

@ -1,7 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>

View File

@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Serilog;
namespace Internship.Api.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
Log.Warning("Randomly generated number was: {Rng}", rng);
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}

View File

@ -12,4 +12,8 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.3.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers" />
</ItemGroup>
</Project>

View File

@ -1,15 +0,0 @@
using System;
namespace Internship.Api
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Internship.Core
{
public struct Address
{
public string Street { get; set; }
public string Building { get; set; }
public string City { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
}
}

View File

@ -2,5 +2,7 @@
{
public class BranchOffice
{
public Company Company { get; set; }
public Address Address { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
namespace Internship.Core
{
public class Company
{
public string Name { get; set; }
public RangeOfActivities Range { get; set; }
public Uri SiteAddress { get; set; }
public string Nip { get; set; }
}
}

View File

@ -0,0 +1,6 @@
namespace Internship.Core
{
public class Course
{
}
}

View File

@ -0,0 +1,18 @@
using System;
namespace Internship.Core
{
public struct DeanAcceptance
{
public DateTime AcceptanceDate { get; set; }
public bool IsDeansAcceptanceRequired { get; set; }
public DeanAcceptanceReason Reason { get; set; }
}
public enum DeanAcceptanceReason
{
Semester,
Delay,
Whatever
}
}

View File

@ -6,6 +6,7 @@ namespace Internship.Core
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public DateTime IPPDeadlineDate { get; set; }
}
}

View File

@ -0,0 +1,10 @@
using System;
namespace Internship.Core
{
public struct Insurance
{
public DateTime InsuranceDeliveryDate { get; set; }
public bool IsInsuranceRequired { get; set; }
}
}

View File

@ -7,5 +7,8 @@ namespace Internship.Core
public string AlbumNumber { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string Email { get; set; }
public Course Course { get; set; }
public int Semester { get; set; }
}
}

View File

@ -1,4 +1,6 @@
namespace Internship.Core
using System;
namespace Internship.Core
{
public class Internship
{
@ -7,5 +9,13 @@
public Report Report { get; set; }
public BranchOffice BranchOffice { get; set; }
public InternshipProgram Program { get; set; }
public InternshipType Type { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public bool IsAccepted { get; set; }
public DeanAcceptance DeanAcceptance { get; set; }
public Insurance Insurance { get; set; }
public int InternshipLengthInWeeks { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Internship.Core
{
public enum InternshipType
{
B2B,
Free
}
}

View File

@ -0,0 +1,6 @@
namespace Internship.Core
{
public enum RangeOfActivities
{
}
}