courseService test end

master
river 4 years ago
parent e4401c2916
commit ff77ad9750
  1. 4
      src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java
  2. 1
      src/main/java/com/yipin/liuwanr/service/CourseService.java
  3. 171
      src/test/java/com/yipin/liuwanr/service/CourseServiceTest.java

@ -21,8 +21,8 @@ import com.yipin.liuwanr.entity.ProfessionalClass;
import com.yipin.liuwanr.entity.ServiceConfig;
import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.vo.CourseVO;
import org.apache.ibatis.annotations.Param;
import io.lettuce.core.dynamic.annotation.Param;
public interface CourseMapper {
@ -140,7 +140,7 @@ public interface CourseMapper {
+"</foreach>"
+ "</if>",
"</script> "})
List<ServiceConfig> queryAppConfig(String searchContent,@Param("systemId")List<Integer> systemId);
List<ServiceConfig> queryAppConfig(@Param("searchContent") String searchContent, @Param("systemId") List<Integer> systemId);
//查询实训配置
@Select({"<script>",

@ -272,6 +272,7 @@ public class CourseService {
resp.put("retvalue", courseMapper.queryAppConfig(searchContent,systemId));
resp.put("retcode", 200);
} catch (RuntimeException e) {
System.out.println(e.getMessage());
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");

@ -226,4 +226,175 @@ public class CourseServiceTest {
System.out.println("key:" + s + "," + "value:" + discipline.get(s));
}
}
/**
* 查询课程专业类
*/
@Test
@Transactional
public void queryCourseProfessionalClassTest(){
Integer disciplineId = 1;
HashMap<String, Object> courseProfessionalClass = courseService.queryCourseProfessionalClass(disciplineId);
for (String s : courseProfessionalClass.keySet()) {
System.out.println("key:" + s + "," + "value:" + courseProfessionalClass.get(s));
}
}
/**
* 查询课程专业
*/
@Test
@Transactional
public void queryCourseProfessionalTest(){
Integer professionalClassId = 2;
HashMap<String, Object> courseProfessional = courseService.queryCourseProfessional(professionalClassId);
for (String s : courseProfessional.keySet()) {
System.out.println("key:" + s + "," + "value:" + courseProfessional.get(s));
}
}
/**
* 查询应用配置
*/
@Test
@Transactional
public void queryAppConfigTest(){
String searchContent = "Python";
List<Integer> systemId = new ArrayList<>();
systemId.add(1);
HashMap<String, Object> appConfig = courseService.queryAppConfig(searchContent, systemId);
for (String s : appConfig.keySet()) {
System.out.println("key:" + s + "," + "value:" + appConfig.get(s));
}
}
/**
* 查询实训配置
*/
@Test
@Transactional
public void queryTrainingConfigTest(){
Integer courseId = 85;
HashMap<String, Object> trainingConfig = courseService.queryTrainingConfig(courseId);
for (String s : trainingConfig.keySet()) {
System.out.println("key:" + s + "," + "value:" + trainingConfig.get(s));
}
}
/**
* 绑定实训配置
*/
@Test
@Transactional
public void addTrainingConfigTest(){
Course course = new Course();
course.setSystemId("1");
course.setCourseId(85);
HashMap<String, Object> trainingConfig = courseService.addTrainingConfig(course);
for (String s : trainingConfig.keySet()) {
System.out.println("key:" + s + "," + "value:" + trainingConfig.get(s));
}
}
/**
* 查询环节详情
*/
@Test
@Transactional
public void queryLinkDetailsTest(){
CourseLink courseLink = new CourseLink();
courseLink.setProjectId(289);
courseLink.setCourseId(77);
HashMap<String, Object> linkDetails = courseService.queryLinkDetails(courseLink);
for (String s : linkDetails.keySet()) {
System.out.println("key:" + s + "," + "value:" + linkDetails.get(s));
}
}
/**
* 更新环节
*/
@Test
@Transactional
public void updateLinkTest(){
CourseLink courseLink = new CourseLink();
courseLink.setFileLink("www.baidu.com");
courseLink.setProjectId(1);
courseLink.setLinkName("测试");
courseLink.setLinkId(1);
HashMap<String, Object> link = courseService.updateLink(courseLink);
for (String s : link.keySet()) {
System.out.println("key:" + s + "," + "value:" + link.get(s));
}
}
/**
* 删除实训配置
*/
@Test
@Transactional
public void deleteTrainingConfigTest(){
Course course = new Course();
course.setCourseId(87);
HashMap<String, Object> deleteTrainingConfig = courseService.deleteTrainingConfig(course);
for (String s : deleteTrainingConfig.keySet()) {
System.out.println("key:" + s + "," + "value:" + deleteTrainingConfig.get(s));
}
}
/**
* 是否上架课程控制
*/
@Test
@Transactional
public void isShelvesTest(){
Course course = new Course();
course.setCourseId(87);
course.setIsShelves(1);
HashMap<String, Object> shelves = courseService.isShelves(course);
for (String s : shelves.keySet()) {
System.out.println("key:" + s + "," + "value:" + shelves.get(s));
}
}
/**
* 查询配置
*/
@Test
@Transactional
public void queryConfigTest(){
String systemId = "1";
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> queryConfig = courseService.queryConfig(systemId, pageNo, pageSize);
for (String s : queryConfig.keySet()) {
System.out.println("key:" + s + "," + "value:" + queryConfig.get(s));
}
}
/**
*
*/
@Test
@Transactional
public void platformQueryCourseTest(){
Integer schoolId = 305;
HashMap<String, Object> platformQueryCourse = courseService.platformQueryCourse(schoolId);
for (String s : platformQueryCourse.keySet()) {
System.out.println("key:" + s + "," + "value:" + platformQueryCourse.get(s));
}
}
/**
* 获取课程
*/
@Test
@Transactional
public void getcoueseTest(){
Integer courseId = 87;
HashMap<String, Object> getcouese = courseService.getcouese(courseId);
for (String s : getcouese.keySet()) {
System.out.println("key:" + s + "," + "value:" + getcouese.get(s));
}
}
}

Loading…
Cancel
Save