Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* @module module/tag/module
* @author Surmon
*/
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { SitemapModule } from '@app/modules/sitemap/sitemap.module';
import { Article } from '@app/modules/article/article.model';
import { TagController } from './tag.controller';
import { TagService } from './tag.service';
import { Tag } from './tag.model';
@Module({
imports: [
SitemapModule,
TypegooseModule.forFeature([Tag, Article]),
// TypegooseModule.forFeature(Article),
],
controllers: [TagController],
providers: [TagService],
exports: [TagService],
})
export class TagModule {}
* @module module/category/module
* @author Surmon
*/
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { SitemapModule } from '@app/modules/sitemap/sitemap.module';
import { Article } from '@app/modules/article/article.model';
import { CategoryController } from './category.controller';
import { CategoryService } from './category.service';
import { Category } from './category.model';
@Module({
imports: [
SitemapModule,
TypegooseModule.forFeature([Article, Category]),
// TypegooseModule.forFeature([Category]),
],
controllers: [CategoryController],
providers: [CategoryService],
exports: [CategoryService],
})
export class CategoryModule {}
import { Module, Global } from '@nestjs/common';
import { DbService } from './db.service';
import { TypegooseModule } from 'nestjs-typegoose';
import { User } from './models/user.model';
import { Course } from './models/course.model';
import { Episode } from './models/episode.model';
const models = TypegooseModule.forFeature([User, Course, Episode]);
@Global()
@Module({
imports: [
TypegooseModule.forRootAsync({
useFactory() {
return {
uri: process.env.DB,
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false,
};
},
}),
// TypegooseModule.forRoot(process.env.DB, {
* @file Sitemap 模块
* @module module/sitemap/module
* @author Surmon
*/
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { SitemapController } from './sitemap.controller';
import { SitemapService } from './sitemap.service';
import { Category } from '@app/modules/category/category.model';
import { Article } from '@app/modules/article/article.model';
import { Tag } from '@app/modules/tag/tag.model';
@Module({
imports: [
TypegooseModule.forFeature([Tag, Article, Category]),
// TypegooseModule.forFeature(Article),
// TypegooseModule.forFeature(Category),
],
controllers: [SitemapController],
providers: [SitemapService],
exports: [SitemapService],
})
export class SitemapModule {}
* @module module/comment/module
* @author Surmon
*/
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { SitemapModule } from '@app/modules/sitemap/sitemap.module';
import { CommentController } from './comment.controller';
import { CommentService } from './comment.service';
import { Comment } from './comment.model';
import { Option } from '@app/modules/option/option.model';
import { Article } from '@app/modules/article/article.model';
@Module({
imports: [
TypegooseModule.forFeature([Option, Article, Comment]),
// TypegooseModule.forFeature([Article]),
// TypegooseModule.forFeature([Comment]),
SitemapModule,
],
controllers: [CommentController],
providers: [CommentService],
exports: [CommentService],
})
export class CommentModule {}
/**
* Option module.
* @file 设置模块
* @module module/option/module
* @author Surmon
*/
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { OptionController } from './option.controller';
import { OptionService } from './option.service';
import { Option } from './option.model';
@Module({
imports: [
TypegooseModule.forFeature([Option]),
],
controllers: [OptionController],
providers: [OptionService],
exports: [OptionService],
})
export class OptionModule {}
/**
* Announcement module.
* @file 公告模块
* @module module/announcement/module
* @author Surmon
*/
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { Announcement } from './announcement.model';
import { AnnouncementService } from './announcement.service';
import { AnnouncementController } from './announcement.controller';
@Module({
imports: [
TypegooseModule.forFeature([Announcement]),
],
controllers: [AnnouncementController],
providers: [AnnouncementService],
exports: [AnnouncementService],
})
export class AnnouncementModule {}
import { Module } from '@nestjs/common';
import { TypegooseModule } from 'nestjs-typegoose';
import { TagModule } from '@app/modules/tag/tag.module';
import { CategoryModule } from '@app/modules/category/category.module';
import { SitemapModule } from '@app/modules/sitemap/sitemap.module';
import { ArticleController } from './article.controller';
import { ArticleService } from './article.service';
import { Article } from './article.model';
@Module({
imports: [
TagModule,
CategoryModule,
SitemapModule,
TypegooseModule.forFeature([{
typegooseClass: Article,
schemaOptions: {
toObject: { getters: true },
},
}]),
],
controllers: [ArticleController],
providers: [ArticleService],
exports: [ArticleService],
})
export class ArticleModule {}