2021-10-17 18:37:07 +08:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2021-10-11 21:50:50 +08:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Yi.Framework.Common.Models;
|
2022-04-26 01:31:14 +08:00
|
|
|
|
using Yi.Framework.DTOModel;
|
2021-10-11 21:50:50 +08:00
|
|
|
|
using Yi.Framework.Interface;
|
|
|
|
|
|
using Yi.Framework.Model.Models;
|
2022-04-06 18:05:00 +08:00
|
|
|
|
using Yi.Framework.Repository;
|
2021-10-13 16:44:15 +08:00
|
|
|
|
using Yi.Framework.WebCore;
|
2022-04-06 22:22:45 +08:00
|
|
|
|
using Yi.Framework.WebCore.AttributeExtend;
|
2022-01-11 16:40:15 +08:00
|
|
|
|
using Yi.Framework.WebCore.AuthorizationPolicy;
|
2021-10-11 21:50:50 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.ApiMicroservice.Controllers
|
|
|
|
|
|
{
|
2022-04-26 01:31:14 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用户管理
|
|
|
|
|
|
/// </summary>
|
2021-10-11 21:50:50 +08:00
|
|
|
|
[ApiController]
|
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
2022-04-06 18:05:00 +08:00
|
|
|
|
public class UserController : BaseCrudController<UserEntity>
|
2021-10-11 21:50:50 +08:00
|
|
|
|
{
|
2022-04-12 18:09:13 +08:00
|
|
|
|
private IUserService _iUserService;
|
2022-04-06 18:05:00 +08:00
|
|
|
|
public UserController(ILogger<UserEntity> logger, IUserService iUserService) : base(logger, iUserService)
|
2021-10-11 21:50:50 +08:00
|
|
|
|
{
|
2022-04-12 18:09:13 +08:00
|
|
|
|
_iUserService = iUserService;
|
2021-10-11 21:50:50 +08:00
|
|
|
|
}
|
2022-04-26 01:31:14 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 给多用户设置多角色
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="giveUserSetRoleDto"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
public async Task<Result> GiveUserSetRole(GiveUserSetRoleDto giveUserSetRoleDto)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Result.Success().SetStatus(await _iUserService.GiveUserSetRole(giveUserSetRoleDto.UserIds,giveUserSetRoleDto.RoleIds));
|
|
|
|
|
|
}
|
2021-10-11 21:50:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|