mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-25 20:35:35 +08:00
优化课程创建
This commit is contained in:
@@ -22,15 +22,17 @@ public class CourseHourRequest {
|
||||
@NotBlank(message = "请输入课时标题")
|
||||
private String title;
|
||||
|
||||
@NotNull(message = "duration参数不存在")
|
||||
private Integer duration;
|
||||
|
||||
@NotNull(message = "sort参数不存在")
|
||||
private Integer sort;
|
||||
|
||||
@NotNull(message = "type参数不存在")
|
||||
@NotBlank(message = "请选择课时类型")
|
||||
private String type;
|
||||
|
||||
@NotNull(message = "duration参数不存在")
|
||||
private Integer duration;
|
||||
|
||||
@NotNull(message = "published_at参数不存在")
|
||||
@JsonProperty("published_at")
|
||||
private Date publishedAt;
|
||||
@NotNull(message = "rid参数不存在")
|
||||
private Integer rid;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
* @create 2023/2/24 14:38
|
||||
@@ -31,4 +33,30 @@ public class CourseRequest {
|
||||
@NotNull(message = "category_ids参数不存在")
|
||||
@JsonProperty("category_ids")
|
||||
private Integer[] categoryIds;
|
||||
|
||||
// 格式
|
||||
// [
|
||||
// '章节名' => [
|
||||
// [
|
||||
// 'name' => '课时名',
|
||||
// 'type' => '课时类型', // 可选值[VIDEO]
|
||||
// 'duration' => 时长, // 单位[秒]
|
||||
// 'rid' => 资源ID, // 如果是type=VIDEO的话则对应视频的id
|
||||
// ]...
|
||||
// ]...
|
||||
// ]
|
||||
@NotNull(message = "chapters参数不存在")
|
||||
private Map<String, Map<String, Object>[]> chapters;
|
||||
|
||||
// 格式
|
||||
// [
|
||||
// [
|
||||
// 'name' => '课时名',
|
||||
// 'type' => '课时类型',
|
||||
// 'duration' => '时长',
|
||||
// 'rid' => '资源id',
|
||||
// ]...
|
||||
// ]
|
||||
@NotNull(message = "hours参数不存在")
|
||||
private Map<String, Object>[] hours;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user