Commit b06bf58a authored by Andres Käver's avatar Andres Käver
Browse files

langstr and mvc

parent fdfb1feb
Pipeline #812 passed with stages
in 55 seconds
......@@ -2,6 +2,7 @@ using System;
using BLL.App.DTO.Identity;
using Contracts.DAL.Base;
using System.Text.Json.Serialization;
using Contracts.Domain;
namespace BLL.App.DTO
{
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Contracts.DAL.Base;
using Contracts.Domain;
namespace BLL.App.DTO
{
......@@ -10,11 +11,14 @@ namespace BLL.App.DTO
{
public Guid Id { get; set; }
public Guid NameId { get; set; }
[Required]
[MinLength(1)]
[MaxLength(64)]
public string Name { get; set; } = default!;
public Guid DescriptionId { get; set; }
[Required] [MaxLength(4096)] public string Description { get; set; } = default!;
[JsonIgnore]
......
......@@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using BLL.App.DTO.Identity;
using Contracts.DAL.Base;
using Contracts.Domain;
namespace BLL.App.DTO
{
......@@ -34,11 +35,11 @@ namespace BLL.App.DTO
public double PaceMax { get; set; } // pace in seconds per kilometer
public Guid AppUserId { get; set; }
[JsonIgnore]
public AppUser? AppUser { get; set; }
public Guid GpsSessionTypeId { get; set; }
public GpsSessionType? GpsSessionType { get; set; }
[JsonIgnore]
public ICollection<GpsLocation>? GpsLocations { get; set; }
}
......
using System;
using System.Collections.Generic;
using Contracts.Domain;
namespace BLL.App.DTO
{
public class GpsSessionType: IDomainEntityId
{
public Guid Id { get; set; }
public Guid NameId { get; set; }
public string Name { get; set; } = default!;
public Guid DescriptionId { get; set; }
public string Description { get; set; } = default!;
public int PaceMin { get; set; }
public int PaceMax { get; set; }
public ICollection<GpsSession>? GpsSessions { get; set; }
}
}
\ No newline at end of file
using System;
using System.ComponentModel.DataAnnotations;
using Contracts.DAL.Base;
using Contracts.Domain;
namespace BLL.App.DTO.Identity
{
......
using System;
using System.ComponentModel.DataAnnotations;
using Contracts.DAL.Base;
using Contracts.Domain;
namespace BLL.App.DTO.Identity
{
......
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Contracts.Domain;
namespace BLL.App.DTO
{
public class LangStr : IDomainEntityId
{
public Guid Id { get; set; }
public ICollection<LangStrTranslation>? Translations { get; set; }
[InverseProperty(nameof(GpsSessionType.Name))]
public ICollection<GpsSessionType>? GpsSessionTypeNames { get; set; }
[InverseProperty(nameof(GpsSessionType.Description))]
public ICollection<GpsSessionType>? GpsSessionTypeDescriptions { get; set; }
[InverseProperty(nameof(GpsLocationType.Name))]
public ICollection<GpsLocationType>? GpsLocationTypeNames { get; set; }
[InverseProperty(nameof(GpsLocationType.Description))]
public ICollection<GpsLocationType>? GpsLocationTypeDescriptions { get; set; }
[InverseProperty(nameof(Track.Name))] public ICollection<Track>? TrackNames { get; set; }
[InverseProperty(nameof(Track.Description))]
public ICollection<Track>? TrackDescriptions { get; set; }
}
}
\ No newline at end of file
using System;
using System.ComponentModel.DataAnnotations;
using Contracts.Domain;
namespace BLL.App.DTO
{
public class LangStrTranslation : IDomainEntityId
{
public Guid Id { get; set; }
[MaxLength(5)] public string Culture { get; set; } = default!;
[MaxLength(10240)] public string Value { get; set; } = default!;
public Guid LangStrId { get; set; } = default!;
public LangStr LangStr { get; set; } = default!;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using BLL.App.DTO.Identity;
using Contracts.Domain;
namespace BLL.App.DTO
{
public class Track: IDomainEntityId
{
public Guid Id { get; set; }
public Guid NameId { get; set; }
public string Name { get; set; } = default!;
public Guid DescriptionId { get; set; }
public string Description { get; set; } = default!;
[MaxLength(512)]
public string? MapFile { get; set; }
public Guid AppUserId { get; set; }
public AppUser? AppUser { get; set; }
public ICollection<TrackPoint>? TrackPoints { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using BLL.App.DTO.Identity;
using Contracts.Domain;
namespace BLL.App.DTO
{
public class TrackPoint: IDomainEntityId
{
public Guid Id { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
public double Accuracy { get; set; }
public int PassOrder { get; set; }
public Guid TrackId { get; set; }
public Track? Track { get; set; }
public Guid AppUserId { get; set; }
public AppUser? AppUser { get; set; }
public ICollection<GpsLocation>? GpsLocations { get; set; }
}
}
\ No newline at end of file
......@@ -14,11 +14,28 @@ namespace BLL.App
{
}
public IGpsSessionService GpsSessions =>
public IGpsSessionService GpsSessions =>
GetService<IGpsSessionService>(() => new GpsSessionService(UOW));
public IGpsLocationService GpsLocations =>
public IGpsLocationService GpsLocations =>
GetService<IGpsLocationService>(() => new GpsLocationService(UOW));
public IGpsLocationTypeService LocationTypes =>
public IGpsLocationTypeService GpsLocationTypes =>
GetService<IGpsLocationTypeService>(() => new GpsLocationTypeService(UOW));
public IGpsSessionTypeService GpsSessionTypes =>
GetService<IGpsSessionTypeService>(() => new GpsSessionTypeService(UOW));
public ILangStrService LangStrs =>
GetService<ILangStrService>(() => new LangStrService(UOW));
public ILangStrTranslationService LangStrTranslation =>
GetService<ILangStrTranslationService>(() => new LangStrTranslationService(UOW));
public ITrackPointService TrackPoints =>
GetService<ITrackPointService>(() => new TrackPointService(UOW));
public ITrackService Tracks =>
GetService<ITrackService>(() => new TrackService(UOW));
}
}
\ No newline at end of file
using BLL.Base.Mappers;
using Contracts.BLL.App.Mappers;
using BLLAppDTO=BLL.App.DTO;
using DALAppDTO=DAL.App.DTO;
namespace BLL.App.Mappers
{
public class GpsSessionTypeServiceMapper : BaseMapper<DALAppDTO.GpsSessionType, BLLAppDTO.GpsSessionType>, IGpsSessionTypeServiceMapper
{
}
}
\ No newline at end of file
using BLL.Base.Mappers;
using Contracts.BLL.App.Mappers;
using BLLAppDTO=BLL.App.DTO;
using DALAppDTO=DAL.App.DTO;
namespace BLL.App.Mappers
{
public class LangStrServiceMapper : BaseMapper<DALAppDTO.LangStr, BLLAppDTO.LangStr>, ILangStrServiceMapper
{
}
}
\ No newline at end of file
using BLL.Base.Mappers;
using Contracts.BLL.App.Mappers;
using BLLAppDTO=BLL.App.DTO;
using DALAppDTO=DAL.App.DTO;
namespace BLL.App.Mappers
{
public class LangStrTranslationServiceMapper : BaseMapper<DALAppDTO.LangStrTranslation, BLLAppDTO.LangStrTranslation>, ILangStrTranslationServiceMapper
{
}
}
\ No newline at end of file
using BLL.Base.Mappers;
using Contracts.BLL.App.Mappers;
using BLLAppDTO=BLL.App.DTO;
using DALAppDTO=DAL.App.DTO;
namespace BLL.App.Mappers
{
public class TrackPointServiceMapper : BaseMapper<DALAppDTO.TrackPoint, BLLAppDTO.TrackPoint>, ITrackPointServiceMapper
{
}
}
\ No newline at end of file
using BLL.Base.Mappers;
using Contracts.BLL.App.Mappers;
using BLLAppDTO=BLL.App.DTO;
using DALAppDTO=DAL.App.DTO;
namespace BLL.App.Mappers
{
public class TrackServiceMapper : BaseMapper<DALAppDTO.Track, BLLAppDTO.Track>, ITrackServiceMapper
{
}
}
\ No newline at end of file
......@@ -9,7 +9,6 @@ using Contracts.BLL.App.Mappers;
using Contracts.BLL.App.Services;
using Contracts.DAL.App;
using Contracts.DAL.App.Repositories;
using DAL.App.EF;
namespace BLL.App.Services
{
......
......@@ -12,7 +12,7 @@ namespace BLL.App.Services
BaseEntityService<IAppUnitOfWork, IGpsLocationTypeRepository, IGpsLocationTypeServiceMapper,
DAL.App.DTO.GpsLocationType, BLL.App.DTO.GpsLocationType>, IGpsLocationTypeService
{
public GpsLocationTypeService(IAppUnitOfWork uow) : base(uow, uow.LocationTypes,
public GpsLocationTypeService(IAppUnitOfWork uow) : base(uow, uow.GpsLocationTypes,
new GpsLocationTypeServiceMapper())
{
}
......
using BLL.App.Mappers;
using BLL.Base.Services;
using Contracts.BLL.App.Mappers;
using Contracts.BLL.App.Services;
using Contracts.DAL.App;
using Contracts.DAL.App.Repositories;
using DAL.App.EF;
namespace BLL.App.Services
{
public class GpsSessionTypeService :
BaseEntityService<IAppUnitOfWork, IGpsSessionTypeRepository, IGpsSessionTypeServiceMapper,
DAL.App.DTO.GpsSessionType, BLL.App.DTO.GpsSessionType>, IGpsSessionTypeService
{
public GpsSessionTypeService(IAppUnitOfWork uow) : base(uow, uow.GpsSessionTypes, new GpsSessionTypeServiceMapper())
{
}
}
}
\ No newline at end of file
using BLL.App.Mappers;
using BLL.Base.Services;
using Contracts.BLL.App.Mappers;
using Contracts.BLL.App.Services;
using Contracts.DAL.App;
using Contracts.DAL.App.Repositories;
using DAL.App.EF;
namespace BLL.App.Services
{
public class LangStrService :
BaseEntityService<IAppUnitOfWork, ILangStrRepository, ILangStrServiceMapper,
DAL.App.DTO.LangStr, BLL.App.DTO.LangStr>, ILangStrService
{
public LangStrService(IAppUnitOfWork uow) : base(uow, uow.LangStrs, new LangStrServiceMapper())
{
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment