m
This commit is contained in:
@@ -0,0 +1,542 @@
|
||||
"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);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GeneratedSystem_configController = void 0;
|
||||
const openapi = require("@nestjs/swagger");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const api_1 = require("../../app/common/api");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const typeorm_2 = require("typeorm");
|
||||
const api_optional_decorator_1 = require("../../app/common/decorator/api_optional.decorator");
|
||||
const class_validator_1 = require("class-validator");
|
||||
const order_by_enum_1 = require("../../app/common/enum/order_by.enum");
|
||||
const expression_enum_1 = require("../../app/common/enum/expression.enum");
|
||||
const class_transformer_1 = require("class-transformer");
|
||||
const system_config_model_1 = require("../../model/system_config.model");
|
||||
const ExtraExp = {
|
||||
eq: (k, v) => {
|
||||
return (0, typeorm_2.Equal)(v);
|
||||
},
|
||||
neq: (k, v) => {
|
||||
return (0, typeorm_2.Not)(v);
|
||||
},
|
||||
gt: (k, v) => {
|
||||
return (0, typeorm_2.MoreThan)(v);
|
||||
},
|
||||
egt: (k, v) => {
|
||||
return (0, typeorm_2.MoreThanOrEqual)(v);
|
||||
},
|
||||
lt: (k, v) => {
|
||||
return (0, typeorm_2.LessThan)(v);
|
||||
},
|
||||
elt: (k, v) => {
|
||||
return (0, typeorm_2.LessThanOrEqual)(v);
|
||||
},
|
||||
between: (k, v) => {
|
||||
const p = Array.isArray(v) ? v : `${v}`.split(',');
|
||||
if (p.length < 2) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof p[1] == 'undefined') {
|
||||
throw new common_1.BadRequestException({
|
||||
message: k + '字段,between查询参数错误需要用逗号分割',
|
||||
});
|
||||
}
|
||||
return (0, typeorm_2.Between)(p[0], p[1]);
|
||||
},
|
||||
'not between': (k, v) => {
|
||||
const p = Array.isArray(v) ? v : `${v}`.split(',');
|
||||
if (p.length < 2) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof p[1] == 'undefined') {
|
||||
throw new common_1.BadRequestException({
|
||||
message: k + '字段,between查询参数错误需要用逗号分割',
|
||||
});
|
||||
}
|
||||
return (0, typeorm_2.Not)((0, typeorm_2.Between)(p[0], p[1]));
|
||||
},
|
||||
in: (k, v) => {
|
||||
if (!Array.isArray(v)) {
|
||||
v = `${v}`.split(',');
|
||||
}
|
||||
return (0, typeorm_2.In)(v);
|
||||
},
|
||||
'not in': (k, v) => {
|
||||
if (!Array.isArray(v)) {
|
||||
v = `${v}`.split(',');
|
||||
}
|
||||
return (0, typeorm_2.Not)((0, typeorm_2.In)(v));
|
||||
},
|
||||
like: (k, v) => {
|
||||
return (0, typeorm_2.Like)(`%${v}%`);
|
||||
},
|
||||
slike: (k, v) => {
|
||||
return (0, typeorm_2.Like)(`${v}%`);
|
||||
},
|
||||
elike: (k, v) => {
|
||||
return (0, typeorm_2.Like)(`${v}%`);
|
||||
},
|
||||
};
|
||||
class GeneratedSystem_configFindOrderDto {
|
||||
id;
|
||||
createTime;
|
||||
updateTime;
|
||||
deleteTime;
|
||||
invitationUrl;
|
||||
customerServiceUrl;
|
||||
depositWeixinUrl;
|
||||
depositAlipayUrl;
|
||||
depositYunshanfuUrl;
|
||||
openDeposit;
|
||||
welfarePool;
|
||||
stockPrice;
|
||||
minWithdrawAmount;
|
||||
minTransferPublicityAmount;
|
||||
}
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: 'ID', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "id", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '创建时间', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "createTime", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '更新时间', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "updateTime", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '删除时间', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "deleteTime", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '邀请链接', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "invitationUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '客服链接', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "customerServiceUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '微信支付充值渠道', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "depositWeixinUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '支付宝支付充值渠道', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "depositAlipayUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '云闪付支付充值渠道', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "depositYunshanfuUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '是否打开充值', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "openDeposit", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '福利金池', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "welfarePool", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '股票价格', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "stockPrice", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '最低提现金额', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "minWithdrawAmount", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '宣传金最低划转金额', enum: order_by_enum_1.OrderBy }),
|
||||
(0, class_validator_1.IsEnum)(order_by_enum_1.OrderBy),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindOrderDto.prototype, "minTransferPublicityAmount", void 0);
|
||||
class GeneratedSystem_configFindRelationDto {
|
||||
}
|
||||
class GeneratedSystem_configFindExpressionDto {
|
||||
id;
|
||||
createTime;
|
||||
updateTime;
|
||||
deleteTime;
|
||||
invitationUrl;
|
||||
customerServiceUrl;
|
||||
depositWeixinUrl;
|
||||
depositAlipayUrl;
|
||||
depositYunshanfuUrl;
|
||||
openDeposit;
|
||||
welfarePool;
|
||||
stockPrice;
|
||||
minWithdrawAmount;
|
||||
minTransferPublicityAmount;
|
||||
}
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: 'ID', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "id", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '创建时间', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "createTime", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '更新时间', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "updateTime", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '删除时间', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "deleteTime", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '邀请链接', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "invitationUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '客服链接', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "customerServiceUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '微信支付充值渠道', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "depositWeixinUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '支付宝支付充值渠道', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "depositAlipayUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '云闪付支付充值渠道', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "depositYunshanfuUrl", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '是否打开充值', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "openDeposit", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '福利金池', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "welfarePool", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '股票价格', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "stockPrice", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '最低提现金额', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "minWithdrawAmount", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({ description: '宣传金最低划转金额', enum: expression_enum_1.Expression }),
|
||||
(0, class_validator_1.IsEnum)(expression_enum_1.Expression),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindExpressionDto.prototype, "minTransferPublicityAmount", void 0);
|
||||
class GeneratedSystem_configFindExtraDto {
|
||||
expression;
|
||||
order;
|
||||
relations;
|
||||
}
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({
|
||||
description: '查询表达式',
|
||||
example: { "id": "gt" },
|
||||
type: GeneratedSystem_configFindExpressionDto
|
||||
}),
|
||||
(0, class_transformer_1.Type)(() => GeneratedSystem_configFindExpressionDto),
|
||||
(0, class_validator_1.ValidateNested)(),
|
||||
__metadata("design:type", GeneratedSystem_configFindExpressionDto)
|
||||
], GeneratedSystem_configFindExtraDto.prototype, "expression", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({
|
||||
description: '指定字段排序',
|
||||
example: { "id": "desc" },
|
||||
type: [GeneratedSystem_configFindOrderDto],
|
||||
}),
|
||||
(0, class_validator_1.IsArray)(),
|
||||
(0, class_transformer_1.Type)(() => GeneratedSystem_configFindOrderDto),
|
||||
(0, class_validator_1.ValidateNested)({ each: true }),
|
||||
__metadata("design:type", Array)
|
||||
], GeneratedSystem_configFindExtraDto.prototype, "order", void 0);
|
||||
__decorate([
|
||||
(0, api_optional_decorator_1.ApiOptional)({
|
||||
description: '查询关联数据',
|
||||
type: GeneratedSystem_configFindRelationDto,
|
||||
}),
|
||||
(0, class_transformer_1.Type)(() => GeneratedSystem_configFindRelationDto),
|
||||
(0, class_validator_1.ValidateNested)(),
|
||||
__metadata("design:type", GeneratedSystem_configFindRelationDto)
|
||||
], GeneratedSystem_configFindExtraDto.prototype, "relations", void 0);
|
||||
class GeneratedSystem_configFindWhereDto {
|
||||
id;
|
||||
createTime;
|
||||
updateTime;
|
||||
deleteTime;
|
||||
invitationUrl;
|
||||
customerServiceUrl;
|
||||
depositWeixinUrl;
|
||||
depositAlipayUrl;
|
||||
depositYunshanfuUrl;
|
||||
openDeposit;
|
||||
welfarePool;
|
||||
stockPrice;
|
||||
minWithdrawAmount;
|
||||
minTransferPublicityAmount;
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: 'ID' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", Number)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "id", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '创建时间' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "createTime", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '更新时间' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "updateTime", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '删除时间' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "deleteTime", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '邀请链接' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "invitationUrl", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '客服链接' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "customerServiceUrl", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '微信支付充值渠道' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "depositWeixinUrl", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '支付宝支付充值渠道' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "depositAlipayUrl", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '云闪付支付充值渠道' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "depositYunshanfuUrl", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '是否打开充值' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", Boolean)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "openDeposit", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '福利金池' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "welfarePool", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '股票价格' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "stockPrice", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '最低提现金额' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "minWithdrawAmount", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '宣传金最低划转金额' }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", String)
|
||||
], GeneratedSystem_configFindWhereDto.prototype, "minTransferPublicityAmount", void 0);
|
||||
class GeneratedSystem_configFindDto {
|
||||
paginated;
|
||||
where;
|
||||
extra;
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '分页', type: api_1.PaginatedDto }),
|
||||
(0, class_transformer_1.Type)(() => api_1.PaginatedDto),
|
||||
(0, class_validator_1.ValidateNested)(),
|
||||
__metadata("design:type", api_1.PaginatedDto)
|
||||
], GeneratedSystem_configFindDto.prototype, "paginated", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '查询条件', type: GeneratedSystem_configFindWhereDto }),
|
||||
(0, class_transformer_1.Type)(() => GeneratedSystem_configFindWhereDto),
|
||||
(0, class_validator_1.ValidateNested)(),
|
||||
__metadata("design:type", GeneratedSystem_configFindWhereDto)
|
||||
], GeneratedSystem_configFindDto.prototype, "where", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '额外', type: GeneratedSystem_configFindExtraDto }),
|
||||
(0, class_transformer_1.Type)(() => GeneratedSystem_configFindExtraDto),
|
||||
(0, class_validator_1.ValidateNested)(),
|
||||
__metadata("design:type", GeneratedSystem_configFindExtraDto)
|
||||
], GeneratedSystem_configFindDto.prototype, "extra", void 0);
|
||||
class GeneratedSystem_configCreateDto extends (0, swagger_1.OmitType)(system_config_model_1.SystemConfigModel, [
|
||||
'id',
|
||||
'createTime',
|
||||
'updateTime',
|
||||
'deleteTime',
|
||||
]) {
|
||||
}
|
||||
class GeneratedSystem_configUpdateDto extends (0, swagger_1.PartialType)(GeneratedSystem_configCreateDto) {
|
||||
}
|
||||
class GeneratedSystem_configDetailWhereDto extends (0, swagger_1.PartialType)((0, swagger_1.OmitType)(GeneratedSystem_configFindWhereDto, ['id'])) {
|
||||
}
|
||||
class GeneratedSystem_configDetailDto {
|
||||
where;
|
||||
extra;
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '查询条件', type: GeneratedSystem_configDetailWhereDto }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", GeneratedSystem_configDetailWhereDto)
|
||||
], GeneratedSystem_configDetailDto.prototype, "where", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiPropertyOptional)({ description: '额外', type: GeneratedSystem_configFindExtraDto }),
|
||||
(0, class_validator_1.Allow)(),
|
||||
__metadata("design:type", GeneratedSystem_configFindExtraDto)
|
||||
], GeneratedSystem_configDetailDto.prototype, "extra", void 0);
|
||||
const identity = 'userId';
|
||||
const identityExist = false;
|
||||
let GeneratedSystem_configController = class GeneratedSystem_configController {
|
||||
repos;
|
||||
constructor(repos) {
|
||||
this.repos = repos;
|
||||
}
|
||||
async list(dto) {
|
||||
const page = dto.paginated?.page || 1;
|
||||
const size = dto.paginated?.size || 15;
|
||||
const skip = (page - 1) * size;
|
||||
let where;
|
||||
if (dto.extra?.expression && dto.where) {
|
||||
where = Object.fromEntries(Object.entries(dto.where).map(([key, value]) => {
|
||||
const expression = dto.extra?.expression[key];
|
||||
if (typeof value != 'undefined' && value != '' && value != null) {
|
||||
if (expression && ExtraExp[expression]) {
|
||||
value = ExtraExp[expression](key, value);
|
||||
}
|
||||
}
|
||||
if (expression == expression_enum_1.Expression.between &&
|
||||
(!value || (Array.isArray(value) && value.length < 2))) {
|
||||
value = undefined;
|
||||
}
|
||||
return [key, value];
|
||||
}));
|
||||
}
|
||||
else {
|
||||
where = (dto.where || {});
|
||||
}
|
||||
where = Object.fromEntries(Object.entries(where).filter(([_, v]) => {
|
||||
if (typeof v == 'undefined') {
|
||||
return false;
|
||||
}
|
||||
if (typeof v == 'string' && !v) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}));
|
||||
const o = dto.extra?.order && dto.extra?.order.length
|
||||
? dto.extra?.order
|
||||
: [{ id: 'desc' }];
|
||||
const order = Object.fromEntries(o.map((it) => Object.keys(it).map((key) => [key, it[key]]))[0]);
|
||||
const list = await this.repos.find({
|
||||
where,
|
||||
order,
|
||||
skip: skip,
|
||||
take: size,
|
||||
relations: typeof dto.extra?.relations == 'object'
|
||||
? Object.keys(dto.extra?.relations).filter((it) => dto.extra?.relations[it])
|
||||
: [],
|
||||
});
|
||||
const count = await this.repos.count({
|
||||
where: where,
|
||||
});
|
||||
return api_1.Api.pagination(list, count);
|
||||
}
|
||||
async detail(id, dto) {
|
||||
const where = {
|
||||
id,
|
||||
...dto.where,
|
||||
};
|
||||
const item = await this.repos.findOne({
|
||||
where,
|
||||
relations: typeof dto.extra?.relations == 'object'
|
||||
? Object.keys(dto.extra?.relations).filter((it) => dto.extra?.relations[it])
|
||||
: [],
|
||||
});
|
||||
return api_1.Api.success(item);
|
||||
}
|
||||
};
|
||||
exports.GeneratedSystem_configController = GeneratedSystem_configController;
|
||||
__decorate([
|
||||
(0, common_1.Post)('list'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '系统配置列表' }),
|
||||
api_1.Api.ApiPaginatedResponse({
|
||||
model: system_config_model_1.SystemConfigModel,
|
||||
codeDescription: '200成功',
|
||||
}),
|
||||
openapi.ApiResponse({ status: 201 }),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [GeneratedSystem_configFindDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GeneratedSystem_configController.prototype, "list", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('detail/:id'),
|
||||
(0, swagger_1.ApiParam)({ name: 'id', description: '系统配置ID' }),
|
||||
(0, swagger_1.ApiOperation)({ summary: '系统配置详情' }),
|
||||
api_1.Api.ApiResponse({
|
||||
model: system_config_model_1.SystemConfigModel,
|
||||
codeDescription: '200成功',
|
||||
}),
|
||||
openapi.ApiResponse({ status: 201 }),
|
||||
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Number, GeneratedSystem_configDetailDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], GeneratedSystem_configController.prototype, "detail", null);
|
||||
exports.GeneratedSystem_configController = GeneratedSystem_configController = __decorate([
|
||||
(0, common_1.Controller)('generated/system_config'),
|
||||
(0, swagger_1.ApiTags)('G系统配置'),
|
||||
__param(0, (0, typeorm_1.InjectRepository)(system_config_model_1.SystemConfigModel)),
|
||||
__metadata("design:paramtypes", [typeorm_2.Repository])
|
||||
], GeneratedSystem_configController);
|
||||
//# sourceMappingURL=generated_system_config.controller.js.map
|
||||
Reference in New Issue
Block a user