小bug 修复
This commit is contained in:
@@ -30,4 +30,6 @@ public class CourseEntity {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<CourseCatalogueEntity> courseCatalogueEntityList;
|
private List<CourseCatalogueEntity> courseCatalogueEntityList;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer bindId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class CourseSociologyController {
|
|||||||
@RequestMapping("/addCourseSociology")
|
@RequestMapping("/addCourseSociology")
|
||||||
public R addCourseSociology(@RequestBody CourseSociologyEntity courseSociologyEntity){
|
public R addCourseSociology(@RequestBody CourseSociologyEntity courseSociologyEntity){
|
||||||
courseSociologyService.save(courseSociologyEntity);
|
courseSociologyService.save(courseSociologyEntity);
|
||||||
return R.ok();
|
return R.ok().put("sociology",courseSociologyEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/delCourseSociology")
|
@RequestMapping("/delCourseSociology")
|
||||||
@@ -69,8 +69,12 @@ public class CourseSociologyController {
|
|||||||
|
|
||||||
@RequestMapping("/unbindCourseAndSociology")
|
@RequestMapping("/unbindCourseAndSociology")
|
||||||
public R unbindCourseAndSociology(@RequestBody CourseToSociologyEntity courseToSociologyEntity){
|
public R unbindCourseAndSociology(@RequestBody CourseToSociologyEntity courseToSociologyEntity){
|
||||||
courseToSociologyService.removeById(courseToSociologyEntity.getId());
|
boolean b = courseToSociologyService.removeById(courseToSociologyEntity.getId());
|
||||||
|
if(b){
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
}else {
|
||||||
|
return R.error("error");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
public List<CourseEntity> getCourseListForSociology(int sociologyId) {
|
public List<CourseEntity> getCourseListForSociology(int sociologyId) {
|
||||||
MPJLambdaWrapper<CourseToSociologyEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<CourseToSociologyEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(CourseEntity.class);
|
wrapper.selectAll(CourseEntity.class);
|
||||||
|
wrapper.selectAs(CourseToSociologyEntity::getId,"bindId");
|
||||||
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToSociologyEntity::getCourseId);
|
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToSociologyEntity::getCourseId);
|
||||||
wrapper.eq(CourseToSociologyEntity::getSociologyId,sociologyId);
|
wrapper.eq(CourseToSociologyEntity::getSociologyId,sociologyId);
|
||||||
List<CourseEntity> courseEntities = courseToSociologyDao.selectJoinList(CourseEntity.class, wrapper);
|
List<CourseEntity> courseEntities = courseToSociologyDao.selectJoinList(CourseEntity.class, wrapper);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class CourseSociologyServiceImpl extends ServiceImpl<CourseSociologyDao,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.updateById(courseSociologyEntity);
|
this.updateById(courseSociologyEntity);
|
||||||
return R.ok();
|
return R.ok().put("sociology",courseSociologyEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<CourseSociologyEntity> sociologys(int id){
|
private List<CourseSociologyEntity> sociologys(int id){
|
||||||
|
|||||||
Reference in New Issue
Block a user