mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-22 18:29:51 +08:00
课程增加简介字段
This commit is contained in:
@@ -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 isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds);
|
||||
Course createWithCategoryIdsAndDepIds(String title, String thumb, String shortDesc, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds);
|
||||
|
||||
void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds);
|
||||
void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, String shortDesc, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds);
|
||||
|
||||
void relateDepartments(Course course, Integer[] depIds);
|
||||
|
||||
|
||||
@@ -47,11 +47,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Course createWithCategoryIdsAndDepIds(String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
|
||||
public Course createWithCategoryIdsAndDepIds(String title, String thumb, String shortDesc, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
|
||||
// 创建课程
|
||||
Course course = new Course();
|
||||
course.setTitle(title);
|
||||
course.setThumb(thumb);
|
||||
course.setShortDesc(shortDesc);
|
||||
course.setIsShow(isShow);
|
||||
course.setIsRequired(isRequired);
|
||||
course.setCreatedAt(new Date());
|
||||
@@ -111,13 +112,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, Integer isRequired, Integer isShow, Integer[] categoryIds, Integer[] depIds) {
|
||||
public void updateWithCategoryIdsAndDepIds(Course course, String title, String thumb, String shortDesc, 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);
|
||||
newCourse.setShortDesc(shortDesc);
|
||||
|
||||
updateById(newCourse);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user