feat: 内容审核写手端-替换接口,删除无用代码组件逻辑

This commit is contained in:
rd
2025-08-11 18:28:38 +08:00
parent 77cf169607
commit 7a6e696fc3
27 changed files with 151 additions and 675 deletions

View File

@ -1,5 +1,14 @@
import { postWorkAuditsAiReview, getWorkAuditsAiReviewResult } from '@/api/all/generationWorkshop';
export default function useGetAiReviewResult({ cardInfo, updateAiReview }: { cardInfo: any; updateAiReview: (ai_review: any) => void }) {
export default function useGetAiReviewResult({
cardInfo,
updateAiReview,
startAiReviewFn,
getAiReviewResultFn,
}: {
cardInfo: any;
updateAiReview: (ai_review: any) => void;
startAiReviewFn: (params: { id: string; platform: string; content: string }) => Promise<any>;
getAiReviewResultFn: (id: string, ticket: string) => Promise<any>;
}) {
const statusPollingTimer = ref<number | null>(null);
const ticket = ref('');
const checkLoading = ref(false);
@ -8,7 +17,7 @@ export default function useGetAiReviewResult({ cardInfo, updateAiReview }: { car
const handleStartCheck = async () => {
checkLoading.value = true;
const { id, platform, content } = cardInfo.value;
const { code, data } = await postWorkAuditsAiReview({ id, platform, content });
const { code, data } = await startAiReviewFn({ id, platform, content });
if (code === 200) {
ticket.value = data.ticket;
startStatusPolling();
@ -23,7 +32,7 @@ export default function useGetAiReviewResult({ cardInfo, updateAiReview }: { car
const startStatusPolling = () => {
clearStatusPollingTimer();
statusPollingTimer.value = setInterval(async () => {
const { code, data } = await getWorkAuditsAiReviewResult(cardInfo.value.id, ticket.value);
const { code, data } = await getAiReviewResultFn(cardInfo.value.id, ticket.value);
if (code === 200 && data.status === 1) {
checkResult.value = data.ai_review;
updateAiReview?.(data.ai_review);