|
|
@@ -3,12 +3,14 @@ package com.mooctest.crowd.site.controller;
|
|
|
import com.mooctest.crowd.domain.domainobject.CrowdTestProject;
|
|
|
import com.mooctest.crowd.domain.exception.BadRequestException;
|
|
|
import com.mooctest.crowd.domain.exception.BaseException;
|
|
|
+import com.mooctest.crowd.site.annotation.LoginRequired;
|
|
|
import com.mooctest.crowd.site.command.CrowdTestProjectCommand;
|
|
|
import com.mooctest.crowd.site.command.GenerateProjectCommand;
|
|
|
import com.mooctest.crowd.site.data.dto.ProjectDetailsDTO;
|
|
|
import com.mooctest.crowd.site.data.vo.RegionalManagerVO;
|
|
|
import com.mooctest.crowd.site.service.CrowdProjectService;
|
|
|
import com.mooctest.crowd.site.util.FileUtil;
|
|
|
+import lombok.extern.java.Log;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
@@ -63,8 +65,13 @@ public class CrowdProjectController {
|
|
|
return projectService.getProjectDetails(projectCode, userId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取全部项目
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping(value = "/api/project", method = RequestMethod.GET)
|
|
|
public List<ProjectDetailsDTO> getProjects(){
|
|
|
+ //todo 获取所有项目列表
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@@ -84,6 +91,11 @@ public class CrowdProjectController {
|
|
|
return projectService.updateProject(projectCode, crowdTestProjectCommand);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除项目
|
|
|
+ * @param projectId
|
|
|
+ * @param session
|
|
|
+ */
|
|
|
@RequestMapping(value = "/api/project/{projectId}", method = RequestMethod.DELETE)
|
|
|
public void deleteProject(@PathVariable("projectId") Long projectId, HttpSession session){
|
|
|
projectService.deleteProject(projectId, (Long)session.getAttribute("userId"));
|
|
|
@@ -125,13 +137,31 @@ public class CrowdProjectController {
|
|
|
return projectService.importMultiProjectsByExcel(projects);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 区域管理员接收项目
|
|
|
+ * @param projectCode
|
|
|
+ * @param userId
|
|
|
+ */
|
|
|
+ @LoginRequired
|
|
|
@RequestMapping(value = "/api/project/{projectCode}/regionManager/{userId}")
|
|
|
public void acceptProject(@PathVariable("projectCode") String projectCode, @PathVariable("userId") Long userId){
|
|
|
projectService.receiveProject(projectCode, userId);
|
|
|
}
|
|
|
|
|
|
+ @LoginRequired
|
|
|
+ @RequestMapping(value = "/api/project/{projectCode}/status/reject")
|
|
|
+ public void rejectProejct(@PathVariable("proejctCode") String projectCode, HttpSession session){
|
|
|
+ Long userId = Long.parseLong((String)session.getAttribute("userId"));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取区域管理员列表
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping(value = "/api/regionalManager", method = RequestMethod.GET)
|
|
|
public List<RegionalManagerVO> getRegionalManagerList(){
|
|
|
return projectService.getRegionalManagerList();
|
|
|
}
|
|
|
+
|
|
|
}
|