public async Task <IActionResult> GetProjectDetail(int projectId) { var result = await _projectQueries.GetProjectDetailAsync(projectId); if (result == null) { return(NotFound()); } return(Ok(result)); }
public async Task<IActionResult> GetProjectDetailAsync(int projectId) { var result = await _projectQueries.GetProjectDetailAsync(projectId); if (result.UserId == UserIdentity.UserId) { return Ok(result); } else { throw new UserOperationException("无权查看该项目"); } }
public async Task <IActionResult> GetMyProjectDetail(int projectId) { var project = await _projectQueries.GetProjectDetailAsync(projectId); if (project.UserId == UserIdentity.UserId) { return(Ok(project)); } else { return(BadRequest("无权查看该项目")); } }