m
This commit is contained in:
Vendored
+156
@@ -0,0 +1,156 @@
|
||||
"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.RechargeModel = exports.RechargeStatus = exports.RechargeChannel = void 0;
|
||||
const openapi = require("@nestjs/swagger");
|
||||
const typeorm_1 = require("typeorm");
|
||||
const _base_model_1 = require("./_base_model");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const class_validator_1 = require("class-validator");
|
||||
const is_enum_mumber_string_1 = require("../app/common/decorator/is_enum_mumber_string");
|
||||
const api_optional_decorator_1 = require("../app/common/decorator/api_optional.decorator");
|
||||
const user_model_1 = require("./user.model");
|
||||
var RechargeChannel;
|
||||
(function (RechargeChannel) {
|
||||
RechargeChannel[RechargeChannel["WeChat"] = 1] = "WeChat";
|
||||
RechargeChannel[RechargeChannel["Alipay"] = 2] = "Alipay";
|
||||
RechargeChannel[RechargeChannel["UnionPay"] = 3] = "UnionPay";
|
||||
RechargeChannel[RechargeChannel["ShareLife"] = 4] = "ShareLife";
|
||||
})(RechargeChannel || (exports.RechargeChannel = RechargeChannel = {}));
|
||||
var RechargeStatus;
|
||||
(function (RechargeStatus) {
|
||||
RechargeStatus[RechargeStatus["Pending"] = 0] = "Pending";
|
||||
RechargeStatus[RechargeStatus["Success"] = 1] = "Success";
|
||||
RechargeStatus[RechargeStatus["Closed"] = 3] = "Closed";
|
||||
})(RechargeStatus || (exports.RechargeStatus = RechargeStatus = {}));
|
||||
let RechargeModel = class RechargeModel extends _base_model_1.BaseModel {
|
||||
userId;
|
||||
channel;
|
||||
amount;
|
||||
innerOrderNo;
|
||||
actualAmount;
|
||||
status;
|
||||
thirdPartyOrderNo;
|
||||
remark;
|
||||
user;
|
||||
static _OPENAPI_METADATA_FACTORY() {
|
||||
return { userId: { required: true, type: () => Number }, channel: { required: true, enum: require("./recharge.model").RechargeChannel }, amount: { required: true, type: () => String }, innerOrderNo: { required: true, type: () => String }, actualAmount: { required: true, type: () => String }, status: { required: true, enum: require("./recharge.model").RechargeStatus }, thirdPartyOrderNo: { required: false, type: () => String }, remark: { required: false, type: () => String }, user: { required: false, type: () => require("./user.model").UserModel } };
|
||||
}
|
||||
};
|
||||
exports.RechargeModel = RechargeModel;
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ description: '用户 ID' }),
|
||||
(0, class_validator_1.IsInt)(),
|
||||
(0, class_validator_1.IsNotEmpty)(),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'int',
|
||||
unsigned: true,
|
||||
comment: '用户 ID',
|
||||
}),
|
||||
__metadata("design:type", Number)
|
||||
], RechargeModel.prototype, "userId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
description: '充值渠道:1=微信,2=支付宝,3=云闪付,4=分享生活',
|
||||
enum: RechargeChannel,
|
||||
}),
|
||||
(0, class_validator_1.IsNotEmpty)(),
|
||||
(0, is_enum_mumber_string_1.IsEnumNumberString)(RechargeChannel),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'int',
|
||||
default: RechargeChannel.WeChat,
|
||||
comment: '充值渠道:1=微信,2=支付宝,3=云闪付,4=分享生活',
|
||||
}),
|
||||
__metadata("design:type", Number)
|
||||
], RechargeModel.prototype, "channel", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ description: '充值金额' }),
|
||||
(0, class_validator_1.IsDecimal)(),
|
||||
(0, class_validator_1.IsNotEmpty)(),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'decimal',
|
||||
precision: 20,
|
||||
scale: 6,
|
||||
comment: '充值金额',
|
||||
}),
|
||||
__metadata("design:type", String)
|
||||
], RechargeModel.prototype, "amount", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ description: '内部单号' }),
|
||||
(0, class_validator_1.IsString)(),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'varchar',
|
||||
comment: '内部单号',
|
||||
}),
|
||||
__metadata("design:type", String)
|
||||
], RechargeModel.prototype, "innerOrderNo", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ description: '实际到账金额' }),
|
||||
(0, class_validator_1.IsDecimal)(),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'decimal',
|
||||
precision: 20,
|
||||
scale: 6,
|
||||
comment: '实际到账金额',
|
||||
}),
|
||||
__metadata("design:type", String)
|
||||
], RechargeModel.prototype, "actualAmount", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
description: '充值状态:0=待支付,1=支付成功,3=已关闭',
|
||||
enum: RechargeStatus,
|
||||
}),
|
||||
(0, is_enum_mumber_string_1.IsEnumNumberString)(RechargeStatus),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'int',
|
||||
default: RechargeStatus.Pending,
|
||||
comment: '充值状态:0=待支付,1=支付成功,3=已关闭',
|
||||
}),
|
||||
__metadata("design:type", Number)
|
||||
], RechargeModel.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '第三方订单号', nullable: true }),
|
||||
(0, class_validator_1.IsString)(),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'varchar',
|
||||
comment: '第三方订单号',
|
||||
nullable: true,
|
||||
}),
|
||||
__metadata("design:type", String)
|
||||
], RechargeModel.prototype, "thirdPartyOrderNo", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '备注', nullable: true }),
|
||||
(0, class_validator_1.IsString)(),
|
||||
(0, typeorm_1.Column)({
|
||||
type: 'varchar',
|
||||
comment: '备注',
|
||||
nullable: true,
|
||||
}),
|
||||
__metadata("design:type", String)
|
||||
], RechargeModel.prototype, "remark", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({
|
||||
description: '用户',
|
||||
type: user_model_1.UserModel,
|
||||
nullable: true,
|
||||
}),
|
||||
(0, typeorm_1.OneToOne)(() => user_model_1.UserModel, {
|
||||
createForeignKeyConstraints: false,
|
||||
}),
|
||||
(0, typeorm_1.JoinColumn)(),
|
||||
__metadata("design:type", user_model_1.UserModel)
|
||||
], RechargeModel.prototype, "user", void 0);
|
||||
exports.RechargeModel = RechargeModel = __decorate([
|
||||
(0, typeorm_1.Entity)({
|
||||
comment: '充值记录',
|
||||
})
|
||||
], RechargeModel);
|
||||
//# sourceMappingURL=recharge.model.js.map
|
||||
Reference in New Issue
Block a user