线上课增加admin_id字段

This commit is contained in:
xxx
2023-11-13 10:08:52 +08:00
parent 179a7d5f62
commit ee1f009966
7 changed files with 69 additions and 3 deletions

View File

@@ -69,6 +69,9 @@ public class Course implements Serializable {
@JsonProperty("created_at")
private Date createdAt;
@JsonProperty("admin_id")
private Integer adminId;
@JsonIgnore private Date updatedAt;
@JsonIgnore private Date deletedAt;

View File

@@ -42,7 +42,8 @@ public interface CourseService extends IService<Course> {
Integer isRequired,
Integer isShow,
Integer[] categoryIds,
Integer[] depIds);
Integer[] depIds,
Integer adminId);
void updateWithCategoryIdsAndDepIds(
Course course,

View File

@@ -68,7 +68,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
Integer isRequired,
Integer isShow,
Integer[] categoryIds,
Integer[] depIds) {
Integer[] depIds,
Integer adminId) {
// 创建课程
Course course = new Course();
course.setTitle(title);
@@ -79,6 +80,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
course.setPublishedAt(new Date());
course.setCreatedAt(new Date());
course.setUpdatedAt(new Date());
course.setAdminId(adminId);
save(course);
// 关联分类
relateCategories(course, categoryIds);

View File

@@ -75,6 +75,9 @@
<if test="title != null and title != ''">
AND `courses`.`title` LIKE concat('%',#{title},'%')
</if>
<if test="adminId != null">
AND `courses`.`admin_id` = #{adminId}
</if>
<if test="isRequired != null">
AND `courses`.`is_required` = #{isRequired}
</if>
@@ -164,6 +167,9 @@
<if test="title != null and title != ''">
AND `courses`.`title` LIKE concat('%',#{title},'%')
</if>
<if test="adminId != null">
AND `courses`.`admin_id` = #{adminId}
</if>
<if test="isRequired != null">
AND `courses`.`is_required` = #{isRequired}
</if>