diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-11 00:27:02 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-11 00:27:02 +0900 |
| commit | 3f0f307104300e148b02f05fd51ac833f9b75b01 (patch) | |
| tree | 131ad6c84bcbad684d0fac285915953045e30627 /src/api/models | |
| parent | v2996 (diff) | |
| download | sharkey-3f0f307104300e148b02f05fd51ac833f9b75b01.tar.gz sharkey-3f0f307104300e148b02f05fd51ac833f9b75b01.tar.bz2 sharkey-3f0f307104300e148b02f05fd51ac833f9b75b01.zip | |
[LINE] 通知の表示に対応
Diffstat (limited to 'src/api/models')
| -rw-r--r-- | src/api/models/notification.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/api/models/notification.ts b/src/api/models/notification.ts index 1065e8baaa..ecd1c25e10 100644 --- a/src/api/models/notification.ts +++ b/src/api/models/notification.ts @@ -1,8 +1,47 @@ import * as mongo from 'mongodb'; import db from '../../db/mongodb'; +import { IUser } from './user'; export default db.get('notifications') as any; // fuck type definition export interface INotification { _id: mongo.ObjectID; + created_at: Date; + + /** + * 通知の受信者 + */ + notifiee?: IUser; + + /** + * 通知の受信者 + */ + notifiee_id: mongo.ObjectID; + + /** + * イニシエータ(initiator)。通知を行う原因となったユーザー + */ + notifier?: IUser; + + /** + * イニシエータ(initiator)。通知を行う原因となったユーザー + */ + notifier_id: mongo.ObjectID; + + /** + * 通知の種類。 + * follow - フォローされた + * mention - 投稿で自分が言及された + * reply - (自分または自分がWatchしている)投稿が返信された + * repost - (自分または自分がWatchしている)投稿がRepostされた + * quote - (自分または自分がWatchしている)投稿が引用Repostされた + * reaction - (自分または自分がWatchしている)投稿にリアクションされた + * poll_vote - (自分または自分がWatchしている)投稿の投票に投票された + */ + type: 'follow' | 'mention' | 'reply' | 'repost' | 'quote' | 'reaction' | 'poll_vote'; + + /** + * 通知が読まれたかどうか + */ + is_read: Boolean; } |