添加视频案例和教学案例业务层
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package video_case
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateVideoCaseLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCreateVideoCaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateVideoCaseLogic {
|
||||
return &CreateVideoCaseLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CreateVideoCaseLogic) CreateVideoCase(req *types.CreateVideoCaseReq) (resp *types.BaseResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package video_case
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteVideoCaseLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewDeleteVideoCaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteVideoCaseLogic {
|
||||
return &DeleteVideoCaseLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteVideoCaseLogic) DeleteVideoCase(req *types.DeleteVideoCaseReq) (resp *types.BaseResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package video_case
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetVideoCaseLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetVideoCaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetVideoCaseLogic {
|
||||
return &GetVideoCaseLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetVideoCaseLogic) GetVideoCase(req *types.GetVideoCaseReq) (resp *types.VideoCaseResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package video_case
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type ListVideoCaseLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewListVideoCaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListVideoCaseLogic {
|
||||
return &ListVideoCaseLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *ListVideoCaseLogic) ListVideoCase(req *types.ListVideoCaseReq) (resp *types.ListVideoCaseResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package video_case
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/video_case/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type UpdateVideoCaseLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewUpdateVideoCaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateVideoCaseLogic {
|
||||
return &UpdateVideoCaseLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateVideoCaseLogic) UpdateVideoCase(req *types.UpdateVideoCaseReq) (resp *types.BaseResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return
|
||||
}
|
||||
60
server/internal/video_case/internal/types/types.go
Normal file
60
server/internal/video_case/internal/types/types.go
Normal file
@@ -0,0 +1,60 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
|
||||
package types
|
||||
|
||||
type BaseResp struct {
|
||||
Code int `json:"code"` // 状态码(0成功,非0失败)
|
||||
Msg string `json:"msg"` // 提示信息
|
||||
}
|
||||
|
||||
type CreateVideoCaseReq struct {
|
||||
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 DeleteVideoCaseReq struct {
|
||||
Id int `json:"id" validate:"required" uri:"id"` // 视频案例ID
|
||||
}
|
||||
|
||||
type GetVideoCaseReq struct {
|
||||
Id int `json:"id" validate:"required" uri:"id"` // 视频案例ID
|
||||
}
|
||||
|
||||
type ListVideoCaseReq struct {
|
||||
Page int `json:"page" default:"1"` // 页码
|
||||
Size int `json:"size" default:"10"` // 每页数量
|
||||
Keyword string `json:"keyword"` // 搜索关键词(标题/设计人员/指导老师)
|
||||
Sort int `json:"sort"` // 排序筛选
|
||||
}
|
||||
|
||||
type ListVideoCaseResp struct {
|
||||
Total int64 `json:"total"` // 总条数
|
||||
List []VideoCaseResp `json:"list"` // 视频案例列表
|
||||
}
|
||||
|
||||
type UpdateVideoCaseReq struct {
|
||||
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 VideoCaseResp struct {
|
||||
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"` // 更新时间
|
||||
}
|
||||
Reference in New Issue
Block a user