线上课增加必修课、选修课属性

This commit is contained in:
none
2023-03-20 14:33:19 +08:00
parent 48a1597998
commit 1fdbc2fdca
8 changed files with 67 additions and 36 deletions

View File

@@ -18,9 +18,9 @@ public interface CourseService extends IService<Course> {
PaginationResult<Course> paginate(int page, int size, CoursePaginateFiler filter);
Course createWithCategoryIdsAndDepIds(String title, String thumb, Integer isShow, Integer[] categoryIds, Integer[] depIds);
Course createWithCategoryIdsAndDepIds(String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds);
void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, Integer isShow, Integer[] categoryIds, Integer[] depIds);
void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds);
void relateDepartments(Course course, Integer[] depIds);

View File

@@ -47,12 +47,13 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
@Override
@Transactional
public Course createWithCategoryIdsAndDepIds(String title, String thumb, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
public Course createWithCategoryIdsAndDepIds(String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
// 创建课程
Course course = new Course();
course.setTitle(title);
course.setThumb(thumb);
course.setIsShow(isShow);
course.setIsRequired(isRequired);
course.setCreatedAt(new Date());
course.setUpdatedAt(new Date());
save(course);
@@ -110,12 +111,13 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
@Override
@Transactional
public void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
public void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
Course newCourse = new Course();
newCourse.setId(course.getId());
newCourse.setTitle(title);
newCourse.setThumb(thumb);
newCourse.setIsShow(isShow);
newCourse.setIsRequired(isRequired);
updateById(newCourse);