Beispiel #1
0
        public async Task <IActionResult> GetProjectDetail(int projectId)
        {
            var result = await _projectQueries.GetProjectDetailAsync(projectId);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
Beispiel #2
0
 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("无权查看该项目");
     }
 }
Beispiel #3
0
        public async Task <IActionResult> GetMyProjectDetail(int projectId)
        {
            var project = await _projectQueries.GetProjectDetailAsync(projectId);

            if (project.UserId == UserIdentity.UserId)
            {
                return(Ok(project));
            }
            else
            {
                return(BadRequest("无权查看该项目"));
            }
        }