Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class Post extends Model {
- static table = 'posts'
- static timestamps = true
- static fields = {
- id: {primaryKey: true, autoIncrement: true},
- board: {type: DataTypes.STRING, length: 5},
- num: {type: DataTypes.INTEGER, unique: true},
- number: {type: DataTypes.INTEGER},
- comment: DataTypes.TEXT,
- email: DataTypes.STRING,
- timestamp: DataTypes.TIMESTAMP,
- thread_num: DataTypes.INTEGER,
- name: DataTypes.STRING,
- files: DataTypes.INTEGER,
- op: DataTypes.BOOLEAN,
- views: DataTypes.INTEGER,
- }
- }
- export class Thread extends Model {
- static table = 'threads'
- static timestamps = true
- static fields = {
- id: {primaryKey: true, autoIncrement: true},
- board: {type: DataTypes.STRING, length: 5},
- thread_num: {type: DataTypes.INTEGER, unique: true},
- }
- }
- export class ThreadMetrics extends Model {
- static table = 'thread_metrics'
- static timestamps = true
- static fields = {
- id: {primaryKey: true, autoIncrement: true},
- board: {type: DataTypes.STRING, length: 5},
- thread_num: DataTypes.INTEGER,
- posts_count: DataTypes.INTEGER,
- unique_posters: DataTypes.INTEGER,
- views: DataTypes.INTEGER,
- files_count: DataTypes.INTEGER,
- }
- }
- export type TBoardPageInfo = {
- board: {
- id: string
- },
- threads: {
- files_count: number,
- thread_num: number,
- posts: {
- board: string,
- comment: string,
- date: string,
- email: string,
- files: TFile[],
- name: string,
- num: number,
- subject: string,
- views: number,
- }[]
- }[]
- }
- export type TThreadInfo = {
- board: {
- id: string
- },
- current_thread: number,
- max_num: number,
- posts_count: number,
- threads: [
- {
- posts: [
- {
- comment: string,
- date: string,
- email: string,
- files: TFile[],
- name: string,
- // Глобальный номер поста
- num: number,
- // Номер поста в треде
- number: 1,
- op: 0,
- subject: string,
- timestamp: number,
- views: number
- }
- ]
- }
- ],
- title: string,
- unique_posters: number
- }
- export type TFile = {
- type: 1,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement