Add new POST endpoint and update profileId type to long
Added a new HTTP POST endpoint `invoke/fake` in `RecActionController` to invoke batch actions with a fake profile ID. Updated the `profileId` parameter type in the `InvokeBatchRecAction` extension method from `int` to `long` to support larger profile IDs. These changes improve flexibility and introduce a new endpoint for specific use cases.
This commit is contained in:
parent
6de45e3feb
commit
bf02cc80d1
@ -20,6 +20,13 @@ public class RecActionController(IMediator mediator) : ControllerBase
|
|||||||
return Accepted();
|
return Accepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost("invoke/fake")]
|
||||||
|
public async Task<IActionResult> Invoke(CancellationToken cancel)
|
||||||
|
{
|
||||||
|
await mediator.InvokeBatchRecAction(FakeProfileId, cancel);
|
||||||
|
return Accepted();
|
||||||
|
}
|
||||||
|
|
||||||
#region CRUD
|
#region CRUD
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IActionResult> Get([FromQuery] long profileId, CancellationToken cancel) => Ok(await mediator.Send(new ReadRecActionQuery()
|
public async Task<IActionResult> Get([FromQuery] long profileId, CancellationToken cancel) => Ok(await mediator.Send(new ReadRecActionQuery()
|
||||||
|
|||||||
@ -8,7 +8,7 @@ public record InvokeBatchRecActionsCommand : ReadRecActionQueryBase, IRequest;
|
|||||||
|
|
||||||
public static class InvokeBatchRecActionsCommandExtensions
|
public static class InvokeBatchRecActionsCommandExtensions
|
||||||
{
|
{
|
||||||
public static Task InvokeBatchRecAction(this ISender sender, int profileId, CancellationToken cancel = default)
|
public static Task InvokeBatchRecAction(this ISender sender, long profileId, CancellationToken cancel = default)
|
||||||
=> sender.Send(new InvokeBatchRecActionsCommand { ProfileId = profileId }, cancel);
|
=> sender.Send(new InvokeBatchRecActionsCommand { ProfileId = profileId }, cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user