实现敏感词检测后,失败发生邮箱
This commit is contained in:
@@ -429,6 +429,12 @@ public class SCCourseServiceImpl implements SCCourseService {
|
||||
public ResultDomain<TbCourse> updateCourseStatus(TbCourse course) {
|
||||
ResultDomain<TbCourse> resultDomain = new ResultDomain<>();
|
||||
if(course.getStatus()==1){ // 发布前审核
|
||||
// 更新为审核中
|
||||
TbCourse course2 = new TbCourse();
|
||||
course2.setCourseID(course.getCourseID());
|
||||
course2.setStatus(3);
|
||||
course2.setUpdateTime(new Date());
|
||||
courseMapper.updateCourse(course2);
|
||||
// 获取所有课程节点
|
||||
List<TbCourseNode> nodeList = courseNodeMapper.selectByCourseId(course.getCourseID());
|
||||
List<TbCourseNode> notPassList = new ArrayList<>();
|
||||
@@ -441,39 +447,52 @@ public class SCCourseServiceImpl implements SCCourseService {
|
||||
ResultDomain<ResourceVO> resourceDomain = resourceService.getResourceById(node.getResourceID());
|
||||
if (resourceDomain.isSuccess()) {
|
||||
if (!resourceDomain.getData().getResource().getIsAudited()) {
|
||||
ResultDomain<Boolean> pass = auditService.auditText(resourceDomain.getData().getResource().getContent());
|
||||
if(!pass.isSuccess() || !pass.getData()){
|
||||
// 审核失败,标记课程状态为3(审核失败)
|
||||
course.setStatus(3);
|
||||
ResultDomain<String> pass = auditService.auditText(resourceDomain.getData().getResource().getTitle()+" "+resourceDomain.getData().getResource().getContent());
|
||||
if(!pass.isSuccess()){
|
||||
// 审核失败,标记课程状态为4(审核失败)
|
||||
course.setStatus(4);
|
||||
course.setUpdateTime(new Date());
|
||||
courseMapper.updateCourse(course);
|
||||
auditService.sendAuditResultMessage(node.getCreator(), "课程节点:"+node.getName(), pass.getDataList());
|
||||
|
||||
resultDomain.fail("课程节点:"+node.getName()+"审核未通过");
|
||||
return resultDomain;
|
||||
}else{
|
||||
// 更新文章的审核状态
|
||||
ResourceVO resource = new ResourceVO();
|
||||
resource.setResource(new TbResource());
|
||||
resource.getResource().setResourceID(node.getResourceID());
|
||||
resource.getResource().setIsAudited(true);
|
||||
resourceService.updateResource(resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if (type == 2){
|
||||
ResultDomain<Boolean> pass = auditService.auditByFileId(node.getResourceID());
|
||||
if(!pass.isSuccess() || !pass.getData()){
|
||||
// 审核失败,标记课程状态为3(审核失败)
|
||||
course.setStatus(3);
|
||||
ResultDomain<String> pass = auditService.auditByFileId(node.getResourceID());
|
||||
if(!pass.isSuccess()){
|
||||
// 审核失败,标记课程状态为4(审核失败)
|
||||
course.setStatus(4);
|
||||
course.setUpdateTime(new Date());
|
||||
courseMapper.updateCourse(course);
|
||||
|
||||
auditService.sendAuditResultMessage(node.getCreator(), "课程节点:"+node.getName(), pass.getDataList());
|
||||
resultDomain.fail("课程节点:"+node.getName()+"审核未通过");
|
||||
return resultDomain;
|
||||
}
|
||||
}else{
|
||||
ResultDomain<Boolean> pass = auditService.auditText(node.getContent());
|
||||
if(!pass.isSuccess() || !pass.getData()){
|
||||
ResultDomain<String> pass = auditService.auditText(node.getContent());
|
||||
if(!pass.isSuccess()){
|
||||
// 审核失败,标记课程状态为3(审核失败)
|
||||
course.setStatus(3);
|
||||
course.setUpdateTime(new Date());
|
||||
courseMapper.updateCourse(course);
|
||||
auditService.sendAuditResultMessage(node.getCreator(), "课程节点:"+node.getName(), pass.getDataList());
|
||||
|
||||
resultDomain.fail("课程节点:"+node.getName()+"审核未通过");
|
||||
return resultDomain;
|
||||
}else{
|
||||
// 更新node审核状态
|
||||
node.setIsAudited(true);
|
||||
courseNodeMapper.updateCourseNode(node);
|
||||
}
|
||||
}
|
||||
node.setIsAudited(true);
|
||||
|
||||
Reference in New Issue
Block a user