|
|
@@ -133,7 +133,7 @@ public class GroupServiceImpl implements GroupService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = RuntimeException.class)
|
|
|
- public GroupRuleVO editGroupRule(GroupRuleVO ruleVO) {
|
|
|
+ public GroupRuleVO createGroupRule(GroupRuleVO ruleVO) {
|
|
|
Long teacherId = courseService
|
|
|
.findCourseById(ruleVO.getCourseVO().getId())
|
|
|
.getTeacher().getId();
|
|
|
@@ -148,6 +148,11 @@ public class GroupServiceImpl implements GroupService {
|
|
|
return groupRuleMapper.toGroupRuleVO(groupRule);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public GroupRuleVO findGroupRuleByCourseId(Long courseId) {
|
|
|
+ return groupRuleMapper.toGroupRuleVO(groupRuleRepository.findByCourse_Id(courseId).orElseThrow(CustomErrorException::groupRuleNotFound));
|
|
|
+ }
|
|
|
+
|
|
|
private String getGroupTableName(Long courseId) {
|
|
|
return "group_" + courseId;
|
|
|
}
|