feat: 新增视频分类列表接口

This commit is contained in:
2025-02-28 15:07:48 +08:00
parent 00f02b46b6
commit f34b2ea48b
2 changed files with 23 additions and 0 deletions

View File

@@ -11,6 +11,26 @@ use app\admin\validate\v1\VideoCategoryValidate;
*/
class VideoCategory
{
/**
* 视频分类列表数据
*/
public function list()
{
$param = request()->param(['name' => '']);
$categorys = VideoCategoryModel::field([
'id',
'name',
])
->withSearch(['name'], [
'name' => $param['name']??null
])
->language(request()->lang_id)
->order(['sort' => 'asc', 'id' => 'desc'])
->select();
return success('获取成功', $categorys);
}
/**
* 视频分类分页数据
*/

View File

@@ -67,6 +67,9 @@ Route::group('v1', function () {
// 视频信息删除
Route::delete('delete/:id', 'Video/delete');
// 视频分类列表
Route::get('categorys', 'VideoCategory/list');
// 视频分类
Route::group('category', function () {
// 视频分类分页数据