Static Pages and fixes #38
@ -24,21 +24,11 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
}
|
}
|
||||||
private InternshipDbContext Context { get; }
|
private InternshipDbContext Context { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get all internship types
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>List of internship types</returns>
|
|
||||||
[HttpGet]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
public async Task<ActionResult<IList<InternshipType>>> GetAllInternshipTypes(CancellationToken cancellationToken) =>
|
|
||||||
await Context.InternshipTypes
|
|
||||||
.ToListAsync(cancellationToken);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get static page
|
/// Get static page
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>List of internship types for edition</returns>
|
/// <returns>List of internship types for edition</returns>
|
||||||
[HttpGet("forCurrentEdition")]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Core
|
namespace InternshipSystem.Core
|
||||||
{
|
{
|
||||||
public class Company
|
public class Company
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public Nip Nip { get; set; }
|
public string Nip { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public List<BranchOffice> Branches { get; set; }
|
public List<BranchOffice> Branches { get; set; }
|
||||||
|
|
||||||
|
@ -5,5 +5,6 @@
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
public string DescriptionEng { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,5 +5,6 @@
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
public string DescriptionEng { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,6 +5,8 @@
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public string AccessName { get; set; }
|
public string AccessName { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
public string TitleEng { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
public string ContentEng { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,6 +5,6 @@
|
|||||||
public string FirstName { get; set; }
|
public string FirstName { get; set; }
|
||||||
public string LastName { get; set; }
|
public string LastName { get; set; }
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
public PhoneNumber PhoneNumber { get; set; }
|
public string PhoneNumber { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,18 +0,0 @@
|
|||||||
namespace InternshipSystem.Core
|
|
||||||
{
|
|
||||||
public struct Nip
|
|
||||||
{
|
|
||||||
private readonly string _nip;
|
|
||||||
|
|
||||||
public Nip(string nip)
|
|
||||||
{
|
|
||||||
_nip = nip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static implicit operator string(Nip nip) =>
|
|
||||||
nip._nip;
|
|
||||||
|
|
||||||
public static implicit operator Nip(string maybeNip) =>
|
|
||||||
new Nip(maybeNip);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
namespace InternshipSystem.Core
|
|
||||||
{
|
|
||||||
public struct PhoneNumber
|
|
||||||
{
|
|
||||||
private readonly string _phoneNumber;
|
|
||||||
|
|
||||||
public PhoneNumber(string phoneNumber)
|
|
||||||
{
|
|
||||||
_phoneNumber = phoneNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static implicit operator string(PhoneNumber number) =>
|
|
||||||
number._phoneNumber;
|
|
||||||
|
|
||||||
public static implicit operator PhoneNumber(string maybeNumber) =>
|
|
||||||
new PhoneNumber(maybeNumber);
|
|
||||||
}
|
|
||||||
}
|
|
@ -110,41 +110,49 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Type = "FreeInternship",
|
Type = "FreeInternship",
|
||||||
Description = "Praktyka bezpłatna",
|
Description = "Praktyka bezpłatna",
|
||||||
|
DescriptionEng = "Free internship",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "GraduateInternship",
|
Type = "GraduateInternship",
|
||||||
Description = "Praktyka absolwencka",
|
Description = "Praktyka absolwencka",
|
||||||
|
DescriptionEng = "Graduate internship",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "FreeApprenticeship",
|
Type = "FreeApprenticeship",
|
||||||
Description = "Praktyka bezpłatna",
|
Description = "Praktyka bezpłatna",
|
||||||
|
DescriptionEng = "Free apprenticeship",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "PaidApprenticeship",
|
Type = "PaidApprenticeship",
|
||||||
Description = "np. przemysłowy",
|
Description = "np. przemysłowy",
|
||||||
|
DescriptionEng = "Paid apprenticeship",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "ForeignInternship",
|
Type = "ForeignInternship",
|
||||||
Description = "np. IAESTE, ERASMUS",
|
Description = "np. IAESTE, ERASMUS",
|
||||||
|
DescriptionEng = "Foreign internship",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "UOP",
|
Type = "UOP",
|
||||||
Description = "umowa o pracę",
|
Description = "umowa o pracę",
|
||||||
|
DescriptionEng = "contract of employment",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "UD",
|
Type = "UD",
|
||||||
Description = "umowa o dzieło",
|
Description = "umowa o dzieło",
|
||||||
|
DescriptionEng = "contract work",
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
Type = "UZ",
|
Type = "UZ",
|
||||||
Description = "umowa zlecenie",
|
Description = "umowa zlecenie",
|
||||||
|
DescriptionEng = "contract of mandate"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
await Context.InternshipTypes.AddRangeAsync(internshipTypes);
|
await Context.InternshipTypes.AddRangeAsync(internshipTypes);
|
||||||
@ -167,21 +175,24 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Subject = new InternshipSubject
|
Subject = new InternshipSubject
|
||||||
{
|
{
|
||||||
Description = "Modelowanie baz danych"
|
Description = "Modelowanie baz danych",
|
||||||
|
DescriptionEng = "Database modeling",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new EditionSubject
|
new EditionSubject
|
||||||
{
|
{
|
||||||
Subject = new InternshipSubject
|
Subject = new InternshipSubject
|
||||||
{
|
{
|
||||||
Description = "Oprogramowywanie kart graficznych"
|
Description = "Oprogramowywanie kart graficznych",
|
||||||
|
DescriptionEng = "Graphics card software",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new EditionSubject
|
new EditionSubject
|
||||||
{
|
{
|
||||||
Subject = new InternshipSubject
|
Subject = new InternshipSubject
|
||||||
{
|
{
|
||||||
Description = "Projektowanie UI"
|
Description = "Projektowanie UI",
|
||||||
|
DescriptionEng = "UI design",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -315,7 +326,7 @@ namespace InternshipSystem.Repository
|
|||||||
"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Bestiarum vero nullum iudicium puto. Quare ad ea primum, si videtur; <b>Duo Reges: constructio interrete.</b> <i>Eam tum adesse, cum dolor omnis absit;</i> Sed ad bona praeterita redeamus. <mark>Facillimum id quidem est, inquam.</mark> Apud ceteros autem philosophos, qui quaesivit aliquid, tacet; </p>" +
|
"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Bestiarum vero nullum iudicium puto. Quare ad ea primum, si videtur; <b>Duo Reges: constructio interrete.</b> <i>Eam tum adesse, cum dolor omnis absit;</i> Sed ad bona praeterita redeamus. <mark>Facillimum id quidem est, inquam.</mark> Apud ceteros autem philosophos, qui quaesivit aliquid, tacet; </p>" +
|
||||||
"<p><a href=\"http://loripsum.net/\" target=\"_blank\">Quorum altera prosunt, nocent altera.</a> Eam stabilem appellas. <i>Sed nimis multa.</i> Quo plebiscito decreta a senatu est consuli quaestio Cn. Sin laboramus, quis est, qui alienae modum statuat industriae? <mark>Quod quidem nobis non saepe contingit.</mark> Si autem id non concedatur, non continuo vita beata tollitur. " +
|
"<p><a href=\"http://loripsum.net/\" target=\"_blank\">Quorum altera prosunt, nocent altera.</a> Eam stabilem appellas. <i>Sed nimis multa.</i> Quo plebiscito decreta a senatu est consuli quaestio Cn. Sin laboramus, quis est, qui alienae modum statuat industriae? <mark>Quod quidem nobis non saepe contingit.</mark> Si autem id non concedatur, non continuo vita beata tollitur. " +
|
||||||
"<a href=\"http://loripsum.net/\" target=\"_blank\">Illum mallem levares, quo optimum atque humanissimum virum, Cn.</a> <i>Id est enim, de quo quaerimus.</i> </p><p>Ille vero, si insipiens-quo certe, quoniam tyrannus -, numquam beatus; Sin dicit obscurari quaedam nec apparere, quia valde parva sint, nos quoque concedimus; Et quod est munus, quod opus sapientiae? Ab hoc autem quaedam non melius quam veteres, quaedam omnino relicta. </p>" +
|
"<a href=\"http://loripsum.net/\" target=\"_blank\">Illum mallem levares, quo optimum atque humanissimum virum, Cn.</a> <i>Id est enim, de quo quaerimus.</i> </p><p>Ille vero, si insipiens-quo certe, quoniam tyrannus -, numquam beatus; Sin dicit obscurari quaedam nec apparere, quia valde parva sint, nos quoque concedimus; Et quod est munus, quod opus sapientiae? Ab hoc autem quaedam non melius quam veteres, quaedam omnino relicta. </p>" +
|
||||||
"Prosto spod bazy ;D"
|
"<p>Prosto spod bazy ;D</p>"
|
||||||
},
|
},
|
||||||
new StaticPage
|
new StaticPage
|
||||||
{
|
{
|
||||||
|
@ -24,21 +24,11 @@ namespace InternshipSystem.Repository
|
|||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
modelBuilder.Entity<Company>()
|
|
||||||
.Property(company => company.Nip)
|
|
||||||
.HasConversion<string>(
|
|
||||||
nip => nip,
|
|
||||||
s => (Nip)s);
|
|
||||||
|
|
||||||
modelBuilder.Entity<BranchOffice>()
|
modelBuilder.Entity<BranchOffice>()
|
||||||
.OwnsOne(bo => bo.Address);
|
.OwnsOne(bo => bo.Address);
|
||||||
|
|
||||||
modelBuilder.Entity<InternshipProgram>()
|
modelBuilder.Entity<InternshipProgram>()
|
||||||
.OwnsOne(ip => ip.Mentor)
|
.OwnsOne(ip => ip.Mentor);
|
||||||
.Property(mentor => mentor.PhoneNumber)
|
|
||||||
.HasConversion<string>(
|
|
||||||
number => number,
|
|
||||||
s => (PhoneNumber)s);
|
|
||||||
|
|
||||||
modelBuilder.Entity<ProgramSubject>(builder =>
|
modelBuilder.Entity<ProgramSubject>(builder =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user