mirror of
https://github.com/PlayEdu/PlayEdu
synced 2026-02-25 16:36:21 +08:00
线上课增加admin_id字段
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user