You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.0 KiB

package com.project.interaction.controller;
import com.project.base.domain.result.Result;
import com.project.interaction.application.AlgorithmApplicationService;
import com.project.interaction.domain.dto.ClusterCallbackDTO;
import com.project.interaction.domain.dto.QuestionCallBackDTO;
5 months ago
import com.project.interaction.domain.service.GenerateQuestionQueueService;
import com.project.task.application.TaskApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/interaction")
public class InteractionController {
@Autowired
private AlgorithmApplicationService algorithmApplicationService;
@Autowired
private TaskApplicationService taskApplicationService;
5 months ago
@Autowired
private GenerateQuestionQueueService generateQuestionQueueService;
// @PostMapping("/saveCluster")
// public Result<String> saveCluster(ClusterCallbackDTO dto) throws Exception{
// algorithmApplicationService.saveCluster(dto.getTaskId(), dto.getClusters());
// return Result.success("保存成功");
// }
@PostMapping("/saveCluster")
public Result<String> saveCluster(ClusterCallbackDTO dto) throws Exception{
algorithmApplicationService.saveClusterByInformationId(dto.getTaskId(), dto.getClusters());
return Result.success("保存成功");
}
@PostMapping("/saveQuestion")
public Result<String> saveQuestion(QuestionCallBackDTO dto) throws Exception {
return null;
}
/**
* 判断任务是否删除
*/
@PostMapping("/isDeletedTask")
public Result<Boolean> isDeletedTask(Long taskId,@RequestParam("taskKpIds") List<Long> taskKpIds){
return taskApplicationService.isDeletedTask(taskId,taskKpIds);
}
5 months ago
/**
* 获取当前队列大小
*/
@GetMapping("/getQueueSize")
public Result<Integer> getQueueSize(){
return Result.success(generateQuestionQueueService.getQueueSize());
}
}