修改接口

master
xiaoCJ 8 months ago
parent 6139e22fb3
commit 509419ce25

@ -115,9 +115,10 @@ public class CaseApi {
@ApiOperation("案例题详细内容展示")
@PostMapping("selectCaseDetails")
public SysCaseQuestion selectCaseByConditionsByID(@RequestParam String caseId,
@RequestParam String oneId) {
@RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andOneIdEqualTo(oneId).andTopicIdEqualTo(caseId);
example.createCriteria().andOneIdEqualTo(sysOneCatalogs.getOneId()).andTopicIdEqualTo(caseId);
List<SysTopicAndCourse> sysTopicAndCourses = topicAndCourseMapper.selectByExample(example);
if (sysTopicAndCourses != null && !sysTopicAndCourses.isEmpty()) {
SysTopicAndCourse sysTopicAndCourse = sysTopicAndCourses.get(0);

@ -4,9 +4,7 @@ import cn.hutool.core.util.IdUtil;
import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.config.Constant;
import com.sztzjy.resource_center.entity.*;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper;
import com.sztzjy.resource_center.mapper.SysThreeCatalogMapper;
import com.sztzjy.resource_center.mapper.SysTwoCatalogMapper;
import com.sztzjy.resource_center.mapper.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
@Api(tags = "课程方面API")
@ -27,6 +25,16 @@ public class CourseApi {
SysOneCatalogMapper oneCatalogMapper;
@Autowired
SysThreeCatalogMapper threeCatalogMapper;
@Autowired
SysTopicAndCourseMapper sysTopicAndCourseMapper;
@Autowired
SysResourceAndCourseMapper sysResourceAndCourseMapper;
@Autowired
SysResourceMapper sysResourceMapper;
@Autowired
SysObjectiveQuestionsMapper sysObjectiveQuestionsMapper;
@Autowired
SysCaseQuestionMapper sysCaseQuestionMapper;
@AnonymousAccess
@ApiOperation("查看二级目录")
@ -115,6 +123,15 @@ public class CourseApi {
return false;
}
twoCatalogMapper.deleteByPrimaryKey(twoId);
//删除资源
SysResourceAndCourseExample example1 = new SysResourceAndCourseExample();
example1.createCriteria().andTwoIdEqualTo(twoId);
sysResourceAndCourseMapper.deleteByExample(example1);
//删除题目
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
example.createCriteria().andTwoIdEqualTo(twoId);
sysTopicAndCourseMapper.deleteByExample(example);
return true;
} catch (Exception e) {
e.printStackTrace();
@ -217,6 +234,6 @@ public class CourseApi {
@RequestParam String systemOwner) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId();
return threeCatalogMapper.selectNameByCourseID(schoolId,oneId);
return threeCatalogMapper.selectNameByCourseID(schoolId, oneId);
}
}

@ -490,8 +490,7 @@
<select id="selectObjByType" parameterType="java.lang.String" resultMap="DtoMap">
SELECT s.objective_id, s.content, sc.two_name, three_name
FROM sys_objective_questions s
LEFT JOIN sys_topic_and_course sc
on s.objective_id = sc.topic_id
JOIN sys_topic_and_course sc on s.objective_id = sc.topic_id
WHERE s.source in ('管理员', #{schoolId})
and s.is_delete = FALSE
and s.type = #{type}

Loading…
Cancel
Save