コード例 #1
0
        public async Task <IActionResult> AddFriendRequest([FromQuery] string username)
        {
            int userId = ClaimHelper.FindNameIdentifier(HttpContext.User.Claims);

            var response = await _friendService.AddFriendRequest(userId, username);

            if (!response.Success)
            {
                return(BadRequest(response.Message));
            }

            var friendDto = _mapper.Map <Friend, FriendDto>(response.Resource);

            return(Ok(friendDto));
        }
コード例 #2
0
 public void AddFriendRequest(int id)
 {
     friendService.AddFriendRequest(currentUser.Id, id);
 }