This commit is contained in:
ditiqi 2025-01-26 22:07:36 +08:00
parent b8a8c1b044
commit bf6d3a6956
6 changed files with 0 additions and 8 deletions

View File

@ -26,7 +26,6 @@ export class PostService extends BaseService<Prisma.PostDelegate> {
} }
onModuleInit() { onModuleInit() {
EventBus.on('updatePostState', ({ id }) => { EventBus.on('updatePostState', ({ id }) => {
console.log('updatePostState');
updatePostState(id); updatePostState(id);
}); });
} }
@ -34,7 +33,6 @@ export class PostService extends BaseService<Prisma.PostDelegate> {
args: Prisma.PostCreateArgs, args: Prisma.PostCreateArgs,
params: { staff?: UserProfile; tx?: Prisma.PostDelegate }, params: { staff?: UserProfile; tx?: Prisma.PostDelegate },
) { ) {
console.log('params?.staff?.id', params?.staff?.id);
args.data.authorId = params?.staff?.id; args.data.authorId = params?.staff?.id;
args.data.updatedAt = new Date(); args.data.updatedAt = new Date();
// args.data.resources // args.data.resources

View File

@ -10,7 +10,6 @@ export class VisitService extends BaseService<Prisma.VisitDelegate> {
async create(args: Prisma.VisitCreateArgs, staff?: UserProfile) { async create(args: Prisma.VisitCreateArgs, staff?: UserProfile) {
const { postId, messageId } = args.data; const { postId, messageId } = args.data;
const clientIp = (args.data.meta as any)?.ip; const clientIp = (args.data.meta as any)?.ip;
console.log('visit create');
const visitorId = args.data.visitorId || staff?.id; const visitorId = args.data.visitorId || staff?.id;
let result; let result;
const existingVisit = await db.visit.findFirst({ const existingVisit = await db.visit.findFirst({

View File

@ -15,13 +15,11 @@ export class PostQueueService implements OnModuleInit {
constructor(@InjectQueue('general') private generalQueue: Queue) {} constructor(@InjectQueue('general') private generalQueue: Queue) {}
onModuleInit() { onModuleInit() {
EventBus.on('updateVisitCount', ({ id, objectType, visitType }) => { EventBus.on('updateVisitCount', ({ id, objectType, visitType }) => {
console.log('updateVisitCount');
if (objectType === ObjectType.POST) { if (objectType === ObjectType.POST) {
this.addUpdateVisitCountJob({ id, type: visitType }); this.addUpdateVisitCountJob({ id, type: visitType });
} }
}); });
EventBus.on('updatePostState', ({ id }) => { EventBus.on('updatePostState', ({ id }) => {
console.log('updatePostState');
this.addUpdatePostState({ id }); this.addUpdatePostState({ id });
}); });
} }

View File

@ -1,6 +1,5 @@
import { db, PostState, PostType, VisitType } from '@nice/common'; import { db, PostState, PostType, VisitType } from '@nice/common';
export async function updatePostViewCount(id: string, type: VisitType) { export async function updatePostViewCount(id: string, type: VisitType) {
console.log('updatePostViewCount', type);
const totalViews = await db.visit.aggregate({ const totalViews = await db.visit.aggregate({
_sum: { _sum: {
views: true, views: true,

View File

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

View File

@ -47,7 +47,6 @@ export default function StaffForm() {
rank, rank,
office, office,
} = values; } = values;
console.log("photoUrl", photoUrl);
setFormLoading(true); setFormLoading(true);
try { try {
if (data && user?.id) { if (data && user?.id) {