feat(ReadObject): created to handle objects.
- Add ObjectDto and mapping profile
This commit is contained in:
parent
27e4b4b2ef
commit
8ceaa9cb21
@ -5,6 +5,7 @@ using WorkFlow.Application.DTO.Profile;
|
||||
using WorkFlow.Application.DTO.ProfileControlsTF;
|
||||
using WorkFlow.Application.DTO.ProfileObjState;
|
||||
using WorkFlow.Application.DTO.State;
|
||||
using WorkFlow.Application.Objects;
|
||||
using WorkFlow.Application.Profiles;
|
||||
using WorkFlow.Domain.Entities;
|
||||
|
||||
@ -21,6 +22,12 @@ namespace WorkFlow.Application
|
||||
CreateMap<ProfileObjState, ProfileObjStateDto>();
|
||||
CreateMap<State, StateDto>();
|
||||
CreateMap<Button, ButtonDto>();
|
||||
CreateMap<ProfileObject, ObjectDto>()
|
||||
.ForMember(dest => dest.Headlines, opt => opt.MapFrom(src =>
|
||||
new[] { src.Headline1, src.Headline2 }))
|
||||
.ForMember(dest => dest.Sublines, opt => opt.MapFrom(src =>
|
||||
new[] { src.Subline1, src.Subline2 }));
|
||||
|
||||
|
||||
// Mapping create-DTO to entity
|
||||
CreateMap<ConfigCreateDto, Config>();
|
||||
|
||||
19
src/WorkFlow.Application/Objects/ReadObject.cs
Normal file
19
src/WorkFlow.Application/Objects/ReadObject.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using MediatR;
|
||||
namespace WorkFlow.Application.Objects;
|
||||
|
||||
public class ObjectDto
|
||||
{
|
||||
public long? ObjStateId { get; set; }
|
||||
|
||||
public long? Id { get; set; }
|
||||
|
||||
public IEnumerable<string> Headlines { get; set; } = Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> Sublines { get; set; } = Array.Empty<string>();
|
||||
|
||||
public string? CmdCheckIn { get; set; }
|
||||
}
|
||||
|
||||
public record ReadObjectRequest : IRequest
|
||||
{
|
||||
}
|
||||
@ -2,6 +2,7 @@
|
||||
using MediatR;
|
||||
using WorkFlow.Application.Buttons;
|
||||
using WorkFlow.Application.Contracts.Repositories;
|
||||
using WorkFlow.Application.Objects;
|
||||
|
||||
namespace WorkFlow.Application.Profiles;
|
||||
|
||||
@ -21,6 +22,8 @@ public class ProfileDto
|
||||
|
||||
public string? BackColor { get; init; }
|
||||
|
||||
public IEnumerable<ObjectDto> Objects { get; init; } = Array.Empty<ObjectDto>();
|
||||
|
||||
public IEnumerable<ButtonDto>? Buttons { get; set; } = Array.Empty<ButtonDto>();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user