Initial commit - Auth
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
// using System.Threading.Tasks;
|
||||
// using Contracts.DTOs.Generic;
|
||||
// using Contracts.DTOs.Requests;
|
||||
// using Core.Services.Requests;
|
||||
// using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
// namespace Auth.API.Endpoints.v1.RequestEndpoints;
|
||||
|
||||
// public static class RequestMap
|
||||
// {
|
||||
// public static RouteGroupBuilder RequestEndpoints(this RouteGroupBuilder group)
|
||||
// {
|
||||
// group.MapGet(
|
||||
// "requests",
|
||||
// async ([AsParameters] RequestFilter filter, [AsParameters] Pagination pagination, RequestService requestService, HttpContext httpContext) =>
|
||||
// {
|
||||
// var result = await requestService.GetRequests(filter, pagination);
|
||||
|
||||
// return result;
|
||||
// }
|
||||
// );
|
||||
|
||||
// group.MapGet(
|
||||
// "requests/user",
|
||||
// async ([AsParameters] RequestFilter requestFilter, RequestService requestService, HttpContext httpContext) =>
|
||||
// {
|
||||
// var userId = httpContext.User.Claims.FirstOrDefault(x => x.Type == "uid").Value;
|
||||
// return await requestService.GetRequestsAsUser(requestFilter, userId);
|
||||
// }
|
||||
// );
|
||||
|
||||
|
||||
// group.MapPost(
|
||||
// "request",
|
||||
// async ([FromBody] RequestVM requestVM, RequestService requestService, HttpContext httpContext) =>
|
||||
// {
|
||||
// var userId = httpContext.User.Claims.FirstOrDefault(x => x.Type == "uid").Value;
|
||||
// await requestService.CreateRequest(requestVM, userId);
|
||||
// }
|
||||
// );
|
||||
|
||||
|
||||
// //should be only auhtoized by Admins
|
||||
// group.MapPut(
|
||||
// "request",
|
||||
// async ([FromBody] RequestVM requestVM, RequestService requestService, HttpContext httpContext) =>
|
||||
// {
|
||||
// var userId = httpContext.User.Claims.FirstOrDefault(x => x.Type == "uid").Value;
|
||||
// await requestService.TreatRequest(requestVM, userId);
|
||||
// }
|
||||
// );
|
||||
|
||||
|
||||
|
||||
|
||||
// return group;
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
Reference in New Issue
Block a user