2024-12-10 10:35:03 +00:00
|
|
|
import { getAPIInterceptor, postAPIInterceptor } from "@/config/api";
|
|
|
|
|
import { httpGetInterceptor } from "../http-config/http-interceptor-service";
|
2024-12-06 18:37:45 +00:00
|
|
|
|
|
|
|
|
export async function listDataImage(
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any
|
|
|
|
|
) {
|
2024-12-09 13:17:22 +00:00
|
|
|
return await getAPIInterceptor(
|
2024-12-08 19:23:05 +00:00
|
|
|
`media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=1&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listDataVideo(
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any
|
|
|
|
|
) {
|
2024-12-09 13:17:22 +00:00
|
|
|
return await getAPIInterceptor(
|
2024-12-08 19:23:05 +00:00
|
|
|
`media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=2&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listDataTeks(
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any
|
|
|
|
|
) {
|
2024-12-09 13:17:22 +00:00
|
|
|
return await getAPIInterceptor(
|
2024-12-08 19:23:05 +00:00
|
|
|
`media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=3&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listDataAudio(
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any
|
|
|
|
|
) {
|
2024-12-09 13:17:22 +00:00
|
|
|
return await getAPIInterceptor(
|
2024-12-08 19:23:05 +00:00
|
|
|
`media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=4&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listSPIT(
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
title = "",
|
|
|
|
|
isPublish: any
|
|
|
|
|
) {
|
|
|
|
|
return await httpGetInterceptor(
|
2024-12-10 10:35:03 +00:00
|
|
|
`media/spit/pagination?enablePage=0&page=${page}&size=${limit}&sort=desc&sortBy=contentTitleId&title=${title}&isPublish=${isPublish}`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listNulisAI(page: any, limit: any) {
|
|
|
|
|
return await getAPIInterceptor(
|
|
|
|
|
`media/nulis-ai/pagination?enablePage=0&page=${page}&size=${limit}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
2024-12-08 19:23:05 +00:00
|
|
|
|
|
|
|
|
export async function getTagsBySubCategoryId(subCategory: any) {
|
2024-12-09 13:17:22 +00:00
|
|
|
return await getAPIInterceptor(
|
2024-12-08 19:23:05 +00:00
|
|
|
`media/tags/list?subCategoryId=${subCategory}`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listEnableCategory(type: any) {
|
|
|
|
|
const url = `media/categories/list/enable?enablePage=0&sort=desc&sortBy=id&type=${type}`;
|
|
|
|
|
return getAPIInterceptor(url);
|
|
|
|
|
}
|
2024-12-09 13:17:22 +00:00
|
|
|
|
|
|
|
|
export async function getTags() {
|
|
|
|
|
const url = "media/tags/list";
|
|
|
|
|
return getAPIInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createMedia(data: any) {
|
2024-12-10 10:35:03 +00:00
|
|
|
const pathUrl = "media";
|
|
|
|
|
return postAPIInterceptor(pathUrl, data);
|
2024-12-09 13:17:22 +00:00
|
|
|
}
|