6 changed files with 61 additions and 17 deletions
@ -0,0 +1,10 @@ |
|||||
|
package com.project.interaction.domain.service; |
||||
|
|
||||
|
import com.project.question.domain.dto.TaskKnowledgePointDTO; |
||||
|
import com.project.task.domain.enums.QuestionTypeEnum; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface PostToGenerateQuestionDomainService { |
||||
|
void postToGenerateQuestion(List<TaskKnowledgePointDTO> dtoList, QuestionTypeEnum questionType, int num) throws Exception; |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.project.interaction.domain.service.impl; |
||||
|
|
||||
|
import com.project.interaction.domain.service.PostToGenerateQuestionDomainService; |
||||
|
import com.project.question.domain.dto.TaskKnowledgePointDTO; |
||||
|
import com.project.question.domain.enums.QuestionSourceTypeEnum; |
||||
|
import com.project.task.domain.enums.QuestionTypeEnum; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class PostToGenerateQuestionDomainServiceImpl implements PostToGenerateQuestionDomainService { |
||||
|
|
||||
|
@Override |
||||
|
public void postToGenerateQuestion(List<TaskKnowledgePointDTO> dtoList, QuestionTypeEnum questionType, int num) throws Exception { |
||||
|
System.out.println(String.format("<=======生成了%d道%s, 结合了知识点【%s】属于%s=======>" , |
||||
|
num , |
||||
|
questionType.getDescription() , |
||||
|
String.join("," , dtoList.stream().map(dto -> dto.getId().toString()).toList()) , |
||||
|
dtoList.size() > 1 ? QuestionSourceTypeEnum.Multi_Concept.getDesc() : QuestionSourceTypeEnum.Single_Concept.getDesc())); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue