新增课程接口配置

This commit is contained in:
2026-08-06 16:18:01 +08:00
parent 6a65ebc093
commit b8da879cae
11 changed files with 323 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
<?php
/**
* 课程服务
*/
namespace Dhd\Micro\CourseService;
interface CourseService extends
\Dhd\Micro\Interface\CourseService\JsonRpcInterface\CourseServiceInterface,
\Dhd\Micro\Interface\CourseService\JsonRpcInterface\CourseFileInterface,
\Dhd\Micro\Interface\CourseService\JsonRpcInterface\CourseUnitInterface,
\Dhd\Micro\Interface\CourseService\JsonRpcInterface\CourseVideoInterface {}

View File

@@ -0,0 +1,42 @@
<?php
/**
* 课程讲义服务接口
*/
namespace Dhd\Micro\Interface\CourseService\JsonRpcInterface;
interface CourseFileInterface
{
/**
* 获取课程讲义列表
* @param int $courseId 课程ID
* @param bool $onlyShow 是否只显示显示状态的讲义
*/
public function getCourseFileList(int $courseId, bool $onlyShow = false): array;
/**
* 新增、编辑课程讲义
*/
public function editCourseFile(array $data);
/**
* 删除课程讲义
* @param int $id 课程讲义ID
*/
public function deleteCourseFile(int $id);
/**
* 修改课程讲义显示状态
* @param int $id 课程讲义ID
* @param int $isShow 显示状态 0-不显示 1-显示
*/
public function editCourseFileShow(int $id, int $isShow);
/**
* 修改课程讲义排序
* @param int $id 课程讲义ID
* @param int $sort 排序
*/
public function editCourseFileSort(int $id, int $sort);
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* 课程服务接口
*/
namespace Dhd\Micro\Interface\CourseService\JsonRpcInterface;
interface CourseServiceInterface
{
/**
* 获取课程分类列表
*/
public function getCourseCategoryList(): array;
/**
* 编辑/创建课程分类
*/
public function editCourseCategory(array $data);
/**
* 删除课程分类
* @param int $id 课程分类ID
*/
public function deleteCourseCategory(int $id);
/**
* 后台管理获取课程列表
* @param array $params 查询参数
*/
public function adminGetCourseList(array $params): array;
/**
* APP获取课程列表
* @param array $params 获取参数
*/
public function appGetCourseList(array $params): array;
/**
* 获取课程详情
* @param int $id 课程ID
* @param string $platform 平台 admin-后台 app-APP
* @param int $userId 用户ID
*/
public function getCourseDetail(int $id, string $platform = 'admin', int $userId = 0): array;
/**
* 新增、编辑课程
*/
public function editCourse(array $data);
/**
* 修改课程显示状态
* @param int $id 课程ID
* @param int $isShow 显示状态 0-不显示 1-显示
*/
public function editCourseShow(int $id, int $isShow);
/**
* 修改课程排序
* @param int $id 课程ID
* @param int $sort 排序
*/
public function editCourseSort(int $id, int $sort);
/**
* 删除课程
* @param int $id 课程ID
*/
public function deleteCourse(int $id);
/**
* 用户添加课程学习
* @param int $courseId 课程ID
* @param int $userId 用户ID
*/
public function addLearnCourse(int $courseId, int $userId);
/**
* 验证领取码
* @param int $courseId 课程ID
* @param int $userId 用户ID
* @param string $inviteCode 领取码
* @return void
*/
public function virfyInviteCode(int $courseId, int $userId, string $inviteCode);
/**
* 搜索课程
* @param string $keyword 搜索关键词
* @param array $params 搜索参数
* @return array
*/
public function searchCourses(string $keyword, array $params = []): array;
/**
* 根据教师ID获取课程列表
* @param int $teacherId 教师ID
* @param string $platform 平台 admin-后台 app-APP
*/
public function getCoursesByTeacherId(int $teacherId, string $platform = 'app'): array;
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* 课程单元、章节接口
*/
namespace Dhd\Micro\Interface\CourseService\JsonRpcInterface;
interface CourseUnitInterface
{
/**
* 获取课程单、章节元列表
* @param int $courseId 课程ID
*/
public function getCourseUnitList(int $courseId): array;
/**
* 获取课程单、章节元详情
* @param int $id 课程单、章节元ID
*/
public function getCourseUnitDetail(int $id): array;
/**
* 新增、编辑课程单、章节元
*/
public function editCourseUnit(array $data);
/**
* 删除课程单、章节元
* @param int $id 课程单、章节元ID
*/
public function deleteCourseUnit(int $id);
}

View File

@@ -0,0 +1,68 @@
<?php
/**
* 课程视频接口
*/
namespace Dhd\Micro\Interface\CourseService\JsonRpcInterface;
interface CourseVideoInterface
{
/**
* 获取课程视频列表
* @param int $courseId 课程ID
* @param string $platform 平台 admin-后台 app-APP
*/
public function getVideoLists(int $courseId, string $platform = 'admin'): array;
/**
* 获取课程视频详情
* @param int $id 课程视频ID
* @param string $platform 平台 admin-后台 app-APP
*/
public function getVideoDetail(int $id, string $platform = 'admin'): array;
/**
* 新增、编辑课程视频
* 'id',
* 'course_id',
* 'unit_id',
* 'cover_image',
* 'sort',
* 'title',
* 'video_url',
* 'video_size',
* 'video_time',
* 'format',
* 'is_show',
* 'main_teacher',
*/
public function editVideo(array $data);
/**
* 删除课程视频
* @param int $id 课程视频ID
*/
public function deleteVideo(int $id);
/**
* 修改课程视频排序
* @param int $id 课程视频ID
* @param int $sort 排序
*/
public function editVideoSort(int $id, int $sort);
/**
* 课程视频显示状态
* @param int $id 课程视频ID
* @param int $isShow 显示状态 0-不显示 1-显示
*/
public function editVideoShow(int $id, int $isShow);
/**
* 课程视频浏览量+1
* @param int $id 课程视频ID
* @param int $userId 用户ID
*/
public function addVideoBrowse(int $id, int $userId);
}

View File

@@ -7,7 +7,7 @@
namespace Dhd\Micro\Interface\FileService;
interface FileService extends
\Dhd\Micro\Interface\FileService\FileServiceInterface,
\Dhd\Micro\Interface\FileService\QuestionParseInterface,
\Dhd\Micro\Interface\FileService\QuestionQrCodeInterface,
\Dhd\Micro\Interface\FileService\ExcelParseInterface {}
\Dhd\Micro\Interface\FileService\JsonRpcInterface\FileServiceInterface,
\Dhd\Micro\Interface\FileService\JsonRpcInterface\QuestionParseInterface,
\Dhd\Micro\Interface\FileService\JsonRpcInterface\QuestionQrCodeInterface,
\Dhd\Micro\Interface\FileService\JsonRpcInterface\ExcelParseInterface {}

View File

@@ -4,7 +4,7 @@
* JsonRpc服务接口
*/
namespace Dhd\Micro\Interface\FileService;
namespace Dhd\Micro\Interface\FileService\JsonRpcInterface;
interface ExcelParseInterface
{

View File

@@ -4,7 +4,7 @@
* JsonRpc服务接口
*/
namespace Dhd\Micro\Interface\FileService;
namespace Dhd\Micro\Interface\FileService\JsonRpcInterface;
interface FileServiceInterface
{

View File

@@ -4,7 +4,7 @@
* JsonRpc服务接口
*/
namespace Dhd\Micro\Interface\FileService;
namespace Dhd\Micro\Interface\FileService\JsonRpcInterface;
interface QuestionParseInterface
{

View File

@@ -4,7 +4,7 @@
* JsonRpc服务接口
*/
namespace Dhd\Micro\Interface\FileService;
namespace Dhd\Micro\Interface\FileService\JsonRpcInterface;
interface QuestionQrCodeInterface
{