|
|
@ -9,6 +9,7 @@ import com.ccsens.common.bean.vo.CProjectVo; |
|
|
|
import com.ccsens.common.service.IProjectService; |
|
|
|
import com.ccsens.util.JsonResponse; |
|
|
|
import com.ccsens.util.bean.dto.QueryDto; |
|
|
|
import com.ccsens.util.message.SwitchoverProjectUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
@ -20,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestMethod; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author 逗 |
|
|
@ -58,7 +61,10 @@ public class ProjectController { |
|
|
|
@RequestMapping(value = "/switchProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse switchProject(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.SwitchProject> params) throws Exception { |
|
|
|
log.info("切换项目:{}", params); |
|
|
|
qcpProjectService.switchProject(params.getParam(), params.getUserId()); |
|
|
|
Set<String> userIds = new HashSet<>(); |
|
|
|
userIds.add(params.getUserId().toString()); |
|
|
|
ProjectDto.SwitchProject param = params.getParam(); |
|
|
|
SwitchoverProjectUtil.switchoverProject(userIds,param.getProjectId(), param.getUrl()); |
|
|
|
log.info("切换项目"); |
|
|
|
return JsonResponse.newInstance().ok(); |
|
|
|
} |
|
|
|