Przeglądaj źródła

Add initial models

ghorsington 5 lat temu
rodzic
commit
291696ce99

+ 2 - 1
package.json

@@ -42,6 +42,7 @@
       "sha1": "^1.1.1",
       "sqlite3": "^4.0.3",
       "translate-google": "^1.3.5",
+      "tsconfig-paths": "^3.8.0",
       "turndown": "^5.0.1",
       "typeorm": "0.2.18",
       "typescript": "^3.5.2",
@@ -53,4 +54,4 @@
       "@types/node": "^8.0.29",
       "typescript": "3.3.3333"
    }
-}
+}

+ 15 - 0
src/entity/FaceCaptionMessage.ts

@@ -0,0 +1,15 @@
+import {Entity, PrimaryColumn} from "typeorm";
+
+export enum FaceCaptionType {
+    PREFIX = "prefix",
+    POSTFIX = "postfix"
+}
+
+@Entity()
+export class FaceCaptionMessage {
+    @PrimaryColumn()
+    message: string;
+
+    @PrimaryColumn({ type: "varchar" })
+    type: FaceCaptionType;
+}

+ 11 - 0
src/entity/FaceMorphProbability.ts

@@ -0,0 +1,11 @@
+import {Entity, PrimaryColumn, Column} from "typeorm";
+
+@Entity()
+export class FaceMorphProbability {
+
+    @PrimaryColumn()
+    channelID: string;
+
+    @Column({ type: "decimal" })
+    probability: number;
+}

+ 22 - 0
src/entity/KnownUser.ts

@@ -0,0 +1,22 @@
+import {Entity, TableInheritance, PrimaryColumn, Column, ChildEntity} from "typeorm";
+import { ReactionType } from "./ReactionEmote";
+
+@Entity()
+@TableInheritance({ column: { type: "varchar", name: "type" } })
+export class KnownUser {
+    
+    @PrimaryColumn()
+    userID: string;
+
+    @Column()
+    canModerate: boolean;
+
+    @Column({ type: "varchar", default: ReactionType.NONE })
+    reactionType: ReactionType;
+}
+
+@ChildEntity()
+export class User extends KnownUser { }
+
+@ChildEntity()
+export class UserRole extends KnownUser { }

+ 10 - 0
src/entity/MessageReaction.ts

@@ -0,0 +1,10 @@
+import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
+
+@Entity()
+export class MessageReaction {
+    @PrimaryGeneratedColumn()
+    message: string;
+
+    @Column()
+    reactionEmoteId: string;
+}

+ 14 - 0
src/entity/PostedForumsNewsItem.ts

@@ -0,0 +1,14 @@
+import { Entity, PrimaryColumn, Column } from "typeorm";
+
+@Entity()
+export class PostedForumNewsItem {
+
+    @PrimaryColumn()
+    id: string;
+
+    @Column()
+    hash: string;
+
+    @Column()
+    messageId?: string;
+};

+ 3 - 7
src/entity/User.ts

@@ -1,18 +1,14 @@
 import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
 
 @Entity()
-export class User {
+export class Quote {
 
     @PrimaryGeneratedColumn()
     id: number;
 
     @Column()
-    firstName: string;
+    author: string;
 
     @Column()
-    lastName: string;
-
-    @Column()
-    age: number;
-
+    message: string;
 }

+ 18 - 0
src/entity/ReactionEmote.ts

@@ -0,0 +1,18 @@
+import {Entity, PrimaryColumn} from "typeorm";
+
+export enum ReactionType {
+    NONE = "none",
+    ANGERY = "angery",
+    HUG = "hug",
+    BIG = "big",
+    DED = "ded"
+};
+
+@Entity()
+export class ReactionEmote {
+    @PrimaryColumn({ type: "varchar" })
+    type: ReactionType;
+
+    @PrimaryColumn()
+    reactionId: string;
+}