修改api结构
This commit is contained in:
98
server/api/course/course_activity/course_activity.api
Normal file
98
server/api/course/course_activity/course_activity.api
Normal file
@@ -0,0 +1,98 @@
|
||||
// 创建课程活动请求(无需id,由数据库自增生成)
|
||||
type CreateCourseActivityReq {
|
||||
CourseId int `json:"course_id" form:"course_id" validate:"required"` // 关联课程ID(必填,外键)
|
||||
Title string `json:"title" form:"title" validate:"required,max=255"` // 活动标题(必填,最长255字符)
|
||||
ActivityType int `json:"activity_type" form:"activity_type" validate:"omitempty,min=1,max=4"` // 活动类型(可选,1-作业/2-考试/3-讨论/4-直播,默认1)
|
||||
Content string `json:"content" form:"content"` // 活动详情(可选,文本)
|
||||
StartTime string `json:"start_time" form:"start_time" validate:"omitempty,datetime=2006-01-02 15:04:05"` // 开始时间(可选,格式yyyy-MM-dd HH:mm:ss)
|
||||
EndTime string `json:"end_time" form:"end_time" validate:"omitempty,datetime=2006-01-02 15:04:05"` // 结束时间(可选,格式同上)
|
||||
Sort int `json:"sort" form:"sort" validate:"omitempty,min=0"` // 排序(可选,默认0)
|
||||
}
|
||||
|
||||
// 创建课程活动响应
|
||||
type CreateCourseActivityResp {
|
||||
Id int `json:"id"` // 新增活动的ID
|
||||
Message string `json:"message"` // 操作结果信息
|
||||
}
|
||||
|
||||
// 查询单个课程活动请求(按ID查询)
|
||||
type GetCourseActivityReq {
|
||||
Id int `json:"id" form:"id" param:"id" validate:"required"` // 活动ID(必填,从路径参数获取)
|
||||
}
|
||||
|
||||
// 查询单个课程活动响应(返回完整活动信息)
|
||||
type GetCourseActivityResp {
|
||||
Id int `json:"id"` // 活动ID
|
||||
CourseId int `json:"course_id"` // 关联课程ID
|
||||
Title string `json:"title"` // 活动标题
|
||||
ActivityType int `json:"activity_type"` // 活动类型(1-作业/2-考试/3-讨论/4-直播)
|
||||
Content string `json:"content"` // 活动详情
|
||||
StartTime string `json:"start_time"` // 开始时间(格式化字符串)
|
||||
EndTime string `json:"end_time"` // 结束时间(格式化字符串)
|
||||
Sort int `json:"sort"` // 排序
|
||||
}
|
||||
|
||||
// 课程活动列表查询请求(支持筛选和分页)
|
||||
type ListCourseActivityReq {
|
||||
CourseId int `json:"course_id" form:"course_id" validate:"omitempty"` // 可选筛选:按课程ID查询
|
||||
ActivityType int `json:"activity_type" form:"activity_type" validate:"omitempty,min=1,max=4"` // 可选筛选:按活动类型查询
|
||||
Page int `json:"page" form:"page" validate:"required,min=1"` // 页码(必填,从1开始)
|
||||
PageSize int `json:"page_size" form:"page_size" validate:"required,min=1,max=100"` // 每页条数(必填,1-100)
|
||||
}
|
||||
|
||||
// 课程活动列表响应
|
||||
type ListCourseActivityResp {
|
||||
Total int `json:"total"` // 总条数
|
||||
List []GetCourseActivityResp `json:"list"` // 活动列表(单条结构同查询单个响应)
|
||||
Page int `json:"page"` // 当前页码
|
||||
PageSize int `json:"page_size"` // 每页条数
|
||||
}
|
||||
|
||||
// 更新课程活动请求
|
||||
type UpdateCourseActivityReq {
|
||||
Id int `json:"id" form:"id" validate:"required"` // 活动ID(必填)
|
||||
CourseId int `json:"course_id" form:"course_id" validate:"omitempty"` // 可选更新:关联课程ID
|
||||
Title string `json:"title" form:"title" validate:"omitempty,max=255"` // 可选更新:活动标题
|
||||
ActivityType int `json:"activity_type" form:"activity_type" validate:"omitempty,min=1,max=4"` // 可选更新:活动类型
|
||||
Content string `json:"content" form:"content"` // 可选更新:活动详情
|
||||
StartTime string `json:"start_time" form:"start_time" validate:"omitempty,datetime=2006-01-02 15:04:05"` // 可选更新:开始时间
|
||||
EndTime string `json:"end_time" form:"end_time" validate:"omitempty,datetime=2006-01-02 15:04:05"` // 可选更新:结束时间
|
||||
Sort int `json:"sort" form:"sort" validate:"omitempty,min=0"` // 可选更新:排序
|
||||
}
|
||||
|
||||
// 更新课程活动响应
|
||||
type UpdateCourseActivityResp {
|
||||
Message string `json:"message"` // 操作结果信息
|
||||
}
|
||||
|
||||
// 删除课程活动请求
|
||||
type DeleteCourseActivityReq {
|
||||
Id int `json:"id" form:"id" param:"id" validate:"required"` // 活动ID(必填,从路径参数获取)
|
||||
}
|
||||
|
||||
// 删除课程活动响应
|
||||
type DeleteCourseActivityResp {
|
||||
Message string `json:"message"` // 操作结果信息
|
||||
}
|
||||
|
||||
@server (
|
||||
group: course_activity // 接口分组:课程活动
|
||||
prefix: /api/course-activity
|
||||
)
|
||||
service course_activity_api { // 服务名称:课程活动API
|
||||
@handler CreateCourseActivityHandler // 创建课程活动
|
||||
post /course-activity (CreateCourseActivityReq) returns (CreateCourseActivityResp)
|
||||
|
||||
@handler GetCourseActivityHandler // 查询单个课程活动
|
||||
get /course-activity/:id (GetCourseActivityReq) returns (GetCourseActivityResp)
|
||||
|
||||
@handler ListCourseActivityHandler // 课程活动列表查询(支持分页/筛选)
|
||||
post /course-activity/list (ListCourseActivityReq) returns (ListCourseActivityResp)
|
||||
|
||||
@handler UpdateCourseActivityHandler // 更新课程活动
|
||||
put /course-activity (UpdateCourseActivityReq) returns (UpdateCourseActivityResp)
|
||||
|
||||
@handler DeleteCourseActivityHandler // 删除课程活动
|
||||
delete /course-activity/:id (DeleteCourseActivityReq) returns (DeleteCourseActivityResp)
|
||||
}
|
||||
|
||||
105
server/api/course/course_content/course_content.api
Normal file
105
server/api/course/course_content/course_content.api
Normal file
@@ -0,0 +1,105 @@
|
||||
// 课程内容请求和响应类型定义
|
||||
type CourseContent {
|
||||
Id int `json:"id"` // 内容ID(主键)
|
||||
CourseId int `json:"course_id"` // 关联课程ID
|
||||
ParentId int `json:"parent_id"` // 父级ID(0表示章节,>0表示小节)
|
||||
Title string `json:"title"` // 章节/小节标题
|
||||
Content string `json:"content"` // 内容详情
|
||||
Sort int `json:"sort"` // 排序
|
||||
}
|
||||
|
||||
// 基础响应结构
|
||||
type BaseResp {
|
||||
Code int `json:"code"` // 状态码,0表示成功
|
||||
Message string `json:"message"` // 提示信息
|
||||
Data interface{} `json:"data"` // 响应数据
|
||||
}
|
||||
|
||||
// 获取课程内容列表请求
|
||||
type GetContentListReq {
|
||||
CourseId int `json:"course_id" form:"course_id"` // 课程ID,必填
|
||||
ParentId int `json:"parent_id" form:"parent_id"` // 父级ID,可选,0表示获取章节
|
||||
}
|
||||
|
||||
// 获取课程内容列表响应
|
||||
type GetContentListResp {
|
||||
BaseResp
|
||||
Data []CourseContent `json:"data"` // 内容列表
|
||||
}
|
||||
|
||||
// 获取单个内容详情请求
|
||||
type GetContentReq {
|
||||
Id int `json:"id" form:"id" uri:"id"` // 内容ID,必填
|
||||
}
|
||||
|
||||
// 获取单个内容详情响应
|
||||
type GetContentResp {
|
||||
BaseResp
|
||||
Data CourseContent `json:"data"` // 内容详情
|
||||
}
|
||||
|
||||
// 新增内容请求
|
||||
type AddContentReq {
|
||||
CourseId int `json:"course_id" form:"course_id"` // 课程ID,必填
|
||||
ParentId int `json:"parent_id" form:"parent_id"` // 父级ID,必填
|
||||
Title string `json:"title" form:"title"` // 标题,必填
|
||||
Content string `json:"content" form:"content"` // 内容详情,可选
|
||||
Sort int `json:"sort" form:"sort"` // 排序,可选
|
||||
}
|
||||
|
||||
// 新增内容响应
|
||||
type AddContentResp {
|
||||
BaseResp
|
||||
Data int `json:"data"` // 新增内容的ID
|
||||
}
|
||||
|
||||
// 更新内容请求
|
||||
type UpdateContentReq {
|
||||
Id int `json:"id" form:"id"` // 内容ID,必填
|
||||
Title string `json:"title" form:"title"` // 标题,可选
|
||||
Content string `json:"content" form:"content"` // 内容详情,可选
|
||||
Sort int `json:"sort" form:"sort"` // 排序,可选
|
||||
}
|
||||
|
||||
// 更新内容响应
|
||||
type UpdateContentResp {
|
||||
BaseResp
|
||||
}
|
||||
|
||||
// 删除内容请求
|
||||
type DeleteContentReq {
|
||||
Id int `json:"id" form:"id" uri:"id"` // 内容ID,必填
|
||||
}
|
||||
|
||||
// 删除内容响应
|
||||
type DeleteContentResp {
|
||||
BaseResp
|
||||
}
|
||||
|
||||
// 课程内容API服务
|
||||
@server (
|
||||
group: course_content
|
||||
prefix: /api/course-content
|
||||
)
|
||||
service course_content_api {
|
||||
// 获取课程内容列表
|
||||
@handler GetContentListHandler
|
||||
get /api/course-content/list (GetContentListReq) returns (GetContentListResp)
|
||||
|
||||
// 获取单个内容详情
|
||||
@handler GetContentHandler
|
||||
get /api/course-content/:id (GetContentReq) returns (GetContentResp)
|
||||
|
||||
// 新增内容
|
||||
@handler AddContentHandler
|
||||
post /api/course-content (AddContentReq) returns (AddContentResp)
|
||||
|
||||
// 更新内容
|
||||
@handler UpdateContentHandler
|
||||
put /api/course-content (UpdateContentReq) returns (UpdateContentResp)
|
||||
|
||||
// 删除内容
|
||||
@handler DeleteContentHandler
|
||||
delete /api/course-content/:id (DeleteContentReq) returns (DeleteContentResp)
|
||||
}
|
||||
|
||||
72
server/api/course/course_file/course_file.api
Normal file
72
server/api/course/course_file/course_file.api
Normal file
@@ -0,0 +1,72 @@
|
||||
// 课程文件创建请求(无需id、create_time、update_time,由数据库自动生成)
|
||||
type CreateCourseFileReq {
|
||||
ContentId int `json:"content_id" form:"content_id" validate:"required"` // 关联的内容ID(必填)
|
||||
Title string `json:"title" form:"title" validate:"required,max=255"` // 文件标题(必填,最长255字符)
|
||||
FileType string `json:"file_type" form:"file_type" validate:"required,max=30"` // 文件类型(必填,最长30字符)
|
||||
FileUrl string `json:"file_url" form:"file_url" validate:"required,max=255"` // 文件URL(必填,最长255字符)
|
||||
}
|
||||
|
||||
// 课程文件创建响应
|
||||
type CreateCourseFileResp {
|
||||
Id int `json:"id"` // 新增文件的ID
|
||||
Message string `json:"message"` // 操作结果信息
|
||||
}
|
||||
|
||||
// 课程文件查询请求(根据ID查询)
|
||||
type GetCourseFileReq {
|
||||
Id int `json:"id" form:"id" param:"id" validate:"required"` // 文件ID(必填,从路径参数获取)
|
||||
}
|
||||
|
||||
// 课程文件查询响应(返回完整文件信息)
|
||||
type GetCourseFileResp {
|
||||
Id int `json:"id"` // 文件ID
|
||||
ContentId int `json:"content_id"` // 关联的内容ID
|
||||
Title string `json:"title"` // 文件标题
|
||||
FileType string `json:"file_type"` // 文件类型
|
||||
FileUrl string `json:"file_url"` // 文件URL
|
||||
CreateTime string `json:"create_time"` // 创建时间(格式化字符串)
|
||||
UpdateTime string `json:"update_time"` // 更新时间(格式化字符串)
|
||||
}
|
||||
|
||||
// 课程文件更新请求(部分字段更新)
|
||||
type UpdateCourseFileReq {
|
||||
Id int `json:"id" form:"id" validate:"required"` // 文件ID(必填)
|
||||
ContentId int `json:"content_id" form:"content_id"` // 可选:更新关联的内容ID
|
||||
Title string `json:"title" form:"title" validate:"omitempty,max=255"` // 可选:更新标题
|
||||
FileType string `json:"file_type" form:"file_type" validate:"omitempty,max=30"` // 可选:更新文件类型
|
||||
FileUrl string `json:"file_url" form:"file_url" validate:"omitempty,max=255"` // 可选:更新文件URL
|
||||
}
|
||||
|
||||
// 课程文件更新响应
|
||||
type UpdateCourseFileResp {
|
||||
Message string `json:"message"` // 操作结果信息
|
||||
}
|
||||
|
||||
// 课程文件删除请求
|
||||
type DeleteCourseFileReq {
|
||||
Id int `json:"id" form:"id" param:"id" validate:"required"` // 文件ID(必填,从路径参数获取)
|
||||
}
|
||||
|
||||
// 课程文件删除响应
|
||||
type DeleteCourseFileResp {
|
||||
Message string `json:"message"` // 操作结果信息
|
||||
}
|
||||
|
||||
@server (
|
||||
group: course_file // 接口分组改为课程文件相关
|
||||
prefix: /api/course-file
|
||||
)
|
||||
service course_file_api { // 服务名称修改为课程文件API
|
||||
@handler CreateCourseFileHandler // 创建课程文件
|
||||
post /course-file (CreateCourseFileReq) returns (CreateCourseFileResp)
|
||||
|
||||
@handler GetCourseFileHandler // 查询单个课程文件
|
||||
get /course-file/:id (GetCourseFileReq) returns (GetCourseFileResp)
|
||||
|
||||
@handler UpdateCourseFileHandler // 更新课程文件
|
||||
put /course-file (UpdateCourseFileReq) returns (UpdateCourseFileResp)
|
||||
|
||||
@handler DeleteCourseFileHandler // 删除课程文件
|
||||
delete /course-file/:id (DeleteCourseFileReq) returns (DeleteCourseFileResp)
|
||||
}
|
||||
|
||||
0
server/api/course/course_teacher/course_teacher.api
Normal file
0
server/api/course/course_teacher/course_teacher.api
Normal file
75
server/api/course/maincourse/course.api
Normal file
75
server/api/course/maincourse/course.api
Normal file
@@ -0,0 +1,75 @@
|
||||
// 课程请求结构体
|
||||
type CreateCourseReq {
|
||||
Title string `json:"title" validate:"required"` // 课程标题
|
||||
Subtitle string `json:"subtitle"` // 课程副标题
|
||||
CoverUrl string `json:"cover_url"` // 课程封面图URL
|
||||
Intro string `json:"intro"` // 课程简介
|
||||
Status int8 `json:"status" default:"1"` // 课程状态(0删除,1-已发布)
|
||||
}
|
||||
|
||||
type UpdateCourseReq {
|
||||
Id int64 `json:"id" validate:"required"` // 课程ID
|
||||
Title string `json:"title"` // 课程标题
|
||||
Subtitle string `json:"subtitle"` // 课程副标题
|
||||
CoverUrl string `json:"cover_url"` // 课程封面图URL
|
||||
Intro string `json:"intro"` // 课程简介
|
||||
Status int8 `json:"status"` // 课程状态(0删除,1-已发布)
|
||||
}
|
||||
|
||||
type GetCourseReq {
|
||||
Id int64 `json:"id" validate:"required"` // 课程ID
|
||||
}
|
||||
|
||||
type DeleteCourseReq {
|
||||
Id int64 `json:"id" validate:"required"` // 课程ID
|
||||
}
|
||||
|
||||
type ListCourseReq {
|
||||
Page int `json:"page" default:"1"` // 页码
|
||||
Size int `json:"size" default:"10"` // 每页数量
|
||||
Status int8 `json:"status"` // 课程状态筛选
|
||||
Keyword string `json:"keyword"` // 搜索关键词(标题/副标题)
|
||||
}
|
||||
|
||||
// 课程响应结构体
|
||||
type CourseResp {
|
||||
Id int64 `json:"id"` // 课程ID
|
||||
Title string `json:"title"` // 课程标题
|
||||
Subtitle string `json:"subtitle"` // 课程副标题
|
||||
CoverUrl string `json:"cover_url"` // 课程封面图URL
|
||||
Intro string `json:"intro"` // 课程简介
|
||||
Status int8 `json:"status"` // 课程状态
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
type ListCourseResp {
|
||||
Total int64 `json:"total"` // 总条数
|
||||
List []CourseResp `json:"list"` // 课程列表
|
||||
}
|
||||
|
||||
type BaseResp {
|
||||
Code int `json:"code"` // 状态码(0成功,非0失败)
|
||||
Msg string `json:"msg"` // 提示信息
|
||||
}
|
||||
|
||||
@server (
|
||||
group: course
|
||||
)
|
||||
service course-api {
|
||||
@handler CreateCourseHandler
|
||||
post /api/courses (CreateCourseReq) returns (BaseResp)
|
||||
|
||||
@handler UpdateCourseHandler
|
||||
put /api/courses (UpdateCourseReq) returns (BaseResp)
|
||||
|
||||
@handler GetCourseHandler
|
||||
get /api/courses/:id (GetCourseReq) returns (CourseResp)
|
||||
|
||||
@handler DeleteCourseHandler
|
||||
delete /api/courses/:id (DeleteCourseReq) returns (BaseResp)
|
||||
|
||||
@handler ListCourseHandler
|
||||
get /api/courses (ListCourseReq) returns (ListCourseResp)
|
||||
}
|
||||
|
||||
82
server/api/course/teaching_case/teaching_case.api
Normal file
82
server/api/course/teaching_case/teaching_case.api
Normal file
@@ -0,0 +1,82 @@
|
||||
// 教学案例请求结构体
|
||||
type CreateTeachingCaseReq {
|
||||
Title string `json:"title" validate:"required"` // 案例标题
|
||||
TutorName string `json:"tutor_name" validate:"required"` // 导师姓名
|
||||
TutorTitle string `json:"tutor_title"` // 导师头衔
|
||||
StudentNames string `json:"student_names" validate:"required"` // 学生姓名(逗号分隔)
|
||||
Content string `json:"content" validate:"required"` // 案例内容
|
||||
CoverUrl string `json:"cover_url"` // 案例封面图URL
|
||||
Sort int `json:"sort" default:"0"` // 排序
|
||||
}
|
||||
|
||||
type UpdateTeachingCaseReq {
|
||||
Id int `json:"id" validate:"required"` // 案例ID
|
||||
Title string `json:"title"` // 案例标题
|
||||
TutorName string `json:"tutor_name"` // 导师姓名
|
||||
TutorTitle string `json:"tutor_title"` // 导师头衔
|
||||
StudentNames string `json:"student_names"` // 学生姓名(逗号分隔)
|
||||
Content string `json:"content"` // 案例内容
|
||||
CoverUrl string `json:"cover_url"` // 案例封面图URL
|
||||
Sort int `json:"sort"` // 排序
|
||||
}
|
||||
|
||||
type GetTeachingCaseReq {
|
||||
Id int `json:"id" validate:"required" uri:"id"` // 案例ID
|
||||
}
|
||||
|
||||
type DeleteTeachingCaseReq {
|
||||
Id int `json:"id" validate:"required" uri:"id"` // 案例ID
|
||||
}
|
||||
|
||||
type ListTeachingCaseReq {
|
||||
Page int `json:"page" default:"1"` // 页码
|
||||
Size int `json:"size" default:"10"` // 每页数量
|
||||
Keyword string `json:"keyword"` // 搜索关键词(标题/导师姓名)
|
||||
Sort int `json:"sort"` // 排序筛选
|
||||
}
|
||||
|
||||
// 教学案例响应结构体
|
||||
type TeachingCaseResp {
|
||||
Id int `json:"id"` // 案例ID
|
||||
Title string `json:"title"` // 案例标题
|
||||
TutorName string `json:"tutor_name"` // 导师姓名
|
||||
TutorTitle string `json:"tutor_title"` // 导师头衔
|
||||
StudentNames string `json:"student_names"` // 学生姓名
|
||||
Content string `json:"content"` // 案例内容
|
||||
CoverUrl string `json:"cover_url"` // 封面图URL
|
||||
Sort int `json:"sort"` // 排序
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
type ListTeachingCaseResp {
|
||||
Total int64 `json:"total"` // 总条数
|
||||
List []TeachingCaseResp `json:"list"` // 案例列表
|
||||
}
|
||||
|
||||
type BaseResp {
|
||||
Code int `json:"code"` // 状态码(0成功,非0失败)
|
||||
Msg string `json:"msg"` // 提示信息
|
||||
}
|
||||
|
||||
@server (
|
||||
group: teaching_case
|
||||
prefix: /api/teaching-case
|
||||
)
|
||||
service teaching_case_api {
|
||||
@handler CreateTeachingCaseHandler
|
||||
post /api/teaching-cases (CreateTeachingCaseReq) returns (BaseResp)
|
||||
|
||||
@handler UpdateTeachingCaseHandler
|
||||
put /api/teaching-cases (UpdateTeachingCaseReq) returns (BaseResp)
|
||||
|
||||
@handler GetTeachingCaseHandler
|
||||
get /api/teaching-cases/:id (GetTeachingCaseReq) returns (TeachingCaseResp)
|
||||
|
||||
@handler DeleteTeachingCaseHandler
|
||||
delete /api/teaching-cases/:id (DeleteTeachingCaseReq) returns (BaseResp)
|
||||
|
||||
@handler ListTeachingCaseHandler
|
||||
get /api/teaching-cases (ListTeachingCaseReq) returns (ListTeachingCaseResp)
|
||||
}
|
||||
|
||||
79
server/api/course/video_case/video_case.api
Normal file
79
server/api/course/video_case/video_case.api
Normal file
@@ -0,0 +1,79 @@
|
||||
// 视频案例请求结构体
|
||||
type CreateVideoCaseReq {
|
||||
Title string `json:"title" validate:"required"` // 视频案例标题
|
||||
Intro string `json:"intro"` // 视频简介
|
||||
VideoUrl string `json:"video_url" validate:"required"` // 视频播放地址
|
||||
DesignerNames string `json:"designer_names" validate:"required"` // 设计人员名单(逗号分隔)
|
||||
TutorNames string `json:"tutor_names" validate:"required"` // 指导老师名单(逗号分隔)
|
||||
Sort int `json:"sort" default:"0"` // 排序
|
||||
}
|
||||
|
||||
type UpdateVideoCaseReq {
|
||||
Id int `json:"id" validate:"required"` // 视频案例ID
|
||||
Title string `json:"title"` // 视频案例标题
|
||||
Intro string `json:"intro"` // 视频简介
|
||||
VideoUrl string `json:"video_url"` // 视频播放地址
|
||||
DesignerNames string `json:"designer_names"` // 设计人员名单
|
||||
TutorNames string `json:"tutor_names"` // 指导老师名单
|
||||
Sort int `json:"sort"` // 排序
|
||||
}
|
||||
|
||||
type GetVideoCaseReq {
|
||||
Id int `json:"id" validate:"required" uri:"id"` // 视频案例ID
|
||||
}
|
||||
|
||||
type DeleteVideoCaseReq {
|
||||
Id int `json:"id" validate:"required" uri:"id"` // 视频案例ID
|
||||
}
|
||||
|
||||
type ListVideoCaseReq {
|
||||
Page int `json:"page" default:"1"` // 页码
|
||||
Size int `json:"size" default:"10"` // 每页数量
|
||||
Keyword string `json:"keyword"` // 搜索关键词(标题/设计人员/指导老师)
|
||||
Sort int `json:"sort"` // 排序筛选
|
||||
}
|
||||
|
||||
// 视频案例响应结构体
|
||||
type VideoCaseResp {
|
||||
Id int `json:"id"` // 视频案例ID
|
||||
Title string `json:"title"` // 视频案例标题
|
||||
Intro string `json:"intro"` // 视频简介
|
||||
VideoUrl string `json:"video_url"` // 视频播放地址
|
||||
DesignerNames string `json:"designer_names"` // 设计人员名单
|
||||
TutorNames string `json:"tutor_names"` // 指导老师名单
|
||||
Sort int `json:"sort"` // 排序
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
}
|
||||
|
||||
type ListVideoCaseResp {
|
||||
Total int64 `json:"total"` // 总条数
|
||||
List []VideoCaseResp `json:"list"` // 视频案例列表
|
||||
}
|
||||
|
||||
type BaseResp {
|
||||
Code int `json:"code"` // 状态码(0成功,非0失败)
|
||||
Msg string `json:"msg"` // 提示信息
|
||||
}
|
||||
|
||||
@server (
|
||||
group: video_case
|
||||
prefix: /api/video-case
|
||||
)
|
||||
service video_case_api {
|
||||
@handler CreateVideoCaseHandler
|
||||
post /api/video-cases (CreateVideoCaseReq) returns (BaseResp)
|
||||
|
||||
@handler UpdateVideoCaseHandler
|
||||
put /api/video-cases (UpdateVideoCaseReq) returns (BaseResp)
|
||||
|
||||
@handler GetVideoCaseHandler
|
||||
get /api/video-cases/:id (GetVideoCaseReq) returns (VideoCaseResp)
|
||||
|
||||
@handler DeleteVideoCaseHandler
|
||||
delete /api/video-cases/:id (DeleteVideoCaseReq) returns (BaseResp)
|
||||
|
||||
@handler ListVideoCaseHandler
|
||||
get /api/video-cases (ListVideoCaseReq) returns (ListVideoCaseResp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user