2025-07-05 14:38:00 +08:00

162 lines
3.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { CategoryForm, CategoryQuery, CategoryTreeVO, CategoryVO, Formaget, QueryParamOV } from '@/api/workflow/category/types';
import { AxiosPromise } from 'axios';
import request from '@/utils/request';
export interface QueryChildOV {
current: number;
size: number;
fatherCommentId: number | string;
}
/**
* 视频列表
* @param query
* @returns {*}
*/
export const listCategory = (query?: CategoryQuery): AxiosPromise<CategoryVO[]> => {
return request({
// url: '/workflow/category/list',old
url: '/video/list',
method: 'post',
data: query
});
};
/**
* 视频通过和反驳
* @param vlogId 视频id
* @param reason 反驳理由
* @param status 状态1通过 2反驳
*/
export const updateaudit = (data?: Formaget) => {
return request({
url: `/video/audit?vlogId=${data.vlogId}&reason=${data.reason}&status=${data.status}`,
method: 'post'
});
};
/**
* 视频评论列表
* @param vlogId 视频id
* @param mobile 手机号
*/
export const getcommentlist = (data?: QueryParamOV) => {
return request({
url: `/comment/list`,
method: 'post',
data
});
};
/**
* 视频评论列表
// * @param vlogId 视频id
// * @param reason 反驳理由
// * @param status 状态1通过 2反驳
*/
export const getchildList = (data?: QueryChildOV) => {
return request({
url: `/comment/childList?fatherCommentId=${data.fatherCommentId}&current=${data.current}&size=${data.size}`,
method: 'get'
});
};
/**
* 获取去视频详情
* @param vlogId 视频id
*/
export const gerdetail = (data?: string) => {
return request({
url: `/video/detail?fileId=${data}`,
method: 'get'
});
};
/**
* 删除评论
* @param data 评论id
*/
export const deldetail = (data?: string) => {
return request({
url: `/comment/delete?commentId=${data}`,
method: 'post'
});
};
/**
* 上下架评论
* @param id 评论id
*/
export const deloffline = (data?: string) => {
return request({
url: `comment/offline?commentId=${data}`,
method: 'post'
});
};
/**
* 视频通过和反驳
* @param vlogId 视频id
*/
export const updateaforbid = (vlogId?: string) => {
return request({
url: `/video/forbid`,
method: 'post',
data: { fileIds: vlogId, operation: 'forbid' }
});
};
/**
* 查询流程分类详细
* @param categoryId
*/
export const getCategory = (categoryId: string | number): AxiosPromise<CategoryVO> => {
return request({
url: '/workflow/category/' + categoryId,
method: 'get'
});
};
/**
* 新增流程分类
* @param data
*/
export const addCategory = (data: CategoryForm) => {
return request({
url: '/workflow/category',
method: 'post',
data: data
});
};
/**
* 修改流程分类
* @param data
*/
export const updateCategory = (data: CategoryForm) => {
return request({
url: '/workflow/category',
method: 'put',
data: data
});
};
/**
* 删除流程分类
* @param categoryId
*/
export const delCategory = (categoryId: string | number | Array<string | number>) => {
return request({
url: '/workflow/category/' + categoryId,
method: 'delete'
});
};
/**
* 获取流程分类树列表
* @param query 流程实例id
* @returns
*/
export const categoryTree = (query?: CategoryForm): AxiosPromise<CategoryTreeVO[]> => {
return request({
url: `/workflow/category/categoryTree`,
method: 'get',
params: query
});
};