Files
iblog2/models/post.js
2018-07-26 14:34:44 +08:00

44 lines
821 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const db = require('./db');
const mongoose = db.mongoose;
const base = db.base;
const postSchema = base.extend({
// 标题
Title: { type: String },
// 文章别名
Alias: { type: String },
// 摘要
Summary: { type: String },
// 来源
Source: { type: String },
// 内容
Content: { type: String },
// 内容类型:默认空 (html)可选markdown
ContentType: { type: String },
// 分类Id
CategoryId: { type: String },
// 标签
Labels: { type: String },
// 外链Url
Url: { type: String },
// 浏览次数
ViewCount: { type: Number },
// 是否草稿
IsDraft: { type: Boolean },
// 是否有效
IsActive: { type: Boolean, default: true }
});
exports.PostModel = mongoose.model('post', postSchema, 'post');