diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-24 06:17:55 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-24 06:17:55 +0900 |
| commit | a136715111de5a7822b97d43681d20e494d43505 (patch) | |
| tree | c451210ecaca628d2c7bb953104710f2fa8569ff /src/models/instance.ts | |
| parent | Make max allowed text length configurable (#2992) (diff) | |
| download | sharkey-a136715111de5a7822b97d43681d20e494d43505.tar.gz sharkey-a136715111de5a7822b97d43681d20e494d43505.tar.bz2 sharkey-a136715111de5a7822b97d43681d20e494d43505.zip | |
Implement #2993
Diffstat (limited to 'src/models/instance.ts')
| -rw-r--r-- | src/models/instance.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/models/instance.ts b/src/models/instance.ts new file mode 100644 index 0000000000..d3906df427 --- /dev/null +++ b/src/models/instance.ts @@ -0,0 +1,35 @@ +import * as mongo from 'mongodb'; +import db from '../db/mongodb'; + +const Instance = db.get<IInstance>('instances'); +Instance.createIndex('host', { unique: true }); +export default Instance; + +export interface IInstance { + _id: mongo.ObjectID; + + /** + * ホスト + */ + host: string; + + /** + * このインスタンスを捕捉した日時 + */ + caughtAt: Date; + + /** + * このインスタンスのシステム (MastodonとかMisskeyとかPleromaとか) + */ + system: string; + + /** + * このインスタンスのユーザー数 + */ + usersCount: number; + + /** + * このインスタンスから受け取った投稿数 + */ + notesCount: number; +} |