๐งUser ์คํค๋ง
const userSchema = new Schema({
userID: { type: String, required: true, unique: true },
userName: { type: String, required: true },
isShared: { type: Boolean, default: false },
randIdx: { type: Number, default: 0 },
lastShareModified: { type: Date, default: new Date() },
lastModified: { type: Date, default: new Date() },
history: {
type: Map,
of: Date,
},
});
userID
: ์ฌ์ฉ์์ Notion ID
userName
: ์ฌ์ฉ์์ Notion ์ด๋ฆ
isShared
: ์ฌ์ฉ์์ ๊ฐค๋ฌ๋ฆฌ ๊ณต์ ์ฌ๋ถ
randIdx
: ๋ชจ๋ด๋จผํธ ์์ฑ์ ์์ฑ๋๋ ๋๋ค ๊ฐ. ๋๋ค ์ธ๋ฑ์ค ์์ฑ์ ์ฌ์ฉ๋จ.
lastShareModified
: ์ฌ์ฉ์๊ฐ ๋ง์ง๋ง์ผ๋ก ๊ฐค๋ฌ๋ฆฌ ๊ณต์ ๋ฅผ ๋ณ๊ฒฝํ ์๊ฐ.
lastModified
: ์ฌ์ฉ์๊ฐ ๋ง์ง๋ง์ผ๋ก ๊ณต์ ๋ ์๊ฐ
history
: ์ฌ์ฉ์๊ฐ ์์ฑํ ๊ฐค๋ฌ๋ฆฌ
key
: ๊ฐค๋ฌ๋ฆฌ ๊ณ ์ _id
value
: ๊ฐค๋ฌ๋ฆฌ๊ฐ ์์ฑ๋ ์๊ฐ
๐ชฆGallery ์คํค๋ง
const keywordScheama = new Schema({
keyword: { type: String, required: true },
freq: { type: Number, required: true },
});
const gallerySchema = new Schema({
theme: { type: String, required: true },
totalKeywords: [keywordScheama],
groupKeywords: [
{
position: [Number],
keyword: { type: String, default: "-" },
},
],
pages: [
{
position: [Number],
keywords: [keywordScheama],
title: { type: String, default: "-" },
subtitle: [
{
hType: String,
text: String,
},
],
links: [
{
href: String,
favicon: String,
},
],
imagePixel: [[Number]],
},
],
nodes: [[Number]],
views: { type: Number, default: 0 },
viewers: { type: Map, of: String, default: new Map() },
lastModified: { type: Date, default: new Date() },
created: { type: Date, default: new Date() },
});
theme
: ์์ฑ๋ ๊ฐค๋ฌ๋ฆฌ์ ๊ธฐ๋ณธ ํ
๋ง
totalKeywords
: ๋ชจ๋ ๋
ธ์
๊ธฐ๋ก๋ฌผ๋ค์ ํค์๋ ํต๊ณ
gropKeywords
: ๊ทธ๋ฃน์ง์ ํค์๋ ์ ๋ณด
position
: ๊ทธ๋ฃน ํค์๋ ํ์งํ์ด ์์ฑ๋ ์์น
keyword
: ๊ทธ๋ฃน ํค์๋์ ๋ด์ฉ
pages
: ๊ฐ ๋
ธ์
๊ธฐ๋ก๋ฌผ๋ค์ ๊ธฐ๋ฐํ ํ์ด์ง ์ฌ ์ ๋ณด
position
: ์ฌ์ ์์น
keywords
: ๊ฐ ๊ธฐ๋ก๋ฌผ์ ํค์๋ ์ ๋ณด
title
: ๊ฐ ๊ธฐ๋ก๋ฌผ์ ํ์ดํ
subtitle
: ๊ฐ ๊ธฐ๋ก๋ฌผ์ ๋ถ์ ๋ชฉ
hType
: ๋ถ์ ๋ชฉ์ ํ์
(h1, h2, h3 ์ค ํ๋)
text
: ๋ถ์ ๋ชฉ์ ๋ด์ฉ
links
: ๊ฐ ๊ธฐ๋ก๋ฌผ์ ๋งํฌ๋ ํ์ดํผ๋งํฌ ๋ชฉ๋ก
href
: ๋งํฌ ์ฃผ์
~~favicon
: ๋งํฌ์ ํ๋น์ฝ ์ฃผ์ (ํ์ฌ ์ฌ์ฉ๋์ง ์์)~~
imagePixel
: ๊ฐ ๊ธฐ๋ก๋ฌผ์ ์ฒจ๋ถ๋ ์ด๋ฏธ์ง
- 50 x 50 ํฌ๊ธฐ์ hex code number๋ก ์ ์ฅ๋จ (ex.
0x24adaf
)
nodes
: ํ์ด์ง์ ํ์ด์ง๋ฅผ ์๋ ๊ฐ์
views
: ํ์ด์ง์ ์กฐํ์
viewers
: ์ค๋ณต ์กฐํ๋ฅผ ๋ง๊ธฐ ์ํ ํ์ด์ง๋ฅผ ์กฐํํ ์ฌ๋์ ์ ๋ณด
~~lastModified
: ๋ง์ง๋ง์ผ๋ก ์์ ๋ ๋ ์ง~~
created
: ์์ฑ๋ ๋ ์ง