Skip to content

Commit

Permalink
Merge pull request #5 from gsainfoteam/parse-academic-notice
Browse files Browse the repository at this point in the history
feat: add crawling academic notice
  • Loading branch information
2paperstar authored Nov 23, 2023
2 parents 6def7fa + deecf27 commit 55eb3e2
Show file tree
Hide file tree
Showing 13 changed files with 406 additions and 19 deletions.
213 changes: 213 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@nestjs/schedule": "^3.0.3",
"@nestjs/swagger": "^7.1.16",
"axios": "^1.3.4",
"cheerio": "^1.0.0-rc.12",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"cookie-parser": "^1.4.6",
Expand All @@ -55,6 +56,7 @@
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@prisma/client": "^5.3.1",
"@types/cheerio": "^0.22.35",
"@types/cookie-parser": "^1.4.3",
"@types/cron": "^2.0.1",
"@types/express": "^4.17.13",
Expand Down
6 changes: 6 additions & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';

dayjs.extend(utc);
dayjs.extend(timezone);
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import cookieParser from 'cookie-parser';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import cookieParser from 'cookie-parser';
import { AppModule } from './app.module';
import './init';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
Expand Down
4 changes: 2 additions & 2 deletions src/notice/dto/getAllNotice.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class GetAllNoticeQueryDto {
@IsString()
@IsEnum(['deadline', 'hot', 'recent'])
@IsOptional()
orderBy?: string;
orderBy?: 'recent' | 'deadline' | 'hot';

@ApiProperty({
example: 'own',
Expand All @@ -75,5 +75,5 @@ export class GetAllNoticeQueryDto {
@IsString()
@IsEnum(['own', 'reminders'])
@IsOptional()
my?: string;
my?: 'own' | 'reminders';
}
21 changes: 16 additions & 5 deletions src/notice/notice.module.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';
import { NoticeController } from './notice.controller';
import { NoticeService } from './notice.service';
import { UserModule } from 'src/user/user.module';
import { ConfigModule } from '@nestjs/config';
import { ImageModule } from 'src/image/image.module';
import { FcmModule } from 'src/global/service/fcm.module';
import { ImageModule } from 'src/image/image.module';
import { PrismaModule } from 'src/prisma/prisma.module';
import { TagModule } from 'src/tag/tag.module';
import { UserModule } from 'src/user/user.module';
import { NoticeController } from './notice.controller';
import { NoticeRepository } from './notice.repository';
import { NoticeService } from './notice.service';

@Module({
imports: [ConfigModule, UserModule, ImageModule, FcmModule, PrismaModule],
imports: [
ConfigModule,
UserModule,
ImageModule,
FcmModule,
PrismaModule,
HttpModule,
TagModule,
UserModule,
],
controllers: [NoticeController],
providers: [NoticeService, NoticeRepository],
})
Expand Down
Loading

0 comments on commit 55eb3e2

Please sign in to comment.