| | |
| | | import cc.mrbird.febs.ai.service.*; |
| | | import cc.mrbird.febs.ai.utils.UUID; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUnit; |
| | |
| | | String productId = dto.getId(); |
| | | AiProduct aiProduct = aiProductService.getById(productId); |
| | | if(ObjectUtil.isNull(aiProduct)){ |
| | | throw new RuntimeException("产品不存在"); |
| | | throw new FebsException("产品不存在"); |
| | | } |
| | | //验证产品分类下是否有题目 |
| | | String productCategoryId = aiProduct.getProductCategoryId(); |
| | |
| | | List<AiProductQuestion> aiProductQuestions = aiProductQuestionService.getListByQuery(questionLambdaQueryWrapper); |
| | | if(CollUtil.isEmpty(aiProductQuestions)){ |
| | | // todo 没有题目采用AI生成题目 |
| | | throw new RuntimeException("产品没有题目"); |
| | | throw new FebsException("产品没有题目"); |
| | | } |
| | | //判断该产品是否有正在进行的练习 |
| | | Date createdTime = new Date(); |
| | |
| | | String productId = dto.getId(); |
| | | AiProduct aiProduct = aiProductService.getById(productId); |
| | | if(ObjectUtil.isNull(aiProduct)){ |
| | | throw new RuntimeException("产品不存在"); |
| | | throw new FebsException("产品不存在"); |
| | | } |
| | | //验证产品分类下是否有题目 |
| | | String productCategoryId = aiProduct.getProductCategoryId(); |
| | |
| | | List<AiProductQuestion> aiProductQuestions = aiProductQuestionService.getListByQuery(questionLambdaQueryWrapper); |
| | | if(CollUtil.isEmpty(aiProductQuestions)){ |
| | | // todo 没有题目采用AI生成题目 |
| | | throw new RuntimeException("产品没有题目"); |
| | | throw new FebsException("产品没有题目"); |
| | | } |
| | | //判断该产品是否有正在进行的练习 |
| | | Date createdTime = new Date(); |
| | |
| | | AiMemberAnswer aiMemberAnswer = this.getById(memberAnswerId); |
| | | |
| | | if(ObjectUtil.isNull(aiMemberAnswer)){ |
| | | throw new RuntimeException("答题记录不存在"); |
| | | throw new FebsException("答题记录不存在"); |
| | | } |
| | | |
| | | Date createdTime = new Date(); |