222
This commit is contained in:
@@ -5,6 +5,7 @@ using IM_API.Tools;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Security.Claims;
|
||||
|
||||
@@ -45,7 +46,7 @@ namespace IM_API.Controllers
|
||||
{
|
||||
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||
int userId = int.Parse(userIdStr);
|
||||
var userinfo = await _userService.UpdateUserAsync(userId,dto);
|
||||
var userinfo = await _userService.UpdateUserAsync(userId, dto);
|
||||
var res = new BaseResponse<UserInfoDto>(userinfo);
|
||||
return Ok(res);
|
||||
|
||||
@@ -84,7 +85,7 @@ namespace IM_API.Controllers
|
||||
{
|
||||
var userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||
int userId = int.Parse(userIdStr);
|
||||
await _userService.ResetPasswordAsync(userId,dto.OldPassword,dto.Password);
|
||||
await _userService.ResetPasswordAsync(userId, dto.OldPassword, dto.Password);
|
||||
return Ok(new BaseResponse<object?>());
|
||||
}
|
||||
/// <summary>
|
||||
@@ -100,5 +101,14 @@ namespace IM_API.Controllers
|
||||
await _userService.UpdateOlineStatusAsync(userId, dto.OnlineStatus);
|
||||
return Ok(new BaseResponse<object?>());
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ProducesResponseType(typeof(BaseResponse<List<UserInfoDto>>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetUserList([FromBody][Required]List<int> ids)
|
||||
{
|
||||
var users = await _userService.GetUserInfoListAsync(ids);
|
||||
var res = new BaseResponse<List<UserInfoDto>>(users);
|
||||
return Ok(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user