Commit 6c5b1430 authored by nanahira's avatar nanahira

some entities for vip

parent ec79f783
import moment from "moment"; import moment from "moment";
import { Moment } from "moment";
import bunyan from "bunyan"; import bunyan from "bunyan";
import {Connection, ConnectionOptions, createConnection, Transaction} from "typeorm"; import {Connection, ConnectionOptions, createConnection} from "typeorm";
import { CloudReplay } from "./entities/CloudReplay"; import {CloudReplay} from "./entities/CloudReplay";
import { CloudReplayPlayer } from "./entities/CloudReplayPlayer"; import {CloudReplayPlayer} from "./entities/CloudReplayPlayer";
import { Ban } from "./entities/Ban"; import {Ban} from "./entities/Ban";
import {RandomDuelBan} from "./entities/RandomDuelBan"; import {RandomDuelBan} from "./entities/RandomDuelBan";
import _ from "underscore"; import _ from "underscore";
import {DuelLog} from "./entities/DuelLog"; import {DuelLog} from "./entities/DuelLog";
......
...@@ -2,7 +2,6 @@ import {Column, Entity, Index, OneToMany, PrimaryGeneratedColumn} from "typeorm" ...@@ -2,7 +2,6 @@ import {Column, Entity, Index, OneToMany, PrimaryGeneratedColumn} from "typeorm"
import {DuelLogPlayer} from "./DuelLogPlayer"; import {DuelLogPlayer} from "./DuelLogPlayer";
import moment from "moment"; import moment from "moment";
import _ from "underscore"; import _ from "underscore";
import {DuelLogPlayerInfo} from "../DataManager";
@Entity() @Entity()
export class DuelLog { export class DuelLog {
......
import {Column, Entity, Index, ManyToOne} from "typeorm"; import {Column, Entity, Index, ManyToOne} from "typeorm";
import {BasePlayer} from "./BasePlayer"; import {BasePlayer} from "./BasePlayer";
import {DuelLog} from "./DuelLog"; import {DuelLog} from "./DuelLog";
import {Deck} from "../DeckEncoder"; import {Deck, decodeDeck, encodeDeck} from "../DeckEncoder";
import {decodeDeck, encodeDeck} from "../DeckEncoder";
import {DuelLogPlayerInfo} from "../DataManager"; import {DuelLogPlayerInfo} from "../DataManager";
@Entity() @Entity()
......
...@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) { ...@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.User = void 0; exports.User = void 0;
const typeorm_1 = require("typeorm"); const typeorm_1 = require("typeorm");
const UserDialog_1 = require("./UserDialog");
let User = class User { let User = class User {
}; };
__decorate([ __decorate([
...@@ -21,6 +22,23 @@ __decorate([ ...@@ -21,6 +22,23 @@ __decorate([
typeorm_1.Column("varchar", { length: 16, nullable: true }), typeorm_1.Column("varchar", { length: 16, nullable: true }),
__metadata("design:type", String) __metadata("design:type", String)
], User.prototype, "chatColor", void 0); ], User.prototype, "chatColor", void 0);
__decorate([
typeorm_1.Index(),
typeorm_1.Column("datetime", { nullable: true }),
__metadata("design:type", String)
], User.prototype, "vipExpireDate", void 0);
__decorate([
typeorm_1.Column("text", { nullable: true }),
__metadata("design:type", String)
], User.prototype, "victory", void 0);
__decorate([
typeorm_1.Column("text", { nullable: true }),
__metadata("design:type", String)
], User.prototype, "words", void 0);
__decorate([
typeorm_1.OneToMany(() => UserDialog_1.UserDialog, dialog => dialog.user),
__metadata("design:type", Array)
], User.prototype, "dialogues", void 0);
User = __decorate([ User = __decorate([
typeorm_1.Entity() typeorm_1.Entity()
], User); ], User);
......
import {Column, Entity, PrimaryColumn} from "typeorm"; import {Column, Entity, Index, OneToMany, PrimaryColumn} from "typeorm";
import {UserDialog} from "./UserDialog";
@Entity() @Entity()
export class User { export class User {
...@@ -8,5 +9,16 @@ export class User { ...@@ -8,5 +9,16 @@ export class User {
@Column("varchar", {length: 16, nullable: true}) @Column("varchar", {length: 16, nullable: true})
chatColor: string; chatColor: string;
@Index()
@Column("datetime", {nullable: true})
vipExpireDate: string;
@Column("text", {nullable: true})
victory: string;
@Column("text", {nullable: true})
words: string;
@OneToMany(() => UserDialog, dialog => dialog.user)
dialogues: UserDialog[];
} }
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserDialog = void 0;
const typeorm_1 = require("typeorm");
const User_1 = require("./User");
let UserDialog = class UserDialog {
};
__decorate([
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
__metadata("design:type", Number)
], UserDialog.prototype, "id", void 0);
__decorate([
typeorm_1.Index(),
typeorm_1.Column("int", { unsigned: true }),
__metadata("design:type", Number)
], UserDialog.prototype, "cardCode", void 0);
__decorate([
typeorm_1.Column("text"),
__metadata("design:type", String)
], UserDialog.prototype, "text", void 0);
__decorate([
typeorm_1.ManyToOne(() => User_1.User, user => user.dialogues),
__metadata("design:type", User_1.User)
], UserDialog.prototype, "user", void 0);
UserDialog = __decorate([
typeorm_1.Entity()
], UserDialog);
exports.UserDialog = UserDialog;
//# sourceMappingURL=UserDialog.js.map
\ No newline at end of file
import {Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn} from "typeorm";
import {User} from "./User";
@Entity()
export class UserDialog {
@PrimaryGeneratedColumn({ unsigned: true, type: "bigint" })
id: number;
@Index()
@Column("int", {unsigned: true})
cardCode: number;
@Column("text")
text: string;
@ManyToOne(() => User, user => user.dialogues)
user: User;
}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.VipKey = void 0;
const typeorm_1 = require("typeorm");
let VipKey = class VipKey {
toJSON() {
return { key: this.key, type: this.type };
}
};
__decorate([
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
__metadata("design:type", Number)
], VipKey.prototype, "id", void 0);
__decorate([
typeorm_1.Index({ unique: true }),
typeorm_1.Column("varchar", { length: 30 }),
__metadata("design:type", String)
], VipKey.prototype, "key", void 0);
__decorate([
typeorm_1.Column("int", { unsigned: true }),
__metadata("design:type", Number)
], VipKey.prototype, "type", void 0);
VipKey = __decorate([
typeorm_1.Entity()
], VipKey);
exports.VipKey = VipKey;
//# sourceMappingURL=VipKey.js.map
\ No newline at end of file
import {Column, Entity, Index, PrimaryGeneratedColumn, Unique} from "typeorm"; import {Column, Entity, Index, PrimaryGeneratedColumn} from "typeorm";
@Entity() @Entity()
export class VipKey { export class VipKey {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment