Compare commits
4 Commits
537891b8c5
...
a954a24888
| Author | SHA1 | Date | |
|---|---|---|---|
| a954a24888 | |||
| a78c117a47 | |||
| 07e16f8aca | |||
| 0b70016ab6 |
@ -17,4 +17,22 @@ public class ConfigController : CRUDControllerBaseWithErrorHandling<IConfigServi
|
||||
public ConfigController(ILogger<ConfigController> logger, IConfigService service) : base(logger, service)
|
||||
{
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> Create(ConfigCreateDto createDto)
|
||||
{
|
||||
return base.Create(createDto);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> Update(ConfigUpdateDto updateDto)
|
||||
{
|
||||
return base.Update(updateDto);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> Delete([FromRoute] int id)
|
||||
{
|
||||
return base.Delete(id);
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,7 @@
|
||||
using DigitalData.Core.API;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using WorkFlow.API.Attributes;
|
||||
using WorkFlow.Application.Contracts;
|
||||
using WorkFlow.Application.DTO.Profile;
|
||||
using WorkFlow.Domain.Entities;
|
||||
|
||||
namespace WorkFlow.API.Controllers;
|
||||
@ -12,9 +10,64 @@ namespace WorkFlow.API.Controllers;
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class ProfileController : CRUDControllerBaseWithErrorHandling<IProfileService, ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>
|
||||
public class ProfileController : ControllerBase
|
||||
{
|
||||
public ProfileController(ILogger<ProfileController> logger, IProfileService service) : base(logger, service)
|
||||
public static readonly Profile Default = new()
|
||||
{
|
||||
Id = 1,
|
||||
TypeId = 1,
|
||||
Caption = "VA Freigabe",
|
||||
Subtitle = "Freigabe in Rolle Verantwortlich",
|
||||
CountObj = 2,
|
||||
ForeColor = "Yellow",
|
||||
BackColor = "Black",
|
||||
Objects = new ProfileObject[]
|
||||
{
|
||||
new()
|
||||
{
|
||||
ObjStateId = 3,
|
||||
ObjectId = 21601,
|
||||
Headline1 = "Aveco Holding",
|
||||
Headline2 = "Digital Data",
|
||||
Subline1 = null,
|
||||
Subline2 = "25 4711",
|
||||
CmdCheckIn = ""
|
||||
},
|
||||
new()
|
||||
{
|
||||
ObjStateId = 4,
|
||||
ObjectId = 21600,
|
||||
Headline1 = "Aveco",
|
||||
Headline2 = "Hammer AF",
|
||||
Subline1 = null,
|
||||
Subline2 = "456875",
|
||||
CmdCheckIn = ""
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private readonly ILogger<ProfileController> _logger;
|
||||
|
||||
private readonly IProfileService _service;
|
||||
public ProfileController(ILogger<ProfileController> logger, IProfileService service)
|
||||
{
|
||||
_logger = logger;
|
||||
_service = service;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public IActionResult GetAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Ok(Default);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "{Message}", ex.Message);
|
||||
return StatusCode(500);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -65,6 +65,7 @@ public class ProfileControlsTFController : CRUDControllerBase<IProfileControlsTF
|
||||
}
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[HttpPost]
|
||||
public override async Task<IActionResult> Create([FromBody] ProfileControlsTFCreateDto createDto)
|
||||
{
|
||||
@ -93,6 +94,7 @@ public class ProfileControlsTFController : CRUDControllerBase<IProfileControlsTF
|
||||
}
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[HttpDelete]
|
||||
public override async Task<IActionResult> Delete([FromRoute] int id)
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ namespace WorkFlow.API.Controllers
|
||||
return await _service.ReadAsync(
|
||||
withProfile: withProfile, withUser: withUser, withState,
|
||||
userId: id,
|
||||
profileId: profileId, objId: objId, profileActive: profileActive)
|
||||
profileId: profileId, objId: objId)
|
||||
.ThenAsync(
|
||||
Success: pctf => pctf.Any() ? Ok(pctf) : NotFound(),
|
||||
Fail: IActionResult (msg, ntc) =>
|
||||
|
||||
@ -17,4 +17,22 @@ public class StateController : CRUDControllerBaseWithErrorHandling<IStateService
|
||||
public StateController(ILogger<StateController> logger, IStateService service) : base(logger, service)
|
||||
{
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> Create(StateCreateDto createDto)
|
||||
{
|
||||
return base.Create(createDto);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> Update(StateUpdateDto updateDto)
|
||||
{
|
||||
return base.Update(updateDto);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> Delete([FromRoute] int id)
|
||||
{
|
||||
return base.Delete(id);
|
||||
}
|
||||
}
|
||||
@ -24,4 +24,7 @@ public class Profile
|
||||
|
||||
[Column("BACK_COLOR")]
|
||||
public string? BackColor { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public IEnumerable<ProfileObject>? Objects;
|
||||
}
|
||||
18
src/WorkFlow.Domain/Entities/ProfileObjects.cs
Normal file
18
src/WorkFlow.Domain/Entities/ProfileObjects.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace WorkFlow.Domain.Entities;
|
||||
|
||||
public class ProfileObject
|
||||
{
|
||||
public int? ObjStateId { get; set; }
|
||||
|
||||
public int? ObjectId { get; set; }
|
||||
|
||||
public string? Headline1 { get; set; }
|
||||
|
||||
public string? Headline2 { get; set; }
|
||||
|
||||
public string? Subline1 { get; set; }
|
||||
|
||||
public string? Subline2 { get; set; }
|
||||
|
||||
public string? CmdCheckIn { get; set; }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user