Commit f39f109b authored by nanahira's avatar nanahira

Merge branch 'mc'

parents 3d9f0c3c 7fde6a42
Pipeline #1263 passed with stages
in 12 minutes and 7 seconds
......@@ -11,7 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.Ban = void 0;
const typeorm_1 = require("typeorm");
let Ban = class Ban {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let Ban = class Ban extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
};
__decorate([
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
......
import {Column, Entity, Index, PrimaryGeneratedColumn, Unique} from "typeorm";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity()
@Unique(["ip", "name"])
export class Ban {
export class Ban extends CreateAndUpdateTimeBase {
@PrimaryGeneratedColumn({ unsigned: true, type: "bigint" })
id: number;
......
......@@ -11,7 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.BasePlayer = void 0;
const typeorm_1 = require("typeorm");
class BasePlayer {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
class BasePlayer extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
}
__decorate([
typeorm_1.PrimaryGeneratedColumn({ unsigned: true, type: "bigint" }),
......
import {Column, PrimaryGeneratedColumn} from "typeorm";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
export abstract class BasePlayer {
export abstract class BasePlayer extends CreateAndUpdateTimeBase {
@PrimaryGeneratedColumn({unsigned: true, type: "bigint"})
id: number;
......
......@@ -17,7 +17,8 @@ const typeorm_1 = require("typeorm");
const CloudReplayPlayer_1 = require("./CloudReplayPlayer");
const underscore_1 = __importDefault(require("underscore"));
const moment_1 = __importDefault(require("moment"));
let CloudReplay = class CloudReplay {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let CloudReplay = class CloudReplay extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
fromBuffer(buffer) {
this.data = buffer.toString("base64");
}
......
......@@ -2,13 +2,14 @@ import {Column, Entity, Index, OneToMany, PrimaryColumn} from "typeorm";
import {CloudReplayPlayer} from "./CloudReplayPlayer";
import _ from "underscore";
import moment from "moment";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity({
orderBy: {
date: "DESC"
}
})
export class CloudReplay {
export class CloudReplay extends CreateAndUpdateTimeBase {
@PrimaryColumn({ unsigned: true, type: "bigint" })
id: number;
......
"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.CreateAndUpdateTimeBase = void 0;
const typeorm_1 = require("typeorm");
class CreateAndUpdateTimeBase {
}
__decorate([
typeorm_1.CreateDateColumn(),
__metadata("design:type", Date)
], CreateAndUpdateTimeBase.prototype, "createTime", void 0);
__decorate([
typeorm_1.UpdateDateColumn(),
__metadata("design:type", Date)
], CreateAndUpdateTimeBase.prototype, "updateTime", void 0);
exports.CreateAndUpdateTimeBase = CreateAndUpdateTimeBase;
//# sourceMappingURL=CreateAndUpdateTimeBase.js.map
\ No newline at end of file
import {CreateDateColumn, UpdateDateColumn} from "typeorm";
export abstract class CreateAndUpdateTimeBase {
@CreateDateColumn()
createTime: Date;
@UpdateDateColumn()
updateTime: Date;
}
......@@ -17,7 +17,8 @@ const typeorm_1 = require("typeorm");
const DuelLogPlayer_1 = require("./DuelLogPlayer");
const moment_1 = __importDefault(require("moment"));
const underscore_1 = __importDefault(require("underscore"));
let DuelLog = class DuelLog {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let DuelLog = class DuelLog extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
getViewString() {
const viewPlayers = underscore_1.default.clone(this.players);
viewPlayers.sort((p1, p2) => p1.pos - p2.pos);
......
......@@ -2,13 +2,14 @@ import {Column, Entity, Index, OneToMany, PrimaryGeneratedColumn} from "typeorm"
import {DuelLogPlayer} from "./DuelLogPlayer";
import moment from "moment";
import _ from "underscore";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity({
orderBy: {
id: "DESC"
}
})
export class DuelLog {
export class DuelLog extends CreateAndUpdateTimeBase {
@PrimaryGeneratedColumn({unsigned: true, type: "bigint"})
id: number;
......
......@@ -11,7 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.RandomDuelBan = void 0;
const typeorm_1 = require("typeorm");
let RandomDuelBan = class RandomDuelBan {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let RandomDuelBan = class RandomDuelBan extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
setNeedTip(need) {
this.needTip = need ? 1 : 0;
}
......
import {Column, Entity, PrimaryColumn} from "typeorm";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity()
export class RandomDuelBan {
export class RandomDuelBan extends CreateAndUpdateTimeBase {
@PrimaryColumn({type: "varchar", length: 64})
ip: string;
......
......@@ -11,7 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.RandomDuelScore = void 0;
const typeorm_1 = require("typeorm");
let RandomDuelScore = class RandomDuelScore {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let RandomDuelScore = class RandomDuelScore extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
getDisplayName() {
return this.name.split("$")[0];
}
......
import {Column, Entity, Index, PrimaryColumn} from "typeorm";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity()
export class RandomDuelScore {
export class RandomDuelScore extends CreateAndUpdateTimeBase {
@PrimaryColumn({type: "varchar", length: 20})
name: string;
......
......@@ -17,7 +17,8 @@ const typeorm_1 = require("typeorm");
const UserDialog_1 = require("./UserDialog");
const VipKey_1 = require("./VipKey");
const moment_1 = __importDefault(require("moment"));
let User = class User {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let User = class User extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
isVip() {
return this.vipExpireDate && moment_1.default().isBefore(this.vipExpireDate);
}
......
......@@ -2,9 +2,10 @@ import {Column, Entity, Index, OneToMany, PrimaryColumn} from "typeorm";
import {UserDialog} from "./UserDialog";
import {VipKey} from "./VipKey";
import moment from "moment";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity()
export class User {
export class User extends CreateAndUpdateTimeBase {
@PrimaryColumn({type: "varchar", length: 128})
key: string;
......
......@@ -12,7 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.VipKey = void 0;
const typeorm_1 = require("typeorm");
const User_1 = require("./User");
let VipKey = class VipKey {
const CreateAndUpdateTimeBase_1 = require("./CreateAndUpdateTimeBase");
let VipKey = class VipKey extends CreateAndUpdateTimeBase_1.CreateAndUpdateTimeBase {
toJSON() {
return { key: this.key, type: this.type };
}
......
import {Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn} from "typeorm";
import {User} from "./User";
import {CreateAndUpdateTimeBase} from "./CreateAndUpdateTimeBase";
@Entity()
export class VipKey {
export class VipKey extends CreateAndUpdateTimeBase {
@PrimaryGeneratedColumn({unsigned: true, type: "bigint"})
id: number;
......
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