feat: изменил логику анализа отзывов
Backend CI / build-and-test (push) Failing after 14m19s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Failing after 12m5s
Frontend CI / build-and-check (push) Failing after 17m58s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 10m11s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 11m3s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Failing after 14m58s

This commit is contained in:
2026-05-22 01:30:41 +03:00
parent 168d6af860
commit 8ac593d36f
36 changed files with 858 additions and 457 deletions
-11
View File
@@ -172,13 +172,6 @@ async function listReviewsPage(query: ReviewQuery = {}) {
return normalizePagedResult(payload, query)
}
async function listPendingReviewsPage(query: ReviewQuery = {}) {
const payload = await apiRequest<PagedResult<ReviewDto> | ReviewDto[]>('/reviews/pending', {
query: query as Record<string, unknown>,
})
return normalizePagedResult(payload, query)
}
export const reviewsApi = {
create: (lectureId: string | number, rating: 'Like' | 'Neutral' | 'Dislike', text: string) =>
apiRequest<ReviewDto>('/reviews', {
@@ -195,10 +188,6 @@ export const reviewsApi = {
async list(query: ReviewQuery = { PageSize: 100 }) {
return (await listReviewsPage(query)).items
},
pendingPage: listPendingReviewsPage,
async pending(query: ReviewQuery = { PageSize: 100 }) {
return (await listPendingReviewsPage(query)).items
},
reanalyze: (id: string | number) =>
apiRequest<void>(`/reviews/${id}/reanalyze`, { method: 'POST' }),
}
+2 -1
View File
@@ -93,7 +93,8 @@ export function mapApiLecture(lecture: LectureDto): Lecture {
}
export function mapApiReview(review: ReviewDto): Review {
const sentiment = review.sentiment === 'Negative' ? 'negative' : review.sentiment === 'Neutral' ? 'neutral' : 'positive'
const sentiment =
review.sentiment === 'Positive' ? 'positive' : review.sentiment === 'Negative' ? 'negative' : 'neutral'
const status =
review.llmStatus === 'Rejected' ? 'rejected' : review.llmStatus === 'Analyzed' ? 'done' : 'pending'
+3 -1
View File
@@ -116,6 +116,7 @@ export interface CreateLectureRequest {
}
export interface ReviewQuery {
LlmStatus?: ApiReviewLlmStatus
Page?: number
PageSize?: number
}
@@ -129,10 +130,11 @@ export interface ReviewDto {
rating: ApiReviewRating
text?: string | null
llmStatus: ApiReviewLlmStatus
sentiment: ApiReviewSentiment
sentiment?: ApiReviewSentiment | null
qualityScore?: number | null
isInformative?: boolean | null
llmTags?: string[] | null
llmRawOutput?: string | null
createdAt: string
}