✨
This commit is contained in:
45
StopShopping.Api/Routes/Reply.cs
Normal file
45
StopShopping.Api/Routes/Reply.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user