2025-04-24 08:43:49 +00:00
|
|
|
import { httpPost } from "../http-config/http-base-service";
|
2025-01-06 06:00:34 +00:00
|
|
|
import {
|
2025-01-15 19:02:28 +00:00
|
|
|
httpDeleteInterceptor,
|
2025-01-06 06:00:34 +00:00
|
|
|
httpGetInterceptor,
|
|
|
|
|
httpPostInterceptor,
|
|
|
|
|
} from "../http-config/http-interceptor-service";
|
2024-12-06 18:37:45 +00:00
|
|
|
|
2024-12-16 01:25:47 +00:00
|
|
|
// export async function listDataAll(
|
|
|
|
|
// isForSelf,
|
|
|
|
|
// isApproval,
|
|
|
|
|
// page,
|
|
|
|
|
// limit,
|
|
|
|
|
// search,
|
|
|
|
|
// fileTypeFilter,
|
|
|
|
|
// statusFilter,
|
|
|
|
|
// startDate,
|
|
|
|
|
// endDate,
|
|
|
|
|
// needApprovalFromLevel
|
|
|
|
|
// ) {
|
|
|
|
|
// const name = search || "";
|
|
|
|
|
// const url = `media/list?title=${name}&enablePage=1&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&isForSelf=${isForSelf}&isApproval=${isApproval}&typeId=${fileTypeFilter}&statusId=${statusFilter}&startDate=${
|
|
|
|
|
// startDate == undefined ? "" : startDate
|
|
|
|
|
// }&endDate=${
|
|
|
|
|
// endDate == undefined ? "" : endDate
|
|
|
|
|
// }&needApprovalFromLevel=${needApprovalFromLevel}`;
|
2025-01-01 17:48:57 +00:00
|
|
|
// return httpGetInterceptor({ url });
|
2024-12-16 01:25:47 +00:00
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
export async function listDataAll(
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
search: any,
|
|
|
|
|
fileTypeFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any,
|
2024-12-16 14:05:10 +00:00
|
|
|
title: string = ""
|
2024-12-16 01:25:47 +00:00
|
|
|
) {
|
2025-01-01 17:48:57 +00:00
|
|
|
return await httpGetInterceptor(
|
2024-12-16 01:25:47 +00:00
|
|
|
`media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&isForSelf=${isForSelf}&isApproval=${isApproval}&typeId=${fileTypeFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&title=${title}`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-06 06:00:34 +00:00
|
|
|
export async function listDataImage(
|
2025-06-11 03:47:52 +00:00
|
|
|
size: any = "",
|
|
|
|
|
page: any = "",
|
|
|
|
|
isForSelf: any = "",
|
|
|
|
|
isApproval: any = "",
|
|
|
|
|
categoryFilter: any = "",
|
|
|
|
|
statusFilter: any = "",
|
|
|
|
|
needApprovalFromLevel: any = "",
|
|
|
|
|
creator: any = "",
|
|
|
|
|
source: any = "",
|
|
|
|
|
startDate: any = "",
|
|
|
|
|
endDate: any = "",
|
2025-01-16 12:52:59 +00:00
|
|
|
title: string = "",
|
2025-06-11 03:47:52 +00:00
|
|
|
creatorGroup: string = "",
|
|
|
|
|
isInt: boolean = false
|
2025-01-06 06:00:34 +00:00
|
|
|
) {
|
2025-01-01 17:48:57 +00:00
|
|
|
return await httpGetInterceptor(
|
2025-06-11 03:47:52 +00:00
|
|
|
`media/list?enablePage=1&size=${size}&sortBy=createdAt&sort=desc&page=${page}&typeId=1&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}&title=${title}&creatorGroupLevelName=${creatorGroup}&needApprovalFromLevel=${needApprovalFromLevel}&isInt=${isInt}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-06 06:00:34 +00:00
|
|
|
export async function listDataVideo(
|
2025-04-03 15:43:04 +00:00
|
|
|
size: any,
|
2025-01-06 06:00:34 +00:00
|
|
|
page: any,
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any,
|
2025-01-16 12:52:59 +00:00
|
|
|
title: string = "",
|
|
|
|
|
creatorGroup: string = ""
|
2025-01-06 06:00:34 +00:00
|
|
|
) {
|
2025-01-01 17:48:57 +00:00
|
|
|
return await httpGetInterceptor(
|
2025-04-03 15:43:04 +00:00
|
|
|
`media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${size}&page=${page}&typeId=2&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}&title=${title}&creatorGroupLevelName=${creatorGroup}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-06 06:00:34 +00:00
|
|
|
export async function listDataTeks(
|
2025-04-03 15:43:04 +00:00
|
|
|
size: any,
|
2025-01-06 06:00:34 +00:00
|
|
|
page: any,
|
|
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
|
|
|
|
endDate: any,
|
2025-01-16 12:52:59 +00:00
|
|
|
title: string = "",
|
|
|
|
|
creatorGroup: string = ""
|
2025-01-06 06:00:34 +00:00
|
|
|
) {
|
2025-01-01 17:48:57 +00:00
|
|
|
return await httpGetInterceptor(
|
2025-04-03 15:43:04 +00:00
|
|
|
`media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${size}&page=${page}&typeId=3&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}&title=${title}&creatorGroupLevelName=${creatorGroup}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listDataAudio(
|
2025-04-03 15:43:04 +00:00
|
|
|
size: any,
|
2025-01-06 14:06:02 +00:00
|
|
|
page: any,
|
2024-12-06 18:37:45 +00:00
|
|
|
isForSelf: any,
|
|
|
|
|
isApproval: any,
|
|
|
|
|
categoryFilter: any,
|
|
|
|
|
statusFilter: any,
|
|
|
|
|
needApprovalFromLevel: any,
|
|
|
|
|
creator: any,
|
|
|
|
|
source: any,
|
|
|
|
|
startDate: any,
|
2024-12-11 18:28:57 +00:00
|
|
|
endDate: any,
|
2025-01-16 12:52:59 +00:00
|
|
|
title: string = "",
|
|
|
|
|
creatorGroup: string = ""
|
2024-12-06 18:37:45 +00:00
|
|
|
) {
|
2025-01-01 17:48:57 +00:00
|
|
|
return await httpGetInterceptor(
|
2025-04-03 15:43:04 +00:00
|
|
|
`media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${size}&page=${page}&typeId=4&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}&title=${title}&creatorGroupLevelName=${creatorGroup}`
|
2024-12-06 18:37:45 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-06 06:00:34 +00:00
|
|
|
export async function listSPIT(
|
|
|
|
|
page: any,
|
|
|
|
|
limit: any,
|
|
|
|
|
title = "",
|
2025-02-25 12:50:47 +00:00
|
|
|
contentCreatedDate = "",
|
2025-01-06 06:00:34 +00:00
|
|
|
isPublish: any
|
|
|
|
|
) {
|
|
|
|
|
return await httpGetInterceptor(
|
2025-02-25 12:50:47 +00:00
|
|
|
`media/spit/pagination?enablePage=1&page=${page}&size=${limit}&sort=desc&sortBy=contentTitleId&title=${title}& contentCreatedDate=${contentCreatedDate}&isPublish=${isPublish}`
|
2025-01-06 06:00:34 +00:00
|
|
|
);
|
2024-12-10 10:35:03 +00:00
|
|
|
}
|
|
|
|
|
|
2024-12-11 18:28:57 +00:00
|
|
|
export async function listNulisAI(limit: any, page: any, title: string = "") {
|
2025-01-06 06:00:34 +00:00
|
|
|
return await httpGetInterceptor(
|
|
|
|
|
`media/nulis-ai/pagination?enablePage=1&page=${page}&size=${limit}&title=${title}`
|
|
|
|
|
);
|
2024-12-06 18:37:45 +00:00
|
|
|
}
|
2024-12-08 19:23:05 +00:00
|
|
|
|
|
|
|
|
export async function getTagsBySubCategoryId(subCategory: any) {
|
2025-01-06 06:00:34 +00:00
|
|
|
return await httpGetInterceptor(
|
|
|
|
|
`media/tags/list?subCategoryId=${subCategory}`
|
|
|
|
|
);
|
2024-12-08 19:23:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function listEnableCategory(type: any) {
|
2025-06-22 05:08:08 +00:00
|
|
|
const url = `media/categories/list?enablePage=0&sort=desc&sortBy=id&type=${type}`;
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpGetInterceptor(url);
|
2024-12-08 19:23:05 +00:00
|
|
|
}
|
2024-12-09 13:17:22 +00:00
|
|
|
|
2024-12-24 18:18:48 +00:00
|
|
|
export async function listCategory(type: any) {
|
2025-03-03 05:32:19 +00:00
|
|
|
const url = `media/categories/list?enablePage=0&sort=desc&sortBy=id&categoryId=${type}`;
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpGetInterceptor(url);
|
2024-12-24 18:18:48 +00:00
|
|
|
}
|
|
|
|
|
|
2024-12-09 13:17:22 +00:00
|
|
|
export async function getTags() {
|
|
|
|
|
const url = "media/tags/list";
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpGetInterceptor(url);
|
2024-12-09 13:17:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function createMedia(data: any) {
|
2024-12-23 18:38:25 +00:00
|
|
|
const url = "media";
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpPostInterceptor(url, data);
|
2024-12-09 13:17:22 +00:00
|
|
|
}
|
2024-12-24 18:18:48 +00:00
|
|
|
|
|
|
|
|
export async function uploadThumbnail(id: any, data: any) {
|
|
|
|
|
const url = `media/upload?id=${id}&operation=thumbnail`;
|
2025-06-24 06:34:09 +00:00
|
|
|
const headers = {
|
|
|
|
|
"Content-Type": "multipart/form-data",
|
|
|
|
|
};
|
|
|
|
|
return httpPostInterceptor(url, data, headers);
|
2024-12-24 18:18:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function detailSPIT(id: any) {
|
|
|
|
|
const url = `media/spit?id=${id}`;
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpGetInterceptor(url);
|
2024-12-24 18:18:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function convertSPIT(data: any) {
|
|
|
|
|
const url = "media/spit/convert";
|
2025-01-01 17:48:57 +00:00
|
|
|
return httpPostInterceptor(url, data);
|
2024-12-24 18:18:48 +00:00
|
|
|
}
|
2025-01-02 04:53:30 +00:00
|
|
|
|
|
|
|
|
export async function submitApproval(data: any) {
|
|
|
|
|
const url = "media/approval";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function rejectFiles(data: any) {
|
|
|
|
|
const url = "media/file/rejects";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
2025-01-04 03:44:57 +00:00
|
|
|
|
2025-02-17 14:56:47 +00:00
|
|
|
export async function publishMedia(id: any) {
|
|
|
|
|
const url = `media/public/publish-to-mabes?id=${id}`;
|
|
|
|
|
return httpPostInterceptor(url);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 03:44:57 +00:00
|
|
|
export async function saveContentRewrite(data: any) {
|
|
|
|
|
const url = "media/rewrite";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
export async function saveUserReports(data: any) {
|
2025-01-06 06:00:34 +00:00
|
|
|
const url = "public/users/reports";
|
|
|
|
|
return httpPostInterceptor(url, data);
|
2025-01-04 03:44:57 +00:00
|
|
|
}
|
2025-01-15 19:02:28 +00:00
|
|
|
|
|
|
|
|
export async function deleteMedia(data: any) {
|
|
|
|
|
const url = `media`;
|
|
|
|
|
return httpDeleteInterceptor(url, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function deleteFile(data: any) {
|
|
|
|
|
const url = "media/file";
|
|
|
|
|
return httpDeleteInterceptor(url, data);
|
|
|
|
|
}
|
2025-02-08 03:44:09 +00:00
|
|
|
|
|
|
|
|
export async function deleteSPIT(id: any) {
|
|
|
|
|
const url = `media/spit?id=${id}`;
|
|
|
|
|
return httpDeleteInterceptor(url);
|
|
|
|
|
}
|
2025-04-24 08:43:49 +00:00
|
|
|
|
|
|
|
|
export async function postActivityLog(data: any) {
|
|
|
|
|
const url = `activity`;
|
|
|
|
|
const headers = {
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
};
|
|
|
|
|
return httpPost(url, headers, data);
|
2025-06-13 08:21:08 +00:00
|
|
|
}
|