Files
StopShopping/StopShopping.Api/Routes/Reply.cs
2026-03-25 14:55:34 +08:00

46 lines
1.3 KiB
C#

using StopShopping.Services;
using StopShopping.Services.Models.Req;
using StopShopping.Services.Models.Resp;
namespace StopShopping.Api.Routes;
public static class Reply
{
public static RouteGroupBuilder MapReply(this RouteGroupBuilder routes)
{
routes.MapPost("/reply/post", SubmitReplyAsync)
.WithTags(OpenApiTags..ToString());
routes.MapGet("/reply/list", ListAsync)
.WithTags(OpenApiTags..ToString());
routes.MapGet("/reply/orders", OrderSearchAsync)
.WithTags(OpenApiTags..ToString());
return routes;
}
private static async Task<ApiResponse> SubmitReplyAsync(
ReplyParams model,
IReplyService replyService)
{
return await replyService.ReplyAsync(model);
}
private static async Task<ApiResponse<List<Services.Models.Resp.Reply>>> ListAsync(
[AsParameters] RequestIdParams model,
IReplyService replyService
)
{
return await replyService.GetRepliesAsync(model);
}
private static async Task<ApiResponse<PagedResult<Services.Models.Resp.Request>>> OrderSearchAsync(
[AsParameters] RequestSearchWithStatusParams model,
IRequestService requestService
)
{
return await requestService.RequestOrderSearchAsync(model);
}
}