Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
017ee255
Commit
017ee255
authored
Sep 11, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关于我的 数据模型
parent
9d176fc7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
forumAboutMe.js
app/models/forumAboutMe.js
+78
-0
No files found.
app/models/forumAboutMe.js
0 → 100644
View file @
017ee255
'use strict'
;
var
mongoose
=
require
(
'mongoose'
),
Schema
=
mongoose
.
Schema
;
//话题评论
var
ForumAboutMeSchema
=
new
Schema
({
ent_code
:
{
type
:
Number
,
require
:
true
,
index
:
true
},
owner
:
{
//归属用户(本人)
type
:
Schema
.
Types
.
ObjectId
,
require
:
true
,
index
:
true
,
ref
:
'ForumUser'
},
type
:{
//分类 1.我发的贴子(创建帖子) 2.我的帖子的一级评论(创建一级评论时,thread.from是我的) 3.评论我的评论(创建二级评论时,to是我)(帖子不一定是我自己的)
type
:
Number
,
require
:
true
,
default
:
0
},
thread
:{
//帖子 type为1,2时必定为我发的帖子
type
:
Schema
.
Types
.
ObjectId
,
index
:
true
,
ref
:
'ForumThread'
,
require
:
true
},
threadOwner
:{
//发帖人(储存非我的帖子的发帖人) type为3是需要
type
:
Schema
.
Types
.
ObjectId
,
require
:
false
,
index
:
true
,
ref
:
'ForumUser'
},
threadStatus
:{
//帖子状态
type
:
Number
,
require
:
true
,
default
:
0
},
comment
:{
//评论(别人对我的评论) type为2和3时必须
type
:
Schema
.
Types
.
ObjectId
,
require
:
false
,
index
:
true
,
ref
:
'ForumComment'
},
commentOwner
:{
//评论人 type为2和3时必须
type
:
Schema
.
Types
.
ObjectId
,
require
:
false
,
index
:
true
,
ref
:
'ForumUser'
},
commentStatus
:{
//评论状态
type
:
Number
,
require
:
true
,
default
:
0
},
parentComment
:{
//父级评论(我发的评论) type为3时需要
type
:
Schema
.
Types
.
ObjectId
,
require
:
false
,
index
:
true
,
ref
:
'ForumComment'
},
parentCommentStatus
:{
//评论状态
type
:
Number
,
require
:
true
,
default
:
0
},
created
:
{
//时间
type
:
Date
,
require
:
true
,
default
:
Date
.
now
}
},
{
'collection'
:
'pisns_forum_about_me'
});
module
.
exports
=
mongoose
.
model
(
'ForumAboutMe'
,
ForumAboutMeSchema
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment