Commit a838b3fa by 段启岩

修复能修改他人项目的问题

parent ac06f7be
...@@ -143,7 +143,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl ...@@ -143,7 +143,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
Assert.notNull(project.getProjectId(), "projectId must not be null"); Assert.notNull(project.getProjectId(), "projectId must not be null");
// 1.判断自己有没有发过这个项目 // 1.判断自己有没有发过这个项目
Project projectInDb = getById(project); QueryWrapper<Project> projectQueryWrapper = new QueryWrapper<>();
projectQueryWrapper
.eq("user_id", project.getUserId())
.eq("project_id", project.getProjectId());
Project projectInDb = getOne(projectQueryWrapper);
// 若找不到该项目,则抛出业务异常 // 若找不到该项目,则抛出业务异常
if (null == projectInDb) { if (null == projectInDb) {
throw new ProjectServiceException(ProjectErrorCode.PROJECT_NOT_FOUND); throw new ProjectServiceException(ProjectErrorCode.PROJECT_NOT_FOUND);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment