46 lines
1.3 KiB
C#
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);
|
|
}
|
|
}
|