Exemplo n.º 1
0
        public async Task <IActionResult> GetRecommendProjectDetails(int projectId)
        {
            if (!await _recommendService.IsRecommendProject(projectId, UserIdentity.UserId))
            {
                return(BadRequest("无权查看该项目"));
            }
            else
            {
                var project = await _projectQueries.GetProjectDetailsAsync(projectId);

                return(Ok(project));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> ViewProjec(int projectId)
        {
            if (await _recommendService.IsRecommendProject(projectId, 1))
            {
                return(BadRequest("无权限"));
            }
            var command = new ViewProjectCommand()
            {
                ProjectId = projectId,
                UserId    = 1,
                UserName  = "******",
                Avatar    = "test"
            };
            await _mediator.Send(command);

            return(Ok());
        }