课程增加简介字段

This commit is contained in:
none
2023-03-21 15:03:21 +08:00
parent 57535a2ce7
commit a2a1206ec7
5 changed files with 33 additions and 19 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 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);

View File

@@ -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);