Template
chore: deploy initial code base
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Strata.ContinuousImprovement.Biz.Generics;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Strata.ContinuousImprovement.Api.Generics
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{api-version:apiVersion}/[controller]")]
|
||||
public class OpportunityController<T> : ControllerBase where T : class, IOpportunity
|
||||
{
|
||||
protected readonly IOpportunityService<T> OpportunityService;
|
||||
|
||||
public OpportunityController(IOpportunityService<T> opportunityService)
|
||||
{
|
||||
OpportunityService = opportunityService;
|
||||
}
|
||||
|
||||
[HttpPut("{opportunityGuid}/[action]")]
|
||||
public async Task SetHiddenAsync(Guid opportunityGuid, [FromBody] bool isHidden, CancellationToken cancellationToken)
|
||||
{
|
||||
await OpportunityService.SetHiddenAsync(opportunityGuid, isHidden, cancellationToken);
|
||||
}
|
||||
|
||||
[HttpPut("{opportunityGuid}/[action]")]
|
||||
public virtual async Task SetNoteAsync(Guid opportunityGuid, [FromBody] string note, CancellationToken cancellationToken)
|
||||
{
|
||||
await OpportunityService.SetNoteAsync(opportunityGuid, note, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user