| | |
| | | using FlexJobApi.Core; |
| | | using Furion.DynamicApiController; |
| | | using MediatR; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | //using FlexJobApi.Core; |
| | | //using Furion.DynamicApiController; |
| | | //using MediatR; |
| | | //using Microsoft.AspNetCore.Mvc; |
| | | //using System; |
| | | //using System.Collections.Generic; |
| | | //using System.Linq; |
| | | //using System.Text; |
| | | //using System.Threading.Tasks; |
| | | //using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | |
| | | namespace FlexJobApi.User.Application |
| | | { |
| | | /// <summary> |
| | | /// 角色 |
| | | /// </summary> |
| | | [Route("api/user/[controller]")] |
| | | public class RoleAppService(IMediator mediator) : IDynamicApiController |
| | | { |
| | | private readonly IMediator mediator = mediator; |
| | | //namespace FlexJobApi.User.Application |
| | | //{ |
| | | // /// <summary> |
| | | // /// 角色 |
| | | // /// </summary> |
| | | // [Route("api/user/[controller]")] |
| | | // public class RoleAppService(IMediator mediator) : IDynamicApiController |
| | | // { |
| | | // private readonly IMediator mediator = mediator; |
| | | |
| | | #region 查询 |
| | | // #region 查询 |
| | | |
| | | /// <summary> |
| | | /// 查询角色列表 |
| | | /// </summary> |
| | | /// <param name="query"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public Task<PagedListQueryResult<GetRolesQueryResultItem>> GetRoles([FromBody] GetRolesQuery query) |
| | | { |
| | | return mediator.Send(query); |
| | | } |
| | | // /// <summary> |
| | | // /// 查询角色列表 |
| | | // /// </summary> |
| | | // /// <param name="query"></param> |
| | | // /// <returns></returns> |
| | | // [HttpPost] |
| | | // public Task<PagedListQueryResult<GetRolesQueryResultItem>> GetRoles([FromBody] GetRolesQuery query) |
| | | // { |
| | | // return mediator.Send(query); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 查询角色详情 |
| | | /// </summary> |
| | | /// <param name="query"></param> |
| | | /// <returns></returns> |
| | | public Task<GetRoleQueryResult> GetRole(GetRoleQuery query) |
| | | { |
| | | return mediator.Send(query); |
| | | } |
| | | // /// <summary> |
| | | // /// 查询角色详情 |
| | | // /// </summary> |
| | | // /// <param name="query"></param> |
| | | // /// <returns></returns> |
| | | // public Task<GetRoleQueryResult> GetRole(GetRoleQuery query) |
| | | // { |
| | | // return mediator.Send(query); |
| | | // } |
| | | |
| | | #endregion |
| | | // #endregion |
| | | |
| | | #region 写入 |
| | | // #region 写入 |
| | | |
| | | /// <summary> |
| | | /// 删除角色 |
| | | /// </summary> |
| | | /// <param name="command"></param> |
| | | /// <returns></returns> |
| | | public Task<int> DeleteRole(DeleteRoleCommand command) |
| | | { |
| | | return mediator.Send(command); |
| | | } |
| | | // /// <summary> |
| | | // /// 删除角色 |
| | | // /// </summary> |
| | | // /// <param name="command"></param> |
| | | // /// <returns></returns> |
| | | // public Task<int> DeleteRole(DeleteRoleCommand command) |
| | | // { |
| | | // return mediator.Send(command); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 保存角色 |
| | | /// </summary> |
| | | /// <param name="command"></param> |
| | | /// <returns></returns> |
| | | public Task<Guid> SaveRole(SaveRoleCommand command) |
| | | { |
| | | return mediator.Send(command); |
| | | } |
| | | // /// <summary> |
| | | // /// 保存角色 |
| | | // /// </summary> |
| | | // /// <param name="command"></param> |
| | | // /// <returns></returns> |
| | | // public Task<Guid> SaveRole(SaveRoleCommand command) |
| | | // { |
| | | // return mediator.Send(command); |
| | | // } |
| | | |
| | | #endregion |
| | | // #endregion |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |