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 => { 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}¤t=${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 => { 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) => { return request({ url: '/workflow/category/' + categoryId, method: 'delete' }); }; /** * 获取流程分类树列表 * @param query 流程实例id * @returns */ export const categoryTree = (query?: CategoryForm): AxiosPromise => { return request({ url: `/workflow/category/categoryTree`, method: 'get', params: query }); };