-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "root", | ||
"private": true, | ||
"devDependencies": { | ||
"lerna": "^4.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class LinkItem { | ||
createdAt: Date; | ||
updatedAt: Date; | ||
url: string; | ||
type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class RewardItem { | ||
createdAt: Date; | ||
updatedAt: Date; | ||
value: string; | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export class SiteInfo { | ||
author: string; | ||
authorLogo: string; | ||
siteLogo: string; | ||
favicon: string; | ||
siteName: string; | ||
siteDesc: string; | ||
beianNumber: string; | ||
beianUrl: string; | ||
payAliPay: string; | ||
payWechat: string; | ||
since: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type SocialType = 'bilibili' | 'email' | 'github' | 'wechat'; | ||
export class SocialItem { | ||
createdAt: Date; | ||
updatedAt: Date; | ||
value: string; | ||
type: SocialType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | ||
import { Document } from 'mongoose'; | ||
|
||
export type ArticleDocument = Article & Document; | ||
|
||
@Schema() | ||
export class Article extends Document { | ||
@Prop() | ||
id: number; | ||
|
||
@Prop() | ||
title: string; | ||
|
||
@Prop() | ||
author: string; | ||
|
||
@Prop() | ||
content: string; | ||
|
||
@Prop() | ||
tags: string[]; | ||
|
||
@Prop() | ||
categories: string[]; | ||
|
||
@Prop() | ||
hiden: boolean; | ||
|
||
@Prop() | ||
private: boolean; | ||
|
||
@Prop() | ||
password: string; | ||
|
||
@Prop() | ||
desc: string; | ||
} | ||
|
||
export const ArticleSchema = SchemaFactory.createForClass(Article); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | ||
import { Document } from 'mongoose'; | ||
|
||
export type DraftDocument = Draft & Document; | ||
|
||
@Schema() | ||
export class Draft extends Document { | ||
@Prop() | ||
id: number; | ||
|
||
@Prop() | ||
title: string; | ||
|
||
@Prop() | ||
author: string; | ||
|
||
@Prop() | ||
content: string; | ||
|
||
@Prop() | ||
tags: string[]; | ||
|
||
@Prop() | ||
categories: string[]; | ||
|
||
@Prop() | ||
desc: string; | ||
} | ||
|
||
export const DraftSchema = SchemaFactory.createForClass(Draft); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | ||
import { Document } from 'mongoose'; | ||
import { LinkItem } from 'src/dto/link.dto'; | ||
import { RewardItem } from 'src/dto/reward.dto'; | ||
import { SiteInfo } from 'src/dto/site.dto'; | ||
import { SocialItem } from 'src/dto/social.dto'; | ||
|
||
export type MetaDocument = Meta & Document; | ||
|
||
@Schema() | ||
export class Meta extends Document { | ||
@Prop() | ||
id: number; | ||
|
||
@Prop() | ||
links: LinkItem[]; | ||
|
||
@Prop() | ||
socials: SocialItem[]; | ||
|
||
@Prop() | ||
rewards: RewardItem[]; | ||
|
||
@Prop() | ||
about: { | ||
createdAt: Date; | ||
updatedAt: Date; | ||
content: string; | ||
}; | ||
|
||
@Prop() | ||
siteInfo: SiteInfo; | ||
} | ||
|
||
export const MetaSchema = SchemaFactory.createForClass(Meta); |