This commit is contained in:
ditiqi 2025-02-26 16:35:59 +08:00
parent 317df03ded
commit 197f617a8c
7 changed files with 7 additions and 10 deletions

View File

@ -32,7 +32,7 @@ export class AuthService {
return { isValid: false, error: FileValidationErrorType.INVALID_URI };
}
const fileId = extractFileIdFromNginxUrl(params.originalUri);
console.log(params.originalUri, fileId);
// console.log(params.originalUri, fileId);
const resource = await db.resource.findFirst({ where: { fileId } });
// 资源验证

View File

@ -118,7 +118,6 @@ export class PostService extends BaseTreeService<Prisma.PostDelegate> {
});
}
// If transaction is provided, use it directly
console.log('courseDetail', courseDetail);
const createdCourse = await this.create(courseDetail, params);
// If sections are provided, create them
return createdCourse;

View File

@ -128,8 +128,6 @@ export async function updateCourseEnrollmentStats(courseId: string) {
export async function setCourseInfo({ data }: { data: Post }) {
// await db.term
console.log(12314243342);
console.log(data?.type);
if (data?.type === PostType.COURSE) {
const ancestries = await db.postAncestry.findMany({
where: {
@ -170,7 +168,6 @@ export async function setCourseInfo({ data }: { data: Post }) {
(lecture) => lecture.parentId === section.id,
) as any as Lecture[];
});
console.log(sections);
Object.assign(data, { sections, lectureCount });
}
}

View File

@ -3,7 +3,6 @@ import {
BaseSetting,
db,
PostType,
TaxonomySlug,
VisitType,
} from '@nice/common';
export async function updateTotalCourseViewCount(type: VisitType) {
@ -24,7 +23,7 @@ export async function updateTotalCourseViewCount(type: VisitType) {
views: true,
},
where: {
postId: { in: courseIds },
postId: { in: lectures.map((lecture) => lecture.id) },
type: type,
},
});
@ -67,6 +66,7 @@ export async function updatePostViewCount(id: string, type: VisitType) {
where: { id },
select: { id: true, meta: true },
});
const totalViews = await db.visit.aggregate({
_sum: {
views: true,

View File

@ -10,7 +10,7 @@ const pipeline = new ResourceProcessingPipeline()
.addProcessor(new VideoProcessor());
export default async function processJob(job: Job<any, any, QueueJobType>) {
if (job.name === QueueJobType.FILE_PROCESS) {
console.log('job', job);
// console.log('job', job);
const { resource } = job.data;
if (!resource) {
throw new Error('No resource provided in job data');

View File

@ -89,8 +89,8 @@ export class TusService implements OnModuleInit {
upload: Upload,
) {
try {
console.log('upload.id', upload.id);
console.log('fileId', this.getFileId(upload.id));
// console.log('upload.id', upload.id);
// console.log('fileId', this.getFileId(upload.id));
const resource = await this.resourceService.update({
where: { fileId: this.getFileId(upload.id) },
data: { status: ResourceStatus.UPLOADED },

View File

@ -45,6 +45,7 @@ export type PostDto = Post & {
export type LectureMeta = {
type?: string;
views?: number;
videoUrl?: string;
videoThumbnail?: string;
videoIds?: string[];