|
|
@@ -14,7 +14,6 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
-import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author: Diors.Po
|
|
|
@@ -72,4 +71,16 @@ public class CrowdTaskController {
|
|
|
throw new BaseException("信息不合法,项目可见性选择存在问题");
|
|
|
return taskService.updateTask(projectCode, taskCode, command, Long.parseLong((String)session.getAttribute("userId")));
|
|
|
}
|
|
|
+
|
|
|
+ @LoginRequired
|
|
|
+ @RequestMapping(value = "/project/{projectCode}/task/{taskCode}/agency/{userId}", method = RequestMethod.PUT)
|
|
|
+ public TaskDetailsDTO acceptTask(@PathVariable("projectCode") String projectCode, @PathVariable("taskCode") String taskCode,
|
|
|
+ @PathVariable("userId") Long userId, HttpSession session){
|
|
|
+ Long loginUserId = Long.parseLong((String)session.getAttribute("userId"));
|
|
|
+ log.info("userId in Url: " + userId + ", userId in session: " + loginUserId);
|
|
|
+ if(!loginUserId.equals(userId)) {
|
|
|
+ throw new UnauthorizedException("非法操作,操作用户不一致");
|
|
|
+ }
|
|
|
+ return taskService.acceptTask(projectCode, taskCode, userId);
|
|
|
+ }
|
|
|
}
|