This commit is contained in:
qq
2026-04-21 22:34:39 +08:00
commit c28429b589
718 changed files with 48804 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
# mysql
MYSQL_HOST=localhost
MYSQL_PROT=3306
MYSQL_DATABASE=energy_db
MYSQL_USERNAME=root
MYSQL_PASSWORD=00000000
# redis
REDIS_HOST=localhost
REDIS_PROT=6379
#JWT
JWT_API_SECRET=api
JWT_ADMIN_SECRET=admin
# 服务端口
SERVER_PROT=4001
STATIC_DIR=static
# IM
IM_APP_ID=1600106760
IM_SECRET_KEY=100286f27948e03c6ab3ffa53e9edef1ffc707280a12f506458a6be7c89b9bd8
IM_APP_IDENTIFIER=18688887777
# 用户ID前缀
IM_USER_ID_PREFIX=IM_ENERGY_TEST_
# 用户注册时自动加入的群ID
IM_DEFAULT_GROUP_ID=IM_ENERGY_TEST_GROUP_1
# 用户注册时自动加入的群名称
IM_DEFAULT_GROUP_NAME=N源
# 用户注册时自动加入的群类型:Public/Community
IM_DEFAULT_GROUP_TYPE=Public
# 自动领红包-发送用户id
IM_AUTO_CLAIMED_RED_PACKET_SEND_UIDS=1,2,3
# 自动领红包-发送群ID
IM_AUTO_CLAIMED_RED_PACKET_SEND_GROUPIDS=1,2,3
+61
View File
@@ -0,0 +1,61 @@
# compiled output
/node_modules
/build
/static
/src/api_code_generator
/src/migration
.env
# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
yarn.lock
medias/
sessions/
# OS
.DS_Store
# Tests
/coverage
/.nyc_output
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# temp directory
.temp
.tmp
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+23
View File
@@ -0,0 +1,23 @@
export declare class AppEnv {
static SERVER_PROT: number;
static STATIC_DIR: string;
static MYSQL_HOST: string;
static MYSQL_PROT: number;
static MYSQL_DATABASE: string;
static MYSQL_USERNAME: string;
static MYSQL_PASSWORD: string;
static MONGO_DB_URI: string;
static REDIS_HOST: string;
static REDIS_PROT: number;
static JWT_API_SECRET: string;
static JWT_ADMIN_SECRET: string;
static IM_APP_ID: number;
static IM_SECRET_KEY: string;
static IM_USER_ID_PREFIX: string;
static IM_APP_IDENTIFIER: string;
static IM_DEFAULT_GROUP_ID: string;
static IM_DEFAULT_GROUP_NAME: string;
static IM_DEFAULT_GROUP_TYPE: string;
static IM_AUTO_CLAIMED_RED_PACKET_SEND_UIDS: string;
static IM_AUTO_CLAIMED_RED_PACKET_SEND_GROUPIDS: string;
}
+30
View File
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppEnv = void 0;
const dotenv_1 = require("dotenv");
(0, dotenv_1.config)();
class AppEnv {
static SERVER_PROT = Number(process.env.SERVER_PROT);
static STATIC_DIR = process.env.STATIC_DIR;
static MYSQL_HOST = process.env.MYSQL_HOST;
static MYSQL_PROT = Number(process.env.MYSQL_PROT);
static MYSQL_DATABASE = process.env.MYSQL_DATABASE;
static MYSQL_USERNAME = process.env.MYSQL_USERNAME;
static MYSQL_PASSWORD = process.env.MYSQL_PASSWORD;
static MONGO_DB_URI = process.env.MONGO_DB_URI;
static REDIS_HOST = process.env.REDIS_HOST;
static REDIS_PROT = Number(process.env.REDIS_PROT);
static JWT_API_SECRET = process.env.JWT_API_SECRET;
static JWT_ADMIN_SECRET = process.env.JWT_ADMIN_SECRET;
static IM_APP_ID = Number(process.env.IM_APP_ID);
static IM_SECRET_KEY = process.env.IM_SECRET_KEY;
static IM_USER_ID_PREFIX = process.env.IM_USER_ID_PREFIX;
static IM_APP_IDENTIFIER = process.env.IM_APP_IDENTIFIER;
static IM_DEFAULT_GROUP_ID = process.env.IM_DEFAULT_GROUP_ID;
static IM_DEFAULT_GROUP_NAME = process.env.IM_DEFAULT_GROUP_NAME;
static IM_DEFAULT_GROUP_TYPE = process.env.IM_DEFAULT_GROUP_TYPE;
static IM_AUTO_CLAIMED_RED_PACKET_SEND_UIDS = process.env.IM_AUTO_CLAIMED_RED_PACKET_SEND_UIDS;
static IM_AUTO_CLAIMED_RED_PACKET_SEND_GROUPIDS = process.env.IM_AUTO_CLAIMED_RED_PACKET_SEND_GROUPIDS;
}
exports.AppEnv = AppEnv;
//# sourceMappingURL=app.env.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"app.env.js","sourceRoot":"","sources":["../src/app.env.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,IAAA,eAAM,GAAE,CAAC;AACT,MAAa,MAAM;IACV,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAW,CAAC;IAE5C,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAW,CAAC;IAC5C,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAe,CAAC;IACpD,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAe,CAAC;IACpD,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAe,CAAC;IAEpD,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAa,CAAC;IAEhD,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAW,CAAC;IAC5C,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEnD,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAe,CAAC;IACpD,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAiB,CAAC;IAExD,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAc,CAAC;IAClD,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAkB,CAAC;IAC1D,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAkB,CAAC;IAE1D,MAAM,CAAC,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAoB,CAAC;IAE9D,MAAM,CAAC,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAsB,CAAC;IAElE,MAAM,CAAC,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAsB,CAAC;IAGlE,MAAM,CAAC,oCAAoC,GAChD,OAAO,CAAC,GAAG,CAAC,oCAAqC,CAAC;IAE7C,MAAM,CAAC,wCAAwC,GACpD,OAAO,CAAC,GAAG,CAAC,wCAAyC,CAAC;;AAnC1D,wBAoCC"}
+4
View File
@@ -0,0 +1,4 @@
import { MiddlewareConsumer, NestModule } from '@nestjs/common';
export declare class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer): void;
}
+60
View File
@@ -0,0 +1,60 @@
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppModule = void 0;
const common_1 = require("@nestjs/common");
const api_module_1 = require("./app/api/api.module");
const core_1 = require("@nestjs/core");
const path_1 = require("path");
const context_middleware_1 = require("./app/common/middleware/context.middleware");
const common_module_1 = require("./app/common/common.module");
const platform_express_1 = require("@nestjs/platform-express");
const multer_1 = require("multer");
const hash_generator_help_1 = require("./app/common/util/hash_generator_help");
const app_env_1 = require("./app.env");
const admin_module_1 = require("./app/admin/admin.module");
let AppModule = class AppModule {
configure(consumer) {
consumer.apply(context_middleware_1.ContextMiddleware).forRoutes('*');
}
};
exports.AppModule = AppModule;
exports.AppModule = AppModule = __decorate([
(0, common_1.Global)(),
(0, common_1.Module)({
imports: [
common_module_1.CommonModule,
platform_express_1.MulterModule.register({
storage: (0, multer_1.diskStorage)({
destination: app_env_1.AppEnv.STATIC_DIR + '/uploads',
filename: (req, file, callback) => {
const randomName = hash_generator_help_1.HashGeneratorHelp.generateHash();
return callback(null, `${randomName}${(0, path_1.extname)(file.originalname)}`);
},
}),
}),
api_module_1.ApiModule,
core_1.RouterModule.register([
{
path: 'api',
module: api_module_1.ApiModule,
},
]),
admin_module_1.AdminModule,
core_1.RouterModule.register([
{
path: 'admin',
module: admin_module_1.AdminModule,
},
]),
],
controllers: [],
exports: [platform_express_1.MulterModule, common_module_1.CommonModule],
})
], AppModule);
//# sourceMappingURL=app.module.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgF;AAChF,qDAAiD;AACjD,uCAA4C;AAC5C,+BAA+B;AAC/B,mFAA+E;AAC/E,8DAA0D;AAC1D,+DAAwD;AACxD,mCAAqC;AACrC,+EAA0E;AAC1E,uCAAmC;AACnC,2DAAuD;AAkChD,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB,SAAS,CAAC,QAA4B;QACpC,QAAQ,CAAC,KAAK,CAAC,sCAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AAJY,8BAAS;oBAAT,SAAS;IAhCrB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,4BAAY;YACZ,+BAAY,CAAC,QAAQ,CAAC;gBACpB,OAAO,EAAE,IAAA,oBAAW,EAAC;oBACnB,WAAW,EAAE,gBAAM,CAAC,UAAU,GAAG,UAAU;oBAC3C,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;wBAChC,MAAM,UAAU,GAAG,uCAAiB,CAAC,YAAY,EAAE,CAAC;wBACpD,OAAO,QAAQ,CAAC,IAAI,EAAE,GAAG,UAAU,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;oBACtE,CAAC;iBACF,CAAC;aACH,CAAC;YAEF,sBAAS;YACT,mBAAY,CAAC,QAAQ,CAAC;gBACpB;oBACE,IAAI,EAAE,KAAK;oBACX,MAAM,EAAE,sBAAS;iBAClB;aACF,CAAC;YACF,0BAAW;YACX,mBAAY,CAAC,QAAQ,CAAC;gBACpB;oBACE,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,0BAAW;iBACpB;aACF,CAAC;SACH;QACD,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,CAAC,+BAAY,EAAE,4BAAY,CAAC;KACtC,CAAC;GACW,SAAS,CAIrB"}
+4
View File
@@ -0,0 +1,4 @@
import { MiddlewareConsumer, NestModule } from '@nestjs/common';
export declare class AdminModule implements NestModule {
configure(consumer: MiddlewareConsumer): void;
}
+37
View File
@@ -0,0 +1,37 @@
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdminModule = void 0;
const admin_1 = require("../../generated/admin");
const core_1 = require("@nestjs/core");
const auth_guard_1 = require("./auth.guard");
const app_module_decorator_1 = require("../common/decorator/app_module.decorator");
const path_1 = require("path");
const auth_middleware_1 = require("./middleware/auth.middleware");
let AdminModule = class AdminModule {
configure(consumer) {
consumer.apply(auth_middleware_1.AuthMiddleware).forRoutes('*');
}
};
exports.AdminModule = AdminModule;
exports.AdminModule = AdminModule = __decorate([
(0, app_module_decorator_1.AppModule)({
controllersDir: (0, path_1.join)(__dirname, './controller'),
serviceDir: (0, path_1.join)(__dirname, './service'),
}, {
imports: [],
controllers: [...admin_1.ApiGeneratedControllers],
providers: [
{
provide: core_1.APP_GUARD,
useClass: auth_guard_1.AdminAuthGuard,
},
],
})
], AdminModule);
//# sourceMappingURL=admin.module.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"admin.module.js","sourceRoot":"","sources":["../../../src/app/admin/admin.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iDAA8D;AAC9D,uCAAyC;AACzC,6CAA8C;AAC9C,mFAAqE;AACrE,+BAA4B;AAE5B,kEAA8D;AAkBvD,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,SAAS,CAAC,QAA4B;QACpC,QAAQ,CAAC,KAAK,CAAC,gCAAc,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;CACF,CAAA;AAJY,kCAAW;sBAAX,WAAW;IAhBvB,IAAA,gCAAS,EACR;QACE,cAAc,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,cAAc,CAAC;QAC/C,UAAU,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,WAAW,CAAC;KACzC,EACD;QACE,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC,GAAG,+BAAuB,CAAC;QACzC,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,2BAAc;aACzB;SACF;KACF,CACF;GACY,WAAW,CAIvB"}
+7
View File
@@ -0,0 +1,7 @@
import { CanActivate, ExecutionContext } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
export declare class AdminAuthGuard implements CanActivate {
private reflector;
constructor(reflector: Reflector);
canActivate(context: ExecutionContext): boolean;
}
+41
View File
@@ -0,0 +1,41 @@
"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.AdminAuthGuard = void 0;
const common_1 = require("@nestjs/common");
const core_1 = require("@nestjs/core");
const public_decorator_1 = require("../common/decorator/public.decorator");
const user_id_context_1 = require("../common/context/user_id.context");
let AdminAuthGuard = class AdminAuthGuard {
reflector;
constructor(reflector) {
this.reflector = reflector;
}
canActivate(context) {
const req = context.switchToHttp().getRequest();
if (!req.path.startsWith('/admin')) {
return true;
}
if ((0, public_decorator_1.isAuthPublic)(this.reflector, context)) {
return true;
}
if (!(0, user_id_context_1.getUserIdContext)()) {
throw new common_1.UnauthorizedException();
}
return true;
}
};
exports.AdminAuthGuard = AdminAuthGuard;
exports.AdminAuthGuard = AdminAuthGuard = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [core_1.Reflector])
], AdminAuthGuard);
//# sourceMappingURL=auth.guard.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"auth.guard.js","sourceRoot":"","sources":["../../../src/app/admin/auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAKwB;AACxB,uCAAyC;AACzC,2EAAyE;AACzE,uEAAqE;AAO9D,IAAM,cAAc,GAApB,MAAM,cAAc;IACL;IAApB,YAAoB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAE5C,WAAW,CAAC,OAAyB;QACnC,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAoB,CAAC;QAElE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,IAAA,+BAAY,EAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAC,IAAA,kCAAgB,GAAE,EAAE,CAAC;YACxB,MAAM,IAAI,8BAAqB,EAAE,CAAC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAlBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEoB,gBAAS;GAD7B,cAAc,CAkB1B"}
+9
View File
@@ -0,0 +1,9 @@
import { SystemConfigService } from 'src/app/common/service/system_config.service';
import { SystemConfigModel } from 'src/model/system_config.model';
import { UpdateSystemConfigDto } from '../dto/config.dto';
export declare class ConfigController {
private readonly systemConfigService;
constructor(systemConfigService: SystemConfigService);
getSystemConfig(): Promise<import("src/app/common/api").ApiResponseVo<SystemConfigModel | undefined>>;
updateSystemConfig(dto: UpdateSystemConfigDto): Promise<import("src/app/common/api").ApiResponseVo<SystemConfigModel | undefined>>;
}
+68
View File
@@ -0,0 +1,68 @@
"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.ConfigController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const api_1 = require("../../common/api");
const system_config_service_1 = require("../../common/service/system_config.service");
const system_config_model_1 = require("../../../model/system_config.model");
const config_dto_1 = require("../dto/config.dto");
let ConfigController = class ConfigController {
systemConfigService;
constructor(systemConfigService) {
this.systemConfigService = systemConfigService;
}
async getSystemConfig() {
const config = await this.systemConfigService.readConfig();
return api_1.Api.success(config);
}
async updateSystemConfig(dto) {
const config = await this.systemConfigService.updateConfig(dto);
return api_1.Api.success(config);
}
};
exports.ConfigController = ConfigController;
__decorate([
(0, common_1.Get)('system'),
(0, swagger_1.ApiOperation)({ summary: '获取系统配置' }),
api_1.Api.ApiResponse({
codeDescription: '200成功,400失败',
model: system_config_model_1.SystemConfigModel,
}),
openapi.ApiResponse({ status: 200 }),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", Promise)
], ConfigController.prototype, "getSystemConfig", null);
__decorate([
(0, common_1.Put)('system'),
(0, swagger_1.ApiOperation)({ summary: '更新系统配置' }),
api_1.Api.ApiResponse({
codeDescription: '200成功,400失败',
model: system_config_model_1.SystemConfigModel,
}),
openapi.ApiResponse({ status: 200 }),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [config_dto_1.UpdateSystemConfigDto]),
__metadata("design:returntype", Promise)
], ConfigController.prototype, "updateSystemConfig", null);
exports.ConfigController = ConfigController = __decorate([
(0, common_1.Controller)('config'),
(0, swagger_1.ApiTags)('系统配置'),
__metadata("design:paramtypes", [system_config_service_1.SystemConfigService])
], ConfigController);
//# sourceMappingURL=config.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"config.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/config.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,6CAAwD;AACxD,0CAAyC;AACzC,sFAAmF;AACnF,4EAAkE;AAClE,kDAA0D;AAInD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACE;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAQnE,AAAN,KAAK,CAAC,eAAe;QACnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC;QAC3D,OAAO,SAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAQK,AAAN,KAAK,CAAC,kBAAkB,CAAS,GAA0B;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAChE,OAAO,SAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AAxBY,4CAAgB;AASrB;IANL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAG,CAAC,WAAW,CAAC;QACf,eAAe,EAAE,aAAa;QAC9B,KAAK,EAAE,uCAAiB;KACzB,CAAC;;;;;uDAID;AAQK;IANL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAG,CAAC,WAAW,CAAC;QACf,eAAe,EAAE,aAAa;QAC9B,KAAK,EAAE,uCAAiB;KACzB,CAAC;;IACwB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,kCAAqB;;0DAG1D;2BAvBU,gBAAgB;IAF5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,iBAAO,EAAC,MAAM,CAAC;qCAEoC,2CAAmB;GAD1D,gBAAgB,CAwB5B"}
+7
View File
@@ -0,0 +1,7 @@
import { AdminGiftService } from '../service/gift.service';
import { AdminGiftProductDto } from '../dto/gift.dto';
export declare class AdminGiftController {
private readonly giftService;
constructor(giftService: AdminGiftService);
giftProduct(dto: AdminGiftProductDto): Promise<import("src/app/common/api").ApiResponseVo<unknown>>;
}
+52
View File
@@ -0,0 +1,52 @@
"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.AdminGiftController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const api_1 = require("../../common/api");
const gift_service_1 = require("../service/gift.service");
const gift_dto_1 = require("../dto/gift.dto");
const gift_vo_1 = require("../vo/gift.vo");
let AdminGiftController = class AdminGiftController {
giftService;
constructor(giftService) {
this.giftService = giftService;
}
async giftProduct(dto) {
return await this.giftService.giftProduct(dto);
}
};
exports.AdminGiftController = AdminGiftController;
__decorate([
(0, common_1.Post)('product'),
(0, swagger_1.ApiOperation)({ summary: '给指定用户赠送理财产品' }),
(0, swagger_1.ApiBody)({ type: gift_dto_1.AdminGiftProductDto }),
api_1.Api.ApiResponse({
model: gift_vo_1.AdminGiftProductVo,
codeDescription: '200成功,400失败',
}),
openapi.ApiResponse({ status: 201 }),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [gift_dto_1.AdminGiftProductDto]),
__metadata("design:returntype", Promise)
], AdminGiftController.prototype, "giftProduct", null);
exports.AdminGiftController = AdminGiftController = __decorate([
(0, common_1.Controller)('gift'),
(0, swagger_1.ApiTags)('赠送管理'),
__metadata("design:paramtypes", [gift_service_1.AdminGiftService])
], AdminGiftController);
//# sourceMappingURL=gift.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"gift.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/gift.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAiE;AACjE,0CAAyC;AACzC,0DAA2D;AAC3D,8CAAsD;AACtD,2CAAmD;AAI5C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACD;IAA7B,YAA6B,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;IAAG,CAAC;IASxD,AAAN,KAAK,CAAC,WAAW,CAAS,GAAwB;QAChD,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC;CACF,CAAA;AAbY,kDAAmB;AAUxB;IAPL,IAAA,aAAI,EAAC,SAAS,CAAC;IACf,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IACxC,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,8BAAmB,EAAE,CAAC;IACtC,SAAG,CAAC,WAAW,CAAC;QACf,KAAK,EAAE,4BAAkB;QACzB,eAAe,EAAE,aAAa;KAC/B,CAAC;;IACiB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,8BAAmB;;sDAEjD;8BAZU,mBAAmB;IAF/B,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,iBAAO,EAAC,MAAM,CAAC;qCAE4B,+BAAgB;GAD/C,mBAAmB,CAa/B"}
+8
View File
@@ -0,0 +1,8 @@
import { SessionService } from '../service/session.service';
import { SessionCreateVo } from '../vo/session.vo';
import { SessionLoginDto } from '../dto/session.dto';
export declare class SessionController {
private readonly sessionService;
constructor(sessionService: SessionService);
login(dto: SessionLoginDto): Promise<import("src/app/common/api").ApiResponseVo<null> | import("src/app/common/api").ApiResponseVo<SessionCreateVo | undefined>>;
}
+53
View File
@@ -0,0 +1,53 @@
"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.SessionController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const public_decorator_1 = require("../../common/decorator/public.decorator");
const api_1 = require("../../common/api");
const session_service_1 = require("../service/session.service");
const session_vo_1 = require("../vo/session.vo");
const session_dto_1 = require("../dto/session.dto");
let SessionController = class SessionController {
sessionService;
constructor(sessionService) {
this.sessionService = sessionService;
}
login(dto) {
return this.sessionService.login(dto);
}
};
exports.SessionController = SessionController;
__decorate([
(0, common_1.Post)('login'),
(0, public_decorator_1.AuthPublic)(),
(0, swagger_1.ApiOperation)({ summary: '管理员登录' }),
api_1.Api.ApiResponse({
model: session_vo_1.SessionCreateVo,
codeDescription: '200成功,300已禁用,400失败',
}),
openapi.ApiResponse({ status: 201, type: Object }),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [session_dto_1.SessionLoginDto]),
__metadata("design:returntype", void 0)
], SessionController.prototype, "login", null);
exports.SessionController = SessionController = __decorate([
(0, common_1.Controller)('session'),
(0, swagger_1.ApiTags)('管理员'),
__metadata("design:paramtypes", [session_service_1.SessionService])
], SessionController);
//# sourceMappingURL=session.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"session.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/session.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwD;AAExD,6CAAwD;AACxD,8EAAuE;AACvE,0CAAyC;AACzC,gEAA4D;AAC5D,iDAAmD;AACnD,oDAAqD;AAI9C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACC;IAA7B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAQxD,KAAK,CAAS,GAAoB;QACvC,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAZY,8CAAiB;AASrB;IAPN,IAAA,aAAI,EAAC,OAAO,CAAC;IACb,IAAA,6BAAU,GAAE;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAClC,SAAG,CAAC,WAAW,CAAC;QACf,KAAK,EAAE,4BAAe;QACtB,eAAe,EAAE,oBAAoB;KACtC,CAAC;;IACY,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,6BAAe;;8CAExC;4BAXU,iBAAiB;IAF7B,IAAA,mBAAU,EAAC,SAAS,CAAC;IACrB,IAAA,iBAAO,EAAC,KAAK,CAAC;qCAEgC,gCAAc;GADhD,iBAAiB,CAY7B"}
+31
View File
@@ -0,0 +1,31 @@
import { StatsService } from '../service/stats.service';
export declare class StatsController {
private statsService;
constructor(statsService: StatsService);
stats(): Promise<import("src/app/common/api").ApiResponseVo<{
verifyTotal: number;
registerTotal: number;
verifyApprovedTotal: number;
login30Days: {
date: string;
count: number;
}[];
register30Days: {
date: string;
count: number;
}[];
started30Days: {
date: string;
count: number;
}[];
signInTask: {
count: number;
userSignInTaskId: number;
title: string;
}[];
dailyMeeting30Days: {
date: string;
count: number;
}[];
} | undefined>>;
}
+46
View File
@@ -0,0 +1,46 @@
"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.StatsController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const stats_service_1 = require("../service/stats.service");
const api_1 = require("../../common/api");
const stats_vo_1 = require("../vo/stats.vo");
let StatsController = class StatsController {
statsService;
constructor(statsService) {
this.statsService = statsService;
}
stats() {
return this.statsService.stats();
}
};
exports.StatsController = StatsController;
__decorate([
(0, common_1.Get)('stats'),
(0, swagger_1.ApiOperation)({ summary: '统计信息' }),
api_1.Api.ApiResponse({
model: stats_vo_1.StatsVo,
codeDescription: '200成功,300已禁用,400失败',
}),
openapi.ApiResponse({ status: 200 }),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], StatsController.prototype, "stats", null);
exports.StatsController = StatsController = __decorate([
(0, common_1.Controller)('session'),
(0, swagger_1.ApiTags)('统计'),
__metadata("design:paramtypes", [stats_service_1.StatsService])
], StatsController);
//# sourceMappingURL=stats.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"stats.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/stats.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAiD;AACjD,6CAAwD;AACxD,4DAAwD;AACxD,0CAAyC;AACzC,6CAAyC;AAIlC,IAAM,eAAe,GAArB,MAAM,eAAe;IACN;IAApB,YAAoB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAQlD,KAAK;QACH,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AAZY,0CAAe;AAS1B;IANC,IAAA,YAAG,EAAC,OAAO,CAAC;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACjC,SAAG,CAAC,WAAW,CAAC;QACf,KAAK,EAAE,kBAAO;QACd,eAAe,EAAE,oBAAoB;KACtC,CAAC;;;;;4CAGD;0BAXU,eAAe;IAF3B,IAAA,mBAAU,EAAC,SAAS,CAAC;IACrB,IAAA,iBAAO,EAAC,IAAI,CAAC;qCAEsB,4BAAY;GADnC,eAAe,CAY3B"}
+9
View File
@@ -0,0 +1,9 @@
import { AdminTeamService } from '../service/team.service';
import { AdminTeamQueryDto, AdminTeamAncestorsQueryDto } from '../dto/team.dto';
import { AdminTeamMemberVo, AdminTeamAncestorVo } from '../vo/team.vo';
export declare class TeamController {
private readonly teamService;
constructor(teamService: AdminTeamService);
members(dto: AdminTeamQueryDto): Promise<import("src/app/common/api").ApiResponseVo<import("src/app/common/api").PaginatedVo<AdminTeamMemberVo[]>>>;
ancestors(dto: AdminTeamAncestorsQueryDto): Promise<import("src/app/common/api").ApiResponseVo<import("src/app/common/api").PaginatedVo<AdminTeamAncestorVo[]>>>;
}
+67
View File
@@ -0,0 +1,67 @@
"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.TeamController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const api_1 = require("../../common/api");
const team_service_1 = require("../service/team.service");
const team_dto_1 = require("../dto/team.dto");
const team_vo_1 = require("../vo/team.vo");
let TeamController = class TeamController {
teamService;
constructor(teamService) {
this.teamService = teamService;
}
async members(dto) {
return await this.teamService.queryTeamMembers(dto);
}
async ancestors(dto) {
return await this.teamService.queryAncestors(dto.userId);
}
};
exports.TeamController = TeamController;
__decorate([
(0, common_1.Get)('members'),
(0, swagger_1.ApiOperation)({ summary: '查询团队成员' }),
api_1.Api.ApiPaginatedResponse({
model: team_vo_1.AdminTeamMemberVo,
codeDescription: '200成功,400失败',
}),
openapi.ApiResponse({ status: 200 }),
__param(0, (0, common_1.Query)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [team_dto_1.AdminTeamQueryDto]),
__metadata("design:returntype", Promise)
], TeamController.prototype, "members", null);
__decorate([
(0, common_1.Get)('ancestors'),
(0, swagger_1.ApiOperation)({ summary: '查询用户上级链路' }),
api_1.Api.ApiPaginatedResponse({
model: team_vo_1.AdminTeamAncestorVo,
codeDescription: '200成功,400失败',
}),
openapi.ApiResponse({ status: 200 }),
__param(0, (0, common_1.Query)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [team_dto_1.AdminTeamAncestorsQueryDto]),
__metadata("design:returntype", Promise)
], TeamController.prototype, "ancestors", null);
exports.TeamController = TeamController = __decorate([
(0, common_1.Controller)('team'),
(0, swagger_1.ApiTags)('团队管理'),
__metadata("design:paramtypes", [team_service_1.AdminTeamService])
], TeamController);
//# sourceMappingURL=team.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"team.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/team.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAwD;AACxD,0CAAyC;AACzC,0DAA2D;AAC3D,8CAAgF;AAChF,2CAAuE;AAIhE,IAAM,cAAc,GAApB,MAAM,cAAc;IACI;IAA7B,YAA6B,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;IAAG,CAAC;IAQxD,AAAN,KAAK,CAAC,OAAO,CAAU,GAAsB;QAC3C,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtD,CAAC;IAQK,AAAN,KAAK,CAAC,SAAS,CAAU,GAA+B;QACtD,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF,CAAA;AAtBY,wCAAc;AASnB;IANL,IAAA,YAAG,EAAC,SAAS,CAAC;IACd,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAG,CAAC,oBAAoB,CAAC;QACxB,KAAK,EAAE,2BAAiB;QACxB,eAAe,EAAE,aAAa;KAC/B,CAAC;;IACa,WAAA,IAAA,cAAK,GAAE,CAAA;;qCAAM,4BAAiB;;6CAE5C;AAQK;IANL,IAAA,YAAG,EAAC,WAAW,CAAC;IAChB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACrC,SAAG,CAAC,oBAAoB,CAAC;QACxB,KAAK,EAAE,6BAAmB;QAC1B,eAAe,EAAE,aAAa;KAC/B,CAAC;;IACe,WAAA,IAAA,cAAK,GAAE,CAAA;;qCAAM,qCAA0B;;+CAEvD;yBArBU,cAAc;IAF1B,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,iBAAO,EAAC,MAAM,CAAC;qCAE4B,+BAAgB;GAD/C,cAAc,CAsB1B"}
+3
View File
@@ -0,0 +1,3 @@
import { CommonUploadController } from 'src/app/common/controller/common_upload.controller';
export declare class UploadController extends CommonUploadController {
}
+23
View File
@@ -0,0 +1,23 @@
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UploadController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const common_upload_controller_1 = require("../../common/controller/common_upload.controller");
const public_decorator_1 = require("../../common/decorator/public.decorator");
let UploadController = class UploadController extends common_upload_controller_1.CommonUploadController {
};
exports.UploadController = UploadController;
exports.UploadController = UploadController = __decorate([
(0, common_1.Controller)('upload'),
(0, public_decorator_1.AuthPublic)(),
(0, swagger_1.ApiTags)('上传')
], UploadController);
//# sourceMappingURL=upload.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"upload.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/upload.controller.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAA0C;AAC1C,+FAA4F;AAC5F,8EAAuE;AAIhE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,iDAAsB;CAAG,CAAA;AAAlD,4CAAgB;2BAAhB,gBAAgB;IAH5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,6BAAU,GAAE;IACZ,IAAA,iBAAO,EAAC,IAAI,CAAC;GACD,gBAAgB,CAAkC"}
+10
View File
@@ -0,0 +1,10 @@
import { AdminUserService } from '../service/user.service';
import { AdminUserListDto } from '../dto/user.dto';
import { AdminUserListVo } from '../vo/user.vo';
import { AdminUserFreezeDto } from '../dto/user_freeze.dto';
export declare class AdminUserController {
private readonly adminUserService;
constructor(adminUserService: AdminUserService);
list(dto: AdminUserListDto): Promise<import("src/app/common/api").ApiResponseVo<import("src/app/common/api").PaginatedVo<AdminUserListVo[]>>>;
toggleFreeze(dto: AdminUserFreezeDto): Promise<import("src/app/common/api").ApiResponseVo<null>>;
}
+68
View File
@@ -0,0 +1,68 @@
"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.AdminUserController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const api_1 = require("../../common/api");
const user_service_1 = require("../service/user.service");
const user_dto_1 = require("../dto/user.dto");
const user_vo_1 = require("../vo/user.vo");
const user_freeze_dto_1 = require("../dto/user_freeze.dto");
let AdminUserController = class AdminUserController {
adminUserService;
constructor(adminUserService) {
this.adminUserService = adminUserService;
}
list(dto) {
return this.adminUserService.getUserList(dto);
}
toggleFreeze(dto) {
return this.adminUserService.toggleFreeze(dto.userId, dto.action);
}
};
exports.AdminUserController = AdminUserController;
__decorate([
(0, common_1.Get)('list'),
(0, swagger_1.ApiOperation)({ summary: '用户列表(支持搜索)' }),
api_1.Api.ApiPaginatedResponse({
model: user_vo_1.AdminUserListVo,
codeDescription: '200成功,400失败',
}),
openapi.ApiResponse({ status: 200 }),
__param(0, (0, common_1.Query)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [user_dto_1.AdminUserListDto]),
__metadata("design:returntype", void 0)
], AdminUserController.prototype, "list", null);
__decorate([
(0, common_1.Post)('toggleFreeze'),
(0, swagger_1.ApiOperation)({ summary: '冻结/解冻用户' }),
(0, swagger_1.ApiBody)({ type: user_freeze_dto_1.AdminUserFreezeDto }),
api_1.Api.ApiResponse({
codeDescription: '200成功,400失败',
}),
openapi.ApiResponse({ status: 201 }),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [user_freeze_dto_1.AdminUserFreezeDto]),
__metadata("design:returntype", void 0)
], AdminUserController.prototype, "toggleFreeze", null);
exports.AdminUserController = AdminUserController = __decorate([
(0, common_1.Controller)('user'),
(0, swagger_1.ApiTags)('用户管理'),
__metadata("design:paramtypes", [user_service_1.AdminUserService])
], AdminUserController);
//# sourceMappingURL=user.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,6CAAiE;AACjE,0CAAyC;AACzC,0DAA2D;AAC3D,8CAAmD;AACnD,2CAAgD;AAChD,4DAA4D;AAIrD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACD;IAA7B,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAQ5D,IAAI,CAAU,GAAqB;QACxC,OAAO,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAQM,YAAY,CAAS,GAAuB;QACjD,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;CACF,CAAA;AAtBY,kDAAmB;AASvB;IANN,IAAA,YAAG,EAAC,MAAM,CAAC;IACX,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACvC,SAAG,CAAC,oBAAoB,CAAC;QACxB,KAAK,EAAE,yBAAe;QACtB,eAAe,EAAE,aAAa;KAC/B,CAAC;;IACW,WAAA,IAAA,cAAK,GAAE,CAAA;;qCAAM,2BAAgB;;+CAEzC;AAQM;IANN,IAAA,aAAI,EAAC,cAAc,CAAC;IACpB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IACpC,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,oCAAkB,EAAE,CAAC;IACrC,SAAG,CAAC,WAAW,CAAC;QACf,eAAe,EAAE,aAAa;KAC/B,CAAC;;IACmB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,oCAAkB;;uDAElD;8BArBU,mBAAmB;IAF/B,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,iBAAO,EAAC,MAAM,CAAC;qCAEiC,+BAAgB;GADpD,mBAAmB,CAsB/B"}
+7
View File
@@ -0,0 +1,7 @@
import { AdminWithdrawService } from '../service/withdraw.service';
import { AdminReviewWithdrawDto } from '../dto/withdraw.dto';
export declare class WithdrawController {
private readonly withdrawService;
constructor(withdrawService: AdminWithdrawService);
review(dto: AdminReviewWithdrawDto): Promise<import("src/app/common/api").ApiResponseVo<null>>;
}
+49
View File
@@ -0,0 +1,49 @@
"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.WithdrawController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const api_1 = require("../../common/api");
const withdraw_service_1 = require("../service/withdraw.service");
const withdraw_dto_1 = require("../dto/withdraw.dto");
let WithdrawController = class WithdrawController {
withdrawService;
constructor(withdrawService) {
this.withdrawService = withdrawService;
}
async review(dto) {
return await this.withdrawService.review(dto);
}
};
exports.WithdrawController = WithdrawController;
__decorate([
(0, common_1.Post)('review'),
(0, swagger_1.ApiOperation)({ summary: '提现审核' }),
api_1.Api.ApiResponse({
codeDescription: '200成功,400失败',
}),
openapi.ApiResponse({ status: 201 }),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [withdraw_dto_1.AdminReviewWithdrawDto]),
__metadata("design:returntype", Promise)
], WithdrawController.prototype, "review", null);
exports.WithdrawController = WithdrawController = __decorate([
(0, common_1.Controller)('withdraw'),
(0, swagger_1.ApiTags)('提现管理'),
__metadata("design:paramtypes", [withdraw_service_1.AdminWithdrawService])
], WithdrawController);
//# sourceMappingURL=withdraw.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"withdraw.controller.js","sourceRoot":"","sources":["../../../../src/app/admin/controller/withdraw.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAwD;AACxD,0CAAyC;AACzC,kEAAmE;AACnE,sDAA6D;AAItD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,eAAqC;QAArC,oBAAe,GAAf,eAAe,CAAsB;IAAG,CAAC;IAOhE,AAAN,KAAK,CAAC,MAAM,CAAS,GAA2B;QAC9C,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;CACF,CAAA;AAXY,gDAAkB;AAQvB;IALL,IAAA,aAAI,EAAC,QAAQ,CAAC;IACd,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACjC,SAAG,CAAC,WAAW,CAAC;QACf,eAAe,EAAE,aAAa;KAC/B,CAAC;;IACY,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,qCAAsB;;gDAE/C;6BAVU,kBAAkB;IAF9B,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,iBAAO,EAAC,MAAM,CAAC;qCAEgC,uCAAoB;GADvD,kBAAkB,CAW9B"}
+5
View File
@@ -0,0 +1,5 @@
import { SystemConfigModel } from 'src/model/system_config.model';
declare const UpdateSystemConfigDto_base: import("@nestjs/common").Type<Omit<SystemConfigModel, "id">>;
export declare class UpdateSystemConfigDto extends UpdateSystemConfigDto_base {
}
export {};
+15
View File
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateSystemConfigDto = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const system_config_model_1 = require("../../../model/system_config.model");
class UpdateSystemConfigDto extends (0, swagger_1.OmitType)(system_config_model_1.SystemConfigModel, [
'id',
]) {
static _OPENAPI_METADATA_FACTORY() {
return {};
}
}
exports.UpdateSystemConfigDto = UpdateSystemConfigDto;
//# sourceMappingURL=config.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"config.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/config.dto.ts"],"names":[],"mappings":";;;;AAAA,6CAA2C;AAC3C,4EAAkE;AAElE,MAAa,qBAAsB,SAAQ,IAAA,kBAAQ,EAAC,uCAAiB,EAAE;IACrE,IAAI;CACL,CAAC;;;;CAAG;AAFL,sDAEK"}
+5
View File
@@ -0,0 +1,5 @@
export declare class AdminGiftProductDto {
userId: number;
financialProductId: number;
isTeam: number;
}
+48
View File
@@ -0,0 +1,48 @@
"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.AdminGiftProductDto = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const is_number_or_number_str_1 = require("../../common/decorator/is_number_or_number_str");
class AdminGiftProductDto {
userId;
financialProductId;
isTeam;
static _OPENAPI_METADATA_FACTORY() {
return { userId: { required: true, type: () => Number }, financialProductId: { required: true, type: () => Number }, isTeam: { required: true, type: () => Number } };
}
}
exports.AdminGiftProductDto = AdminGiftProductDto;
__decorate([
(0, swagger_1.ApiProperty)({ description: '用户ID' }),
(0, class_validator_1.IsNotEmpty)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminGiftProductDto.prototype, "userId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '理财产品ID' }),
(0, class_validator_1.IsNotEmpty)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminGiftProductDto.prototype, "financialProductId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '是否赠送团队,0不是,1是' }),
(0, class_validator_1.IsNotEmpty)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminGiftProductDto.prototype, "isTeam", void 0);
//# sourceMappingURL=gift.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"gift.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/gift.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA6C;AAC7C,yDAAyC;AACzC,4FAAuF;AAEvF,MAAa,mBAAmB;IAK9B,MAAM,CAAS;IAMf,kBAAkB,CAAS;IAM3B,MAAM,CAAS;;;;CAChB;AAlBD,kDAkBC;AAbC;IAJC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACpC,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;IACrB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;mDACJ;AAMf;IAJC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IACtC,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;IACrB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;+DACQ;AAM3B;IAJC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;IACrB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;mDACJ"}
+5
View File
@@ -0,0 +1,5 @@
import { AdminModel } from 'src/model/admin.model';
declare const SessionLoginDto_base: import("@nestjs/common").Type<Pick<AdminModel, "password" | "username">>;
export declare class SessionLoginDto extends SessionLoginDto_base {
}
export {};
+16
View File
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionLoginDto = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const admin_model_1 = require("../../../model/admin.model");
class SessionLoginDto extends (0, swagger_1.PickType)(admin_model_1.AdminModel, [
'username',
'password',
]) {
static _OPENAPI_METADATA_FACTORY() {
return {};
}
}
exports.SessionLoginDto = SessionLoginDto;
//# sourceMappingURL=session.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"session.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/session.dto.ts"],"names":[],"mappings":";;;;AAAA,6CAA2C;AAC3C,4DAAmD;AAEnD,MAAa,eAAgB,SAAQ,IAAA,kBAAQ,EAAC,wBAAU,EAAE;IACxD,UAAU;IACV,UAAU;CACX,CAAC;;;;CAAG;AAHL,0CAGK"}
+13
View File
@@ -0,0 +1,13 @@
import { VerifyAuditStatus } from 'src/model/user_verify.model';
import { PaginatedDto } from 'src/app/common/api';
export declare class AdminTeamAncestorsQueryDto {
userId: number;
}
export declare class AdminTeamQueryDto extends PaginatedDto {
userId: number;
type?: number;
memberId?: number;
phone?: string;
isFrozen?: number;
verifyStatus?: VerifyAuditStatus | -1;
}
+91
View File
@@ -0,0 +1,91 @@
"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.AdminTeamQueryDto = exports.AdminTeamAncestorsQueryDto = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const is_number_or_number_str_1 = require("../../common/decorator/is_number_or_number_str");
const api_optional_decorator_1 = require("../../common/decorator/api_optional.decorator");
const user_verify_model_1 = require("../../../model/user_verify.model");
const api_1 = require("../../common/api");
class AdminTeamAncestorsQueryDto {
userId;
static _OPENAPI_METADATA_FACTORY() {
return { userId: { required: true, type: () => Number } };
}
}
exports.AdminTeamAncestorsQueryDto = AdminTeamAncestorsQueryDto;
__decorate([
(0, swagger_1.ApiProperty)({ description: '用户ID' }),
(0, class_validator_1.IsNotEmpty)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminTeamAncestorsQueryDto.prototype, "userId", void 0);
class AdminTeamQueryDto extends api_1.PaginatedDto {
userId;
type;
memberId;
phone;
isFrozen;
verifyStatus;
static _OPENAPI_METADATA_FACTORY() {
return { userId: { required: true, type: () => Number }, type: { required: false, type: () => Number }, memberId: { required: false, type: () => Number }, phone: { required: false, type: () => String }, isFrozen: { required: false, type: () => Number }, verifyStatus: { required: false, type: () => Object } };
}
}
exports.AdminTeamQueryDto = AdminTeamQueryDto;
__decorate([
(0, swagger_1.ApiProperty)({ description: '用户ID' }),
(0, class_validator_1.IsNotEmpty)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminTeamQueryDto.prototype, "userId", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({
description: '审核状态:0=1级,1=2级,2=3级',
enum: user_verify_model_1.VerifyAuditStatus,
}),
(0, class_validator_1.IsInt)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminTeamQueryDto.prototype, "type", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '下级用户ID' }),
(0, class_validator_1.IsOptional)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminTeamQueryDto.prototype, "memberId", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '下级用户手机号' }),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AdminTeamQueryDto.prototype, "phone", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '冻结状态:0=未冻结,1=已冻结' }),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminTeamQueryDto.prototype, "isFrozen", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({
description: '审核状态:1-未提交实名认证,0=待审核,1=审核通过,2=审核驳回',
enum: user_verify_model_1.VerifyAuditStatus,
}),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
__metadata("design:type", Number)
], AdminTeamQueryDto.prototype, "verifyStatus", void 0);
//# sourceMappingURL=team.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"team.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/team.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA0E;AAC1E,yDAAyC;AACzC,4FAAuF;AACvF,0FAA8E;AAC9E,wEAAgE;AAChE,0CAAkD;AAElD,MAAa,0BAA0B;IAKrC,MAAM,CAAS;;;;CAChB;AAND,gEAMC;AADC;IAJC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACpC,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;IACrB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;0DACJ;AAGjB,MAAa,iBAAkB,SAAQ,kBAAY;IAKjD,MAAM,CAAS;IAQf,IAAI,CAAU;IAMd,QAAQ,CAAU;IAKlB,KAAK,CAAU;IAMf,QAAQ,CAAU;IAOlB,YAAY,CAA0B;;;;CACvC;AAtCD,8CAsCC;AAjCC;IAJC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACpC,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;IACrB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;iDACJ;AAQf;IANC,IAAA,oCAAW,EAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,qCAAiB;KACxB,CAAC;IACD,IAAA,uBAAK,GAAE;IACP,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;+CACL;AAMd;IAJC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IACtC,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;IACrB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;mDACD;AAKlB;IAHC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IACvC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACI;AAMf;IAJC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAChD,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;mDACD;AAOlB;IALC,IAAA,oCAAW,EAAC;QACX,WAAW,EAAE,oCAAoC;QACjD,IAAI,EAAE,qCAAiB;KACxB,CAAC;IACD,IAAA,6CAAmB,GAAE;;uDACgB"}
+10
View File
@@ -0,0 +1,10 @@
import { PaginatedDto } from 'src/app/common/api';
import { VerifyAuditStatus } from 'src/model/user_verify.model';
export declare class AdminUserListDto extends PaginatedDto {
id?: number;
phone?: string;
inviteCode?: string;
registerIp?: string;
isFrozen?: number;
verifyStatus: VerifyAuditStatus | -1;
}
+71
View File
@@ -0,0 +1,71 @@
"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.AdminUserListDto = void 0;
const openapi = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
const api_optional_decorator_1 = require("../../common/decorator/api_optional.decorator");
const is_number_or_number_str_1 = require("../../common/decorator/is_number_or_number_str");
const api_1 = require("../../common/api");
const user_verify_model_1 = require("../../../model/user_verify.model");
class AdminUserListDto extends api_1.PaginatedDto {
id;
phone;
inviteCode;
registerIp;
isFrozen;
verifyStatus;
static _OPENAPI_METADATA_FACTORY() {
return { id: { required: false, type: () => Number }, phone: { required: false, type: () => String }, inviteCode: { required: false, type: () => String }, registerIp: { required: false, type: () => String }, isFrozen: { required: false, type: () => Number }, verifyStatus: { required: true, type: () => Object } };
}
}
exports.AdminUserListDto = AdminUserListDto;
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '用户ID' }),
(0, class_validator_1.IsOptional)(),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
__metadata("design:type", Number)
], AdminUserListDto.prototype, "id", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '手机号' }),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AdminUserListDto.prototype, "phone", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '邀请码' }),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AdminUserListDto.prototype, "inviteCode", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '注册IP' }),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AdminUserListDto.prototype, "registerIp", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({ description: '状态:0=正常,1=冻结' }),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
(0, class_transformer_1.Type)(() => Number),
__metadata("design:type", Number)
], AdminUserListDto.prototype, "isFrozen", void 0);
__decorate([
(0, api_optional_decorator_1.ApiOptional)({
description: '审核状态:1-未提交实名认证,0=待审核,1=审核通过,2=审核驳回',
enum: user_verify_model_1.VerifyAuditStatus,
}),
(0, is_number_or_number_str_1.IsNumberOrNumberStr)(),
__metadata("design:type", Number)
], AdminUserListDto.prototype, "verifyStatus", void 0);
//# sourceMappingURL=user.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"user.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA8D;AAC9D,yDAAyC;AACzC,0FAA8E;AAC9E,4FAAuF;AACvF,0CAAkD;AAClD,wEAAgE;AAEhE,MAAa,gBAAiB,SAAQ,kBAAY;IAIhD,EAAE,CAAU;IAKZ,KAAK,CAAU;IAKf,UAAU,CAAU;IAKpB,UAAU,CAAU;IAMpB,QAAQ,CAAU;IAOlB,YAAY,CAAyB;;;;CACtC;AAjCD,4CAiCC;AA7BC;IAHC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACpC,IAAA,4BAAU,GAAE;IACZ,IAAA,6CAAmB,GAAE;;4CACV;AAKZ;IAHC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IACnC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACI;AAKf;IAHC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IACnC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACS;AAKpB;IAHC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACpC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACS;AAMpB;IAJC,IAAA,oCAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;IAC5C,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;kDACD;AAOlB;IALC,IAAA,oCAAW,EAAC;QACX,WAAW,EAAE,oCAAoC;QACjD,IAAI,EAAE,qCAAiB;KACxB,CAAC;IACD,IAAA,6CAAmB,GAAE;;sDACe"}
+8
View File
@@ -0,0 +1,8 @@
export declare enum FreezeAction {
Freeze = 1,
Unfreeze = 0
}
export declare class AdminUserFreezeDto {
userId: number;
action: FreezeAction;
}
+41
View File
@@ -0,0 +1,41 @@
"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.AdminUserFreezeDto = exports.FreezeAction = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
var FreezeAction;
(function (FreezeAction) {
FreezeAction[FreezeAction["Freeze"] = 1] = "Freeze";
FreezeAction[FreezeAction["Unfreeze"] = 0] = "Unfreeze";
})(FreezeAction || (exports.FreezeAction = FreezeAction = {}));
class AdminUserFreezeDto {
userId;
action;
static _OPENAPI_METADATA_FACTORY() {
return { userId: { required: true, type: () => Number }, action: { required: true, enum: require("./user_freeze.dto").FreezeAction } };
}
}
exports.AdminUserFreezeDto = AdminUserFreezeDto;
__decorate([
(0, swagger_1.ApiProperty)({ description: '用户ID' }),
(0, class_validator_1.IsInt)(),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", Number)
], AdminUserFreezeDto.prototype, "userId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '操作:0=解冻,1=冻结', enum: FreezeAction }),
(0, class_validator_1.IsEnum)(FreezeAction),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", Number)
], AdminUserFreezeDto.prototype, "action", void 0);
//# sourceMappingURL=user_freeze.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"user_freeze.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/user_freeze.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA4D;AAE5D,IAAY,YAKX;AALD,WAAY,YAAY;IAEtB,mDAAU,CAAA;IAEV,uDAAY,CAAA;AACd,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,MAAa,kBAAkB;IAI7B,MAAM,CAAS;IAKf,MAAM,CAAe;;;;CACtB;AAVD,gDAUC;AANC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IACpC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;;kDACE;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAChE,IAAA,wBAAM,EAAC,YAAY,CAAC;IACpB,IAAA,4BAAU,GAAE;;kDACQ"}
+10
View File
@@ -0,0 +1,10 @@
export declare enum ReviewAction {
Approve = 1,
Reject = 2
}
export declare class AdminReviewWithdrawDto {
withdrawId: number;
action: ReviewAction;
rejectReason?: string;
remark?: string;
}
+57
View File
@@ -0,0 +1,57 @@
"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.AdminReviewWithdrawDto = exports.ReviewAction = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const is_enum_mumber_string_1 = require("../../common/decorator/is_enum_mumber_string");
const class_validator_1 = require("class-validator");
var ReviewAction;
(function (ReviewAction) {
ReviewAction[ReviewAction["Approve"] = 1] = "Approve";
ReviewAction[ReviewAction["Reject"] = 2] = "Reject";
})(ReviewAction || (exports.ReviewAction = ReviewAction = {}));
class AdminReviewWithdrawDto {
withdrawId;
action;
rejectReason;
remark;
static _OPENAPI_METADATA_FACTORY() {
return { withdrawId: { required: true, type: () => Number }, action: { required: true, enum: require("./withdraw.dto").ReviewAction }, rejectReason: { required: false, type: () => String }, remark: { required: false, type: () => String } };
}
}
exports.AdminReviewWithdrawDto = AdminReviewWithdrawDto;
__decorate([
(0, swagger_1.ApiProperty)({ description: '提现记录ID' }),
(0, class_validator_1.IsInt)(),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", Number)
], AdminReviewWithdrawDto.prototype, "withdrawId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: '审核操作:1=通过,2=驳回',
enum: ReviewAction,
}),
(0, is_enum_mumber_string_1.IsEnumNumberString)(ReviewAction),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", Number)
], AdminReviewWithdrawDto.prototype, "action", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AdminReviewWithdrawDto.prototype, "rejectReason", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], AdminReviewWithdrawDto.prototype, "remark", void 0);
//# sourceMappingURL=withdraw.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"withdraw.dto.js","sourceRoot":"","sources":["../../../../src/app/admin/dto/withdraw.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,wFAAoF;AACpF,qDAA0E;AAG1E,IAAY,YAKX;AALD,WAAY,YAAY;IAEtB,qDAAW,CAAA;IAEX,mDAAU,CAAA;AACZ,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED,MAAa,sBAAsB;IAIjC,UAAU,CAAS;IAQnB,MAAM,CAAe;IAIrB,YAAY,CAAU;IAItB,MAAM,CAAU;;;;CACjB;AArBD,wDAqBC;AAjBC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IACtC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;;0DACM;AAQnB;IANC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,YAAY;KACnB,CAAC;IACD,IAAA,0CAAkB,EAAC,YAAY,CAAC;IAChC,IAAA,4BAAU,GAAE;;sDACQ;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACW;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sDACK"}
+8
View File
@@ -0,0 +1,8 @@
import { NestMiddleware } from '@nestjs/common';
import { NextFunction, Request, Response } from 'express';
import { AuthService } from 'src/app/common/service/auth.service';
export declare class AuthMiddleware implements NestMiddleware {
private authService;
constructor(authService: AuthService);
use(request: Request, res: Response, next: NextFunction): void;
}
+42
View File
@@ -0,0 +1,42 @@
"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.AuthMiddleware = void 0;
const common_1 = require("@nestjs/common");
const app_env_1 = require("../../../app.env");
const user_id_context_1 = require("../../common/context/user_id.context");
const auth_service_1 = require("../../common/service/auth.service");
let AuthMiddleware = class AuthMiddleware {
authService;
constructor(authService) {
this.authService = authService;
}
use(request, res, next) {
this.authService
.verify(request, {
secret: app_env_1.AppEnv.JWT_ADMIN_SECRET,
})
.then((payload) => {
(0, user_id_context_1.iniUserIdContext)(payload.sub, () => {
next();
});
})
.catch(() => {
next();
});
}
};
exports.AuthMiddleware = AuthMiddleware;
exports.AuthMiddleware = AuthMiddleware = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [auth_service_1.AuthService])
], AuthMiddleware);
//# sourceMappingURL=auth.middleware.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"auth.middleware.js","sourceRoot":"","sources":["../../../../src/app/admin/middleware/auth.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4D;AAE5D,8CAAqC;AACrC,0EAA0E;AAC1E,oEAAkE;AAG3D,IAAM,cAAc,GAApB,MAAM,cAAc;IACL;IAApB,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAChD,GAAG,CAAC,OAAgB,EAAE,GAAa,EAAE,IAAkB;QACrD,IAAI,CAAC,WAAW;aACb,MAAM,CAAC,OAAO,EAAE;YACf,MAAM,EAAE,gBAAM,CAAC,gBAAgB;SAChC,CAAC;aACD,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,IAAA,kCAAgB,EAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE;gBACjC,IAAI,EAAE,CAAC;YACT,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAA;AAhBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEsB,0BAAW;GADjC,cAAc,CAgB1B"}
+14
View File
@@ -0,0 +1,14 @@
import { Repository } from 'typeorm';
import { UserModel } from 'src/model/user.model';
import { FinancialProductModel } from 'src/model/financial_product.model';
import { UserFinancialProductModel } from 'src/model/user_financial_product.model';
import { AdminGiftProductDto } from '../dto/gift.dto';
import { TeamRelationModel } from 'src/model/team_relation.model';
export declare class AdminGiftService {
private userModel;
private financialProductModel;
private userFinancialProductModel;
private teamRelationModel;
constructor(userModel: Repository<UserModel>, financialProductModel: Repository<FinancialProductModel>, userFinancialProductModel: Repository<UserFinancialProductModel>, teamRelationModel: Repository<TeamRelationModel>);
giftProduct(dto: AdminGiftProductDto): Promise<import("src/app/common/api").ApiResponseVo<unknown>>;
}
+99
View File
@@ -0,0 +1,99 @@
"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.AdminGiftService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm");
const user_model_1 = require("../../../model/user.model");
const financial_product_model_1 = require("../../../model/financial_product.model");
const user_financial_product_model_1 = require("../../../model/user_financial_product.model");
const api_1 = require("../../common/api");
const team_relation_model_1 = require("../../../model/team_relation.model");
const data_source_context_1 = require("../../common/context/data_source.context");
let AdminGiftService = class AdminGiftService {
userModel;
financialProductModel;
userFinancialProductModel;
teamRelationModel;
constructor(userModel, financialProductModel, userFinancialProductModel, teamRelationModel) {
this.userModel = userModel;
this.financialProductModel = financialProductModel;
this.userFinancialProductModel = userFinancialProductModel;
this.teamRelationModel = teamRelationModel;
}
async giftProduct(dto) {
const user = await this.userModel.findOneBy({ id: dto.userId });
if (!user) {
return api_1.Api.error('用户不存在');
}
const product = await this.financialProductModel.findOneBy({
id: dto.financialProductId,
});
if (!product) {
return api_1.Api.error('理财产品不存在');
}
const userIds = [dto.userId];
if (dto.isTeam == 1) {
const teamRelations = await this.teamRelationModel.find({
select: ['userId'],
where: [
{
parentId: dto.userId,
},
{
grandparentId: dto.userId,
},
{
greatGrandparentId: dto.userId,
},
],
});
userIds.push(...teamRelations.map((it) => it.userId));
}
const now = Math.floor(Date.now() / 1000);
const expireTime = now + product.period * 24 * 60 * 60;
return data_source_context_1.DataSourceContext.startTransaction(async (ctx) => {
const userFinancialProductModel = ctx.getRepository(user_financial_product_model_1.UserFinancialProductModel);
const records = userIds.map((userId) => {
return userFinancialProductModel.create({
userId: userId,
financialProductId: dto.financialProductId,
name: product.name,
period: product.period,
principal: product.principal,
yieldRate: product.yieldRate,
source: user_financial_product_model_1.HoldingSource.Gift,
status: user_financial_product_model_1.HoldingStatus.Earning,
expireTime,
});
});
await this.userFinancialProductModel.save(records);
return api_1.Api.success();
});
}
};
exports.AdminGiftService = AdminGiftService;
exports.AdminGiftService = AdminGiftService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(user_model_1.UserModel)),
__param(1, (0, typeorm_1.InjectRepository)(financial_product_model_1.FinancialProductModel)),
__param(2, (0, typeorm_1.InjectRepository)(user_financial_product_model_1.UserFinancialProductModel)),
__param(3, (0, typeorm_1.InjectRepository)(team_relation_model_1.TeamRelationModel)),
__metadata("design:paramtypes", [typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository])
], AdminGiftService);
//# sourceMappingURL=gift.service.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"gift.service.js","sourceRoot":"","sources":["../../../../src/app/admin/service/gift.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,0DAAiD;AACjD,oFAA0E;AAC1E,8FAIgD;AAChD,0CAAyC;AAEzC,4EAAkE;AAClE,kFAA+E;AAGxE,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGjB;IAEA;IAEA;IAEA;IARV,YAEU,SAAgC,EAEhC,qBAAwD,EAExD,yBAAgE,EAEhE,iBAAgD;QANhD,cAAS,GAAT,SAAS,CAAuB;QAEhC,0BAAqB,GAArB,qBAAqB,CAAmC;QAExD,8BAAyB,GAAzB,yBAAyB,CAAuC;QAEhE,sBAAiB,GAAjB,iBAAiB,CAA+B;IACvD,CAAC;IAMJ,KAAK,CAAC,WAAW,CAAC,GAAwB;QACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC;YACzD,EAAE,EAAE,GAAG,CAAC,kBAAkB;SAC3B,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO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AAS;oBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;oBAC5B,MAAM,EAAE,4CAAa,CAAC,IAAI;oBAC1B,MAAM,EAAE,4CAAa,CAAC,OAAO;oBAC7B,UAAU;iBACX,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEnD,OAAO,SAAG,CAAC,OAAO,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAxEY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sBAAS,CAAC,CAAA;IAE3B,WAAA,IAAA,0BAAgB,EAAC,+CAAqB,CAAC,CAAA;IAEvC,WAAA,IAAA,0BAAgB,EAAC,wDAAyB,CAAC,CAAA;IAE3C,WAAA,IAAA,0BAAgB,EAAC,uCAAiB,CAAC,CAAA;qCALjB,oBAAU;QAEE,oBAAU;QAEN,oBAAU;QAElB,oBAAU;GAT5B,gBAAgB,CAwE5B"}
+11
View File
@@ -0,0 +1,11 @@
import { Repository } from 'typeorm';
import { SessionCreateVo } from '../vo/session.vo';
import { AdminModel } from 'src/model/admin.model';
import { SessionLoginDto } from '../dto/session.dto';
import { AuthService } from 'src/app/common/service/auth.service';
export declare class SessionService {
private adminRepos;
private authService;
constructor(adminRepos: Repository<AdminModel>, authService: AuthService);
login(dto: SessionLoginDto): Promise<import("src/app/common/api").ApiResponseVo<null> | import("src/app/common/api").ApiResponseVo<SessionCreateVo | undefined>>;
}
+51
View File
@@ -0,0 +1,51 @@
"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.SessionService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm");
const api_1 = require("../../common/api");
const session_vo_1 = require("../vo/session.vo");
const admin_model_1 = require("../../../model/admin.model");
const auth_service_1 = require("../../common/service/auth.service");
const app_env_1 = require("../../../app.env");
let SessionService = class SessionService {
adminRepos;
authService;
constructor(adminRepos, authService) {
this.adminRepos = adminRepos;
this.authService = authService;
}
async login(dto) {
const admin = await this.adminRepos.findOneBy(dto);
if (!admin) {
return api_1.Api.error('请检查账号和密码时否正确');
}
const payload = { sub: admin.id };
const token = await this.authService.create(payload, {
secret: app_env_1.AppEnv.JWT_ADMIN_SECRET,
expiresIn: '30d',
});
return api_1.Api.success(new session_vo_1.SessionCreateVo(token));
}
};
exports.SessionService = SessionService;
exports.SessionService = SessionService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(admin_model_1.AdminModel)),
__metadata("design:paramtypes", [typeorm_2.Repository,
auth_service_1.AuthService])
], SessionService);
//# sourceMappingURL=session.service.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"session.service.js","sourceRoot":"","sources":["../../../../src/app/admin/service/session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AAErC,0CAAyC;AACzC,iDAAmD;AACnD,4DAAmD;AAEnD,oEAAkE;AAClE,8CAAqC;AAG9B,IAAM,cAAc,GAApB,MAAM,cAAc;IAGf;IACA;IAHV,YAEU,UAAkC,EAClC,WAAwB;QADxB,eAAU,GAAV,UAAU,CAAwB;QAClC,gBAAW,GAAX,WAAW,CAAa;IAC/B,CAAC;IAEG,KAAK,CAAC,KAAK,CAAC,GAAoB;QACrC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,SAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE;YACnD,MAAM,EAAE,gBAAM,CAAC,gBAAgB;YAC/B,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,OAAO,SAAG,CAAC,OAAO,CAAC,IAAI,4BAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;CACF,CAAA;AArBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,wBAAU,CAAC,CAAA;qCACT,oBAAU;QACT,0BAAW;GAJvB,cAAc,CAqB1B"}
+43
View File
@@ -0,0 +1,43 @@
import { UserModel } from 'src/model/user.model';
import { UserVerifyModel } from 'src/model/user_verify.model';
import { Repository } from 'typeorm';
import { UserLogModel } from 'src/model/user_log.model';
import { UserSignInTaskRewardModel } from 'src/model/user_sign_in_task_reward.model';
import { DailyMeetingStatsModel } from 'src/model/daily_meeting_stats.model';
export declare class StatsService {
private userModel;
private userVerifyModel;
private userLogModel;
private userSignInTaskRewardModel;
private dailyMeetingStatsModel;
constructor(userModel: Repository<UserModel>, userVerifyModel: Repository<UserVerifyModel>, userLogModel: Repository<UserLogModel>, userSignInTaskRewardModel: Repository<UserSignInTaskRewardModel>, dailyMeetingStatsModel: Repository<DailyMeetingStatsModel>);
stats(): Promise<import("src/app/common/api").ApiResponseVo<{
verifyTotal: number;
registerTotal: number;
verifyApprovedTotal: number;
login30Days: {
date: string;
count: number;
}[];
register30Days: {
date: string;
count: number;
}[];
started30Days: {
date: string;
count: number;
}[];
signInTask: {
count: number;
userSignInTaskId: number;
title: string;
}[];
dailyMeeting30Days: {
date: string;
count: number;
}[];
} | undefined>>;
private fundDailyMeetingStats30Days;
private findUserSignInTaskReward;
private findUserLog30Days;
}
+121
View File
@@ -0,0 +1,121 @@
"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.StatsService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const api_1 = require("../../common/api");
const user_model_1 = require("../../../model/user.model");
const user_verify_model_1 = require("../../../model/user_verify.model");
const typeorm_2 = require("typeorm");
const user_log_model_1 = require("../../../model/user_log.model");
const user_sign_in_task_reward_model_1 = require("../../../model/user_sign_in_task_reward.model");
const daily_meeting_stats_model_1 = require("../../../model/daily_meeting_stats.model");
let StatsService = class StatsService {
userModel;
userVerifyModel;
userLogModel;
userSignInTaskRewardModel;
dailyMeetingStatsModel;
constructor(userModel, userVerifyModel, userLogModel, userSignInTaskRewardModel, dailyMeetingStatsModel) {
this.userModel = userModel;
this.userVerifyModel = userVerifyModel;
this.userLogModel = userLogModel;
this.userSignInTaskRewardModel = userSignInTaskRewardModel;
this.dailyMeetingStatsModel = dailyMeetingStatsModel;
}
async stats() {
const registerTotal = await this.userModel.count();
const verifyTotal = await this.userVerifyModel.count();
const verifyApprovedTotal = await this.userVerifyModel.countBy({
status: user_verify_model_1.VerifyAuditStatus.Approved,
});
const login30Days = await this.findUserLog30Days(user_log_model_1.UserLogType.Login);
const register30Days = await this.findUserLog30Days(user_log_model_1.UserLogType.Register);
const started30Days = await this.findUserLog30Days(user_log_model_1.UserLogType.Started);
const dailyMeeting30Days = await this.fundDailyMeetingStats30Days();
const signInTask = await this.findUserSignInTaskReward();
return api_1.Api.success({
verifyTotal,
registerTotal,
verifyApprovedTotal,
login30Days: login30Days,
register30Days,
started30Days,
signInTask,
dailyMeeting30Days,
});
}
async fundDailyMeetingStats30Days() {
const qb = this.dailyMeetingStatsModel
.createQueryBuilder('log')
.select('log.date', 'date')
.addSelect('COUNT(DISTINCT log.device)', 'count')
.groupBy('log.date')
.orderBy('log.date', 'ASC')
.limit(30);
const list = await qb.getRawMany();
return list.map((row) => ({
date: row.date,
count: Number(row.count),
}));
}
async findUserSignInTaskReward() {
const qb = this.userSignInTaskRewardModel
.createQueryBuilder('task')
.select('task.userSignInTaskId', 'userSignInTaskId')
.addSelect('task.title', 'title')
.addSelect('COUNT(*)', 'count')
.groupBy('task.userSignInTaskId')
.addGroupBy('task.title')
.orderBy('task.userSignInTaskId', 'ASC');
const list = await qb.getRawMany();
return list.map((row) => ({
...row,
count: Number(row.count),
}));
}
async findUserLog30Days(type) {
const qb = this.userLogModel
.createQueryBuilder('log')
.select('log.date', 'date')
.addSelect(type === user_log_model_1.UserLogType.Started
? 'COUNT(*)'
: 'COUNT(DISTINCT log.userId)', 'count')
.where('log.type = :type', { type })
.groupBy('log.date')
.orderBy('log.date', 'ASC')
.limit(30);
const list = await qb.getRawMany();
return list.map((row) => ({
date: row.date,
count: Number(row.count),
}));
}
};
exports.StatsService = StatsService;
exports.StatsService = StatsService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(user_model_1.UserModel)),
__param(1, (0, typeorm_1.InjectRepository)(user_verify_model_1.UserVerifyModel)),
__param(2, (0, typeorm_1.InjectRepository)(user_log_model_1.UserLogModel)),
__param(3, (0, typeorm_1.InjectRepository)(user_sign_in_task_reward_model_1.UserSignInTaskRewardModel)),
__param(4, (0, typeorm_1.InjectRepository)(daily_meeting_stats_model_1.DailyMeetingStatsModel)),
__metadata("design:paramtypes", [typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository])
], StatsService);
//# sourceMappingURL=stats.service.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"stats.service.js","sourceRoot":"","sources":["../../../../src/app/admin/service/stats.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,0CAAyC;AACzC,0DAAiD;AACjD,wEAGqC;AACrC,qCAAqC;AACrC,kEAAqE;AACrE,kGAAqF;AACrF,wFAA6E;AAGtE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGb;IAEA;IAEA;IAEA;IAEA;IAVV,YAEU,SAAgC,EAEhC,eAA4C,EAE5C,YAAsC,EAEtC,yBAAgE,EAEhE,sBAA0D;QAR1D,cAAS,GAAT,SAAS,CAAuB;QAEhC,oBAAe,GAAf,eAAe,CAA6B;QAE5C,iBAAY,GAAZ,YAAY,CAA0B;QAEtC,8BAAyB,GAAzB,yBAAyB,CAAuC;QAEhE,2BAAsB,GAAtB,sBAAsB,CAAoC;IACjE,CAAC;IAEJ,KAAK,CAAC,KAAK;QAET,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAEnD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAEvD,MA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AAM,CAAC,GAAG,CAAC,KAAK,CAAC;SACzB,CAAC,CAAC,CAAC;IACN,CAAC;CACF,CAAA;AArGY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sBAAS,CAAC,CAAA;IAE3B,WAAA,IAAA,0BAAgB,EAAC,mCAAe,CAAC,CAAA;IAEjC,WAAA,IAAA,0BAAgB,EAAC,6BAAY,CAAC,CAAA;IAE9B,WAAA,IAAA,0BAAgB,EAAC,0DAAyB,CAAC,CAAA;IAE3C,WAAA,IAAA,0BAAgB,EAAC,kDAAsB,CAAC,CAAA;qCAPtB,oBAAU;QAEJ,oBAAU;QAEb,oBAAU;QAEG,oBAAU;QAEb,oBAAU;GAXjC,YAAY,CAqGxB"}
+16
View File
@@ -0,0 +1,16 @@
import { Repository } from 'typeorm';
import { UserModel } from 'src/model/user.model';
import { WalletModel } from 'src/model/wallet.model';
import { UserVerifyModel } from 'src/model/user_verify.model';
import { AdminTeamQueryDto } from '../dto/team.dto';
import { AdminTeamMemberVo, AdminTeamAncestorVo } from '../vo/team.vo';
import { TeamRelationModel } from 'src/model/team_relation.model';
export declare class AdminTeamService {
private userModel;
private walletModel;
private userVerifyModel;
private teamRelationModel;
constructor(userModel: Repository<UserModel>, walletModel: Repository<WalletModel>, userVerifyModel: Repository<UserVerifyModel>, teamRelationModel: Repository<TeamRelationModel>);
queryTeamMembers(dto: AdminTeamQueryDto): Promise<import("src/app/common/api").ApiResponseVo<import("src/app/common/api").PaginatedVo<AdminTeamMemberVo[]>>>;
queryAncestors(userId: number): Promise<import("src/app/common/api").ApiResponseVo<import("src/app/common/api").PaginatedVo<AdminTeamAncestorVo[]>>>;
}
+158
View File
@@ -0,0 +1,158 @@
"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.AdminTeamService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm");
const user_model_1 = require("../../../model/user.model");
const wallet_model_1 = require("../../../model/wallet.model");
const user_verify_model_1 = require("../../../model/user_verify.model");
const api_1 = require("../../common/api");
const team_vo_1 = require("../vo/team.vo");
const team_relation_model_1 = require("../../../model/team_relation.model");
let AdminTeamService = class AdminTeamService {
userModel;
walletModel;
userVerifyModel;
teamRelationModel;
constructor(userModel, walletModel, userVerifyModel, teamRelationModel) {
this.userModel = userModel;
this.walletModel = walletModel;
this.userVerifyModel = userVerifyModel;
this.teamRelationModel = teamRelationModel;
}
async queryTeamMembers(dto) {
const qb = this.userModel.createQueryBuilder('user');
const userId = dto.userId;
qb.leftJoinAndMapOne('user.wallet', wallet_model_1.WalletModel, 'w', 'w.userId = user.id');
qb.leftJoinAndMapOne('user.userVerify', user_verify_model_1.UserVerifyModel, 'v', 'v.userId = user.id');
if (dto.verifyStatus != undefined) {
if (dto.verifyStatus == -1) {
qb.andWhere('v.id IS NULL ');
}
else {
qb.andWhere('v.status = :status', { status: dto.verifyStatus });
}
}
const targetUserRelation = await this.teamRelationModel.findOneBy({
userId,
});
const targetUserLevel = targetUserRelation?.level ?? 0;
if (dto.type === 0) {
qb.innerJoinAndSelect('team_relation_model', 'tr', 'tr.userId = user.id AND tr.parentId = :userId', { userId });
}
else if (dto.type === 1) {
qb.innerJoinAndSelect('team_relation_model', 'tr', 'tr.userId = user.id AND tr.grandparentId = :userId', { userId });
}
else if (dto.type === 2) {
qb.innerJoinAndSelect('team_relation_model', 'tr', 'tr.userId = user.id AND tr.greatGrandparentId = :userId', { userId });
}
else {
if (!targetUserRelation) {
return api_1.Api.pagination([], 0);
}
qb.innerJoinAndSelect('team_relation_model', 'tr', 'tr.userId = user.id AND tr.path LIKE :pathPrefix', { pathPrefix: `${targetUserRelation.path}/%` });
}
if (dto.memberId) {
qb.andWhere('user.id = :memberId', { memberId: dto.memberId });
}
if (dto.phone) {
qb.andWhere('user.phone = :phone', { phone: dto.phone });
}
if (dto.isFrozen !== undefined) {
qb.andWhere('user.isFrozen = :isFrozen', { isFrozen: dto.isFrozen });
}
const page = dto.page ?? 1;
const size = dto.size ?? 15;
const total = await qb.getCount();
const users = await qb
.orderBy('user.id', 'DESC')
.skip((page - 1) * size)
.take(size)
.getMany();
const userIdsForPage = users.map((r) => r.id);
const relations = userIdsForPage.length > 0
? await this.teamRelationModel.find({
where: { userId: (0, typeorm_2.In)(userIdsForPage) },
})
: [];
const levelMap = new Map();
for (const relation of relations) {
levelMap.set(relation.userId, relation.level);
}
const list = users.map((user) => {
const vo = new team_vo_1.AdminTeamMemberVo();
Object.assign(vo, user);
const memberLevel = levelMap.get(user.id) ?? 0;
vo.level = memberLevel;
vo.relativeLevel = memberLevel - targetUserLevel;
return vo;
});
return api_1.Api.pagination(list, total);
}
async queryAncestors(userId) {
const relation = await this.teamRelationModel.findOneBy({ userId });
if (!relation) {
return api_1.Api.pagination([], 0);
}
const ancestorIds = [
relation.parentId,
relation.grandparentId,
relation.greatGrandparentId,
].filter((id) => id > 0);
if (ancestorIds.length === 0) {
return api_1.Api.pagination([], 0);
}
const users = await this.userModel.find({
where: { id: (0, typeorm_2.In)(ancestorIds) },
relations: {
wallet: true,
},
});
const userMap = new Map();
for (const user of users) {
userMap.set(user.id, user);
}
const ancestorConfig = [
{ id: relation.parentId, level: 1, name: '上级' },
{ id: relation.grandparentId, level: 2, name: '上上级' },
{ id: relation.greatGrandparentId, level: 3, name: '上上上级' },
];
const list = ancestorConfig
.filter((item) => item.id > 0 && userMap.has(item.id))
.map((item) => {
const user = userMap.get(item.id);
const vo = new team_vo_1.AdminTeamAncestorVo();
Object.assign(vo, user);
vo.ancestorLevel = item.level;
vo.ancestorName = item.name;
return vo;
});
return api_1.Api.pagination(list, list.length);
}
};
exports.AdminTeamService = AdminTeamService;
exports.AdminTeamService = AdminTeamService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(user_model_1.UserModel)),
__param(1, (0, typeorm_1.InjectRepository)(wallet_model_1.WalletModel)),
__param(2, (0, typeorm_1.InjectRepository)(user_verify_model_1.UserVerifyModel)),
__param(3, (0, typeorm_1.InjectRepository)(team_relation_model_1.TeamRelationModel)),
__metadata("design:paramtypes", [typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository,
typeorm_2.Repository])
], AdminTeamService);
//# sourceMappingURL=team.service.js.map
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
import { Repository } from 'typeorm';
import { UserModel } from 'src/model/user.model';
import { WalletModel } from 'src/model/wallet.model';
import { AdminUserListDto } from '../dto/user.dto';
import { AdminUserListVo } from '../vo/user.vo';
import { UserFreezeService } from 'src/app/common/service/user_freeze.service';
export declare class AdminUserService {
private userModel;
private walletModel;
private userFreezeService;
constructor(userModel: Repository<UserModel>, walletModel: Repository<WalletModel>, userFreezeService: UserFreezeService);
getUserList(dto: AdminUserListDto): Promise<import("src/app/common/api").ApiResponseVo<import("src/app/common/api").PaginatedVo<AdminUserListVo[]>>>;
toggleFreeze(userId: number, isFrozen: number): Promise<import("src/app/common/api").ApiResponseVo<null>>;
}
+108
View File
@@ -0,0 +1,108 @@
"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.AdminUserService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm");
const user_model_1 = require("../../../model/user.model");
const wallet_model_1 = require("../../../model/wallet.model");
const api_1 = require("../../common/api");
const user_vo_1 = require("../vo/user.vo");
const user_freeze_service_1 = require("../../common/service/user_freeze.service");
const user_verify_model_1 = require("../../../model/user_verify.model");
let AdminUserService = class AdminUserService {
userModel;
walletModel;
userFreezeService;
constructor(userModel, walletModel, userFreezeService) {
this.userModel = userModel;
this.walletModel = walletModel;
this.userFreezeService = userFreezeService;
}
async getUserList(dto) {
const qb = this.userModel.createQueryBuilder('user');
if (dto.id) {
qb.andWhere('user.id = :id', { id: dto.id });
}
if (dto.phone) {
qb.andWhere('user.phone LIKE :phone', { phone: `%${dto.phone}%` });
}
if (dto.inviteCode) {
qb.andWhere('user.inviteCode LIKE :inviteCode', {
inviteCode: `%${dto.inviteCode}%`,
});
}
if (dto.registerIp) {
qb.andWhere('user.registerIp LIKE :registerIp', {
registerIp: `%${dto.registerIp}%`,
});
}
if (dto.isFrozen !== undefined && dto.isFrozen !== null) {
qb.andWhere('user.isFrozen = :isFrozen', { isFrozen: dto.isFrozen });
}
qb.leftJoinAndMapOne('user.userVerify', user_verify_model_1.UserVerifyModel, 'v', 'v.userId = user.id');
if (dto.verifyStatus != undefined) {
if (dto.verifyStatus == -1) {
qb.andWhere('v.id IS NULL ');
}
else {
qb.andWhere('v.status = :status', { status: dto.verifyStatus });
}
}
const page = dto.page ?? 1;
const size = dto.size ?? 15;
const total = await qb.getCount();
const users = await qb
.orderBy('user.createTime', 'DESC')
.skip((page - 1) * size)
.take(size)
.getMany();
const userIds = users.map((u) => u.id);
const wallets = userIds.length > 0
? await this.walletModel
.createQueryBuilder('wallet')
.where('wallet.userId IN (:...ids)', { ids: userIds })
.getMany()
: [];
const walletMap = new Map();
for (const wallet of wallets) {
walletMap.set(wallet.userId, wallet);
}
const list = users.map((user) => {
const vo = new user_vo_1.AdminUserListVo();
Object.assign(vo, user);
vo.wallet = walletMap.get(user.id);
return vo;
});
return api_1.Api.pagination(list, total);
}
async toggleFreeze(userId, isFrozen) {
const err = await this.userFreezeService.toggleFreeze(userId, isFrozen);
if (err) {
return api_1.Api.error(err);
}
return api_1.Api.successMsg(isFrozen ? '冻结成功' : '解冻成功');
}
};
exports.AdminUserService = AdminUserService;
exports.AdminUserService = AdminUserService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(user_model_1.UserModel)),
__param(1, (0, typeorm_1.InjectRepository)(wallet_model_1.WalletModel)),
__metadata("design:paramtypes", [typeorm_2.Repository,
typeorm_2.Repository,
user_freeze_service_1.UserFreezeService])
], AdminUserService);
//# sourceMappingURL=user.service.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../../../src/app/admin/service/user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,0DAAiD;AACjD,8DAAqD;AACrD,0CAAyC;AAEzC,2CAAgD;AAChD,kFAA+E;AAC/E,wEAA8D;AAGvD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGjB;IAEA;IACA;IALV,YAEU,SAAgC,EAEhC,WAAoC,EACpC,iBAAoC;QAHpC,cAAS,GAAT,SAA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;YACjD,MAAM,EAAE,GAAG,IAAI,yBAAe,EAAE,CAAC;YACjC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YACxB,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnC,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,OAAO,SAAG,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAKM,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,QAAgB;QACxD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACxE,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,SAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,SAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;CACF,CAAA;AA9FY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,sBAAS,CAAC,CAAA;IAE3B,WAAA,IAAA,0BAAgB,EAAC,0BAAW,CAAC,CAAA;qCADX,oBAAU;QAER,oBAAU;QACJ,uCAAiB;GANnC,gBAAgB,CA8F5B"}
+10
View File
@@ -0,0 +1,10 @@
import { Repository } from 'typeorm';
import { WithdrawModel } from 'src/model/withdraw.model';
import { WalletModel } from 'src/model/wallet.model';
import { AdminReviewWithdrawDto } from '../dto/withdraw.dto';
export declare class AdminWithdrawService {
private withdrawModel;
private walletModel;
constructor(withdrawModel: Repository<WithdrawModel>, walletModel: Repository<WalletModel>);
review(dto: AdminReviewWithdrawDto): Promise<import("src/app/common/api").ApiResponseVo<null>>;
}
+95
View File
@@ -0,0 +1,95 @@
"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.AdminWithdrawService = void 0;
const common_1 = require("@nestjs/common");
const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm");
const api_1 = require("../../common/api");
const withdraw_model_1 = require("../../../model/withdraw.model");
const wallet_model_1 = require("../../../model/wallet.model");
const wallet_bill_model_1 = require("../../../model/wallet_bill.model");
const balance_log_help_1 = require("../../common/util/balance_log_help");
const data_source_context_1 = require("../../common/context/data_source.context");
const withdraw_dto_1 = require("../dto/withdraw.dto");
let AdminWithdrawService = class AdminWithdrawService {
withdrawModel;
walletModel;
constructor(withdrawModel, walletModel) {
this.withdrawModel = withdrawModel;
this.walletModel = walletModel;
}
async review(dto) {
const withdraw = await this.withdrawModel.findOneBy({
id: dto.withdrawId,
});
if (!withdraw) {
return api_1.Api.error('提现记录不存在');
}
if (withdraw.status !== withdraw_model_1.WithdrawStatus.Pending) {
return api_1.Api.error('该记录已审核,无法重复操作');
}
const wallet = await this.walletModel.findOneBy({
userId: withdraw.userId,
});
if (!wallet) {
return api_1.Api.error('用户钱包不存在');
}
const amount = withdraw.amount;
await data_source_context_1.DataSourceContext.startTransaction(async (tx) => {
const withdrawRepo = tx.getRepository(withdraw_model_1.WithdrawModel);
const walletRepo = tx.getRepository(wallet_model_1.WalletModel);
const billRepo = tx.getRepository(wallet_bill_model_1.WalletBillModel);
if (dto.action === withdraw_dto_1.ReviewAction.Approve) {
await walletRepo.update({ id: wallet.id }, {
frozenBalance: () => `frozenBalance - ${amount}`,
totalWithdraw: () => `totalWithdraw + ${amount}`,
});
await withdrawRepo.update({ id: withdraw.id }, { status: withdraw_model_1.WithdrawStatus.Success, remark: dto.remark ?? '' });
}
else {
const balanceBefore = wallet.balance;
const amountNum = parseFloat(amount);
const balanceAfter = String(parseFloat(balanceBefore) + amountNum);
await walletRepo.update({ id: wallet.id }, {
frozenBalance: () => `frozenBalance - ${amount}`,
balance: () => `balance + ${amount}`,
});
await withdrawRepo.update({ id: withdraw.id }, {
status: withdraw_model_1.WithdrawStatus.Rejected,
rejectReason: dto.rejectReason ?? '',
remark: dto.remark ?? '',
});
await balance_log_help_1.BalanceLogHelp.record(billRepo, {
userId: withdraw.userId,
type: wallet_bill_model_1.WalletBillType.WithdrawReject,
before: balanceBefore,
after: balanceAfter,
amount,
remark: `提现驳回,金额 ${amount},原因:${dto.rejectReason ?? '无'}`,
});
}
});
return api_1.Api.successMsg(dto.action === withdraw_dto_1.ReviewAction.Approve ? '审核通过' : '审核驳回');
}
};
exports.AdminWithdrawService = AdminWithdrawService;
exports.AdminWithdrawService = AdminWithdrawService = __decorate([
(0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(withdraw_model_1.WithdrawModel)),
__param(1, (0, typeorm_1.InjectRepository)(wallet_model_1.WalletModel)),
__metadata("design:paramtypes", [typeorm_2.Repository,
typeorm_2.Repository])
], AdminWithdrawService);
//# sourceMappingURL=withdraw.service.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"withdraw.service.js","sourceRoot":"","sources":["../../../../src/app/admin/service/withdraw.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,0CAAyC;AACzC,kEAAyE;AAC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AAc;oBACnC,MAAM,EAAE,aAAa;oBACrB,KAAK,EAAE,YAAY;oBACnB,MAAM;oBACN,MAAM,EAAE,WAAW,MAAM,OAAO,GAAG,CAAC,YAAY,IAAI,GAAG,EAAE;iBAC1D,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAG,CAAC,UAAU,CACnB,GAAG,CAAC,MAAM,KAAK,2BAAY,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CACtD,CAAC;IACJ,CAAC;CACF,CAAA;AA5FY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,8BAAa,CAAC,CAAA;IAE/B,WAAA,IAAA,0BAAgB,EAAC,0BAAW,CAAC,CAAA;qCADP,oBAAU;QAEZ,oBAAU;GALtB,oBAAoB,CA4FhC"}
+3
View File
@@ -0,0 +1,3 @@
import { UserFinancialProductModel } from 'src/model/user_financial_product.model';
export declare class AdminGiftProductVo extends UserFinancialProductModel {
}
+12
View File
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdminGiftProductVo = void 0;
const openapi = require("@nestjs/swagger");
const user_financial_product_model_1 = require("../../../model/user_financial_product.model");
class AdminGiftProductVo extends user_financial_product_model_1.UserFinancialProductModel {
static _OPENAPI_METADATA_FACTORY() {
return {};
}
}
exports.AdminGiftProductVo = AdminGiftProductVo;
//# sourceMappingURL=gift.vo.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"gift.vo.js","sourceRoot":"","sources":["../../../../src/app/admin/vo/gift.vo.ts"],"names":[],"mappings":";;;;AACA,8FAAmF;AAEnF,MAAa,kBAAmB,SAAQ,wDAAyB;;;;CAAG;AAApE,gDAAoE"}
+4
View File
@@ -0,0 +1,4 @@
export declare class SessionCreateVo {
token: string;
constructor(token: string);
}
+29
View File
@@ -0,0 +1,29 @@
"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.SessionCreateVo = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
class SessionCreateVo {
token;
constructor(token) {
this.token = token;
}
static _OPENAPI_METADATA_FACTORY() {
return { token: { required: true, type: () => String } };
}
}
exports.SessionCreateVo = SessionCreateVo;
__decorate([
(0, swagger_1.ApiProperty)({ description: '身份令牌' }),
__metadata("design:type", String)
], SessionCreateVo.prototype, "token", void 0);
//# sourceMappingURL=session.vo.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"session.vo.js","sourceRoot":"","sources":["../../../../src/app/admin/vo/session.vo.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAE9C,MAAa,eAAe;IAEnB,KAAK,CAAS;IACrB,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;;;;CACF;AAND,0CAMC;AAJQ;IADN,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;;8CAChB"}
+20
View File
@@ -0,0 +1,20 @@
declare class DailyStatsVo {
date: string;
count: number;
}
declare class SignInTaskStatsVo {
userSignInTaskId: number;
title: string;
count: number;
}
export declare class StatsVo {
registerTotal: number;
verifyTotal: number;
verifyApprovedTotal: number;
login30Days: DailyStatsVo[];
register30Days: DailyStatsVo[];
started30Days: DailyStatsVo[];
dailyMeeting30Days: DailyStatsVo[];
signInTask: SignInTaskStatsVo[];
}
export {};
+99
View File
@@ -0,0 +1,99 @@
"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.StatsVo = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
class DailyStatsVo {
date;
count;
static _OPENAPI_METADATA_FACTORY() {
return { date: { required: true, type: () => String }, count: { required: true, type: () => Number } };
}
}
__decorate([
(0, swagger_1.ApiProperty)({ description: '日期' }),
__metadata("design:type", String)
], DailyStatsVo.prototype, "date", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '数量' }),
__metadata("design:type", Number)
], DailyStatsVo.prototype, "count", void 0);
class SignInTaskStatsVo {
userSignInTaskId;
title;
count;
static _OPENAPI_METADATA_FACTORY() {
return { userSignInTaskId: { required: true, type: () => Number }, title: { required: true, type: () => String }, count: { required: true, type: () => Number } };
}
}
__decorate([
(0, swagger_1.ApiProperty)({ description: '签到任务 ID' }),
__metadata("design:type", Number)
], SignInTaskStatsVo.prototype, "userSignInTaskId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '任务标题' }),
__metadata("design:type", String)
], SignInTaskStatsVo.prototype, "title", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '数量' }),
__metadata("design:type", Number)
], SignInTaskStatsVo.prototype, "count", void 0);
class StatsVo {
registerTotal;
verifyTotal;
verifyApprovedTotal;
login30Days;
register30Days;
started30Days;
dailyMeeting30Days;
signInTask;
static _OPENAPI_METADATA_FACTORY() {
return { registerTotal: { required: true, type: () => Number }, verifyTotal: { required: true, type: () => Number }, verifyApprovedTotal: { required: true, type: () => Number }, login30Days: { required: true, type: () => [DailyStatsVo] }, register30Days: { required: true, type: () => [DailyStatsVo] }, started30Days: { required: true, type: () => [DailyStatsVo] }, dailyMeeting30Days: { required: true, type: () => [DailyStatsVo] }, signInTask: { required: true, type: () => [SignInTaskStatsVo] } };
}
}
exports.StatsVo = StatsVo;
__decorate([
(0, swagger_1.ApiProperty)({ description: '注册总人数' }),
__metadata("design:type", Number)
], StatsVo.prototype, "registerTotal", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '实名总人数' }),
__metadata("design:type", Number)
], StatsVo.prototype, "verifyTotal", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '实名通过总人数' }),
__metadata("design:type", Number)
], StatsVo.prototype, "verifyApprovedTotal", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '最近30天每天登录统计', type: [DailyStatsVo] }),
__metadata("design:type", Array)
], StatsVo.prototype, "login30Days", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '最近30天每天注册统计', type: [DailyStatsVo] }),
__metadata("design:type", Array)
], StatsVo.prototype, "register30Days", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '最近30天每天启动APP统计', type: [DailyStatsVo] }),
__metadata("design:type", Array)
], StatsVo.prototype, "started30Days", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: '最近30天参加会议人数统计',
type: [DailyStatsVo],
}),
__metadata("design:type", Array)
], StatsVo.prototype, "dailyMeeting30Days", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: '签到任务统计', type: [SignInTaskStatsVo] }),
__metadata("design:type", Array)
], StatsVo.prototype, "signInTask", void 0);
//# sourceMappingURL=stats.vo.js.map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EAAC,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;;+CACnC;AAG/B;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;;8CACvC;AAM9B;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,CAAC,YAAY,CAAC;KACrB,CAAC;;mDACiC;AAGnC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC;;2CAClC"}
+13
View File
@@ -0,0 +1,13 @@
import { UserModel } from 'src/model/user.model';
declare const AdminTeamUserBaseVo_base: import("@nestjs/common").Type<Omit<UserModel, "password" | "tradePassword" | "teamRelation">>;
declare class AdminTeamUserBaseVo extends AdminTeamUserBaseVo_base {
}
export declare class AdminTeamAncestorVo extends AdminTeamUserBaseVo {
ancestorLevel: number;
ancestorName: string;
}
export declare class AdminTeamMemberVo extends AdminTeamUserBaseVo {
level?: number;
relativeLevel?: number;
}
export {};
+66
View File
@@ -0,0 +1,66 @@
"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.AdminTeamMemberVo = exports.AdminTeamAncestorVo = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const swagger_2 = require("@nestjs/swagger");
const user_model_1 = require("../../../model/user.model");
class AdminTeamUserBaseVo extends (0, swagger_2.OmitType)(user_model_1.UserModel, [
'password',
'tradePassword',
'teamRelation',
]) {
static _OPENAPI_METADATA_FACTORY() {
return {};
}
}
class AdminTeamAncestorVo extends AdminTeamUserBaseVo {
ancestorLevel;
ancestorName;
static _OPENAPI_METADATA_FACTORY() {
return { ancestorLevel: { required: true, type: () => Number }, ancestorName: { required: true, type: () => String } };
}
}
exports.AdminTeamAncestorVo = AdminTeamAncestorVo;
__decorate([
(0, swagger_1.ApiProperty)({
description: '关系类型:1=上级,2=上上级,3=上上上级',
}),
__metadata("design:type", Number)
], AdminTeamAncestorVo.prototype, "ancestorLevel", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: '关系名称',
}),
__metadata("design:type", String)
], AdminTeamAncestorVo.prototype, "ancestorName", void 0);
class AdminTeamMemberVo extends AdminTeamUserBaseVo {
level;
relativeLevel;
static _OPENAPI_METADATA_FACTORY() {
return { level: { required: false, type: () => Number }, relativeLevel: { required: false, type: () => Number } };
}
}
exports.AdminTeamMemberVo = AdminTeamMemberVo;
__decorate([
(0, swagger_1.ApiProperty)({
description: '所属层级:1=下级,2=下下级,3=下下下级',
}),
__metadata("design:type", Number)
], AdminTeamMemberVo.prototype, "level", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: '实际层级(相对查询用户的层级差)',
}),
__metadata("design:type", Number)
], AdminTeamMemberVo.prototype, "relativeLevel", void 0);
//# sourceMappingURL=team.vo.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"team.vo.js","sourceRoot":"","sources":["../../../../src/app/admin/vo/team.vo.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,6CAA2C;AAC3C,0DAAiD;AAEjD,MAAM,mBAAoB,SAAQ,IAAA,kBAAQ,EAAC,sBAAS,EAAE;IACpD,UAAU;IACV,eAAe;IACf,cAAc;CACN,CAAC;;;;CAAG;AAEd,MAAa,mBAAoB,SAAQ,mBAAmB;IAI1D,aAAa,CAAS;IAKtB,YAAY,CAAS;;;;CACtB;AAVD,kDAUC;AANC;IAHC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wBAAwB;KACtC,CAAC;;0DACoB;AAKtB;IAHC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,MAAM;KACpB,CAAC;;yDACmB;AAGvB,MAAa,iBAAkB,SAAQ,mBAAmB;IAIxD,KAAK,CAAU;IAKf,aAAa,CAAU;;;;CACxB;AAVD,8CAUC;AANC;IAHC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wBAAwB;KACtC,CAAC;;gDACa;AAKf;IAHC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kBAAkB;KAChC,CAAC;;wDACqB"}
+12
View File
@@ -0,0 +1,12 @@
import { UserModel } from 'src/model/user.model';
import { WalletModel } from 'src/model/wallet.model';
declare const AdminUserBaseVo_base: import("@nestjs/common").Type<Omit<UserModel, "password" | "tradePassword" | "wallet" | "teamRelation">>;
declare class AdminUserBaseVo extends AdminUserBaseVo_base {
}
declare const AdminWalletVo_base: import("@nestjs/common").Type<Partial<Omit<WalletModel, "user">>>;
declare class AdminWalletVo extends AdminWalletVo_base {
}
export declare class AdminUserListVo extends AdminUserBaseVo {
wallet?: AdminWalletVo;
}
export {};
+48
View File
@@ -0,0 +1,48 @@
"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.AdminUserListVo = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const swagger_2 = require("@nestjs/swagger");
const user_model_1 = require("../../../model/user.model");
const wallet_model_1 = require("../../../model/wallet.model");
class AdminUserBaseVo extends (0, swagger_2.OmitType)(user_model_1.UserModel, [
'password',
'tradePassword',
'wallet',
'teamRelation',
]) {
static _OPENAPI_METADATA_FACTORY() {
return {};
}
}
class AdminWalletVo extends (0, swagger_2.PartialType)((0, swagger_2.OmitType)(wallet_model_1.WalletModel, ['user'])) {
static _OPENAPI_METADATA_FACTORY() {
return {};
}
}
class AdminUserListVo extends AdminUserBaseVo {
wallet;
static _OPENAPI_METADATA_FACTORY() {
return { wallet: { required: false, type: () => AdminWalletVo } };
}
}
exports.AdminUserListVo = AdminUserListVo;
__decorate([
(0, swagger_1.ApiPropertyOptional)({
description: '钱包信息',
type: AdminWalletVo,
nullable: true,
}),
__metadata("design:type", AdminWalletVo)
], AdminUserListVo.prototype, "wallet", void 0);
//# sourceMappingURL=user.vo.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"user.vo.js","sourceRoot":"","sources":["../../../../src/app/admin/vo/user.vo.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAAsD;AACtD,6CAAwD;AACxD,0DAAiD;AACjD,8DAAqD;AAErD,MAAM,eAAgB,SAAQ,IAAA,kBAAQ,EAAC,sBAAS,EAAE;IAChD,UAAU;IACV,eAAe;IACf,QAAQ;IACR,cAAc;CACN,CAAC;;;;CAAG;AAEd,MAAM,aAAc,SAAQ,IAAA,qBAAW,EACrC,IAAA,kBAAQ,EAAC,0BAAW,EAAE,CAAC,MAAM,CAAU,CAAC,CACzC;;;;CAAG;AAEJ,MAAa,eAAgB,SAAQ,eAAe;IAMlD,MAAM,CAAiB;;;;CACxB;AAPD,0CAOC;AADC;IALC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;KACf,CAAC;8BACO,aAAa;+CAAC"}
+4
View File
@@ -0,0 +1,4 @@
import { MiddlewareConsumer, NestModule } from '@nestjs/common';
export declare class ApiModule implements NestModule {
configure(consumer: MiddlewareConsumer): void;
}
+38
View File
@@ -0,0 +1,38 @@
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiModule = void 0;
const core_1 = require("@nestjs/core");
const auth_guard_1 = require("./auth.guard");
const auth_middleware_1 = require("./middleware/auth.middleware");
const app_module_decorator_1 = require("../common/decorator/app_module.decorator");
const path_1 = require("path");
const api_1 = require("../../generated/api");
const context_middleware_1 = require("./middleware/context.middleware");
let ApiModule = class ApiModule {
configure(consumer) {
consumer.apply(auth_middleware_1.AuthMiddleware).exclude('/api/config/system').forRoutes('*');
consumer.apply(context_middleware_1.ContextMiddleware).forRoutes('*');
}
};
exports.ApiModule = ApiModule;
exports.ApiModule = ApiModule = __decorate([
(0, app_module_decorator_1.AppModule)({
controllersDir: (0, path_1.join)(__dirname, './controller'),
serviceDir: (0, path_1.join)(__dirname, './service'),
}, {
controllers: [...api_1.ApiGeneratedControllers],
providers: [
{
provide: core_1.APP_GUARD,
useClass: auth_guard_1.ApiAuthGuard,
},
],
})
], ApiModule);
//# sourceMappingURL=api.module.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"api.module.js","sourceRoot":"","sources":["../../../src/app/api/api.module.ts"],"names":[],"mappings":";;;;;;;;;AACA,uCAAyC;AACzC,6CAA4C;AAC5C,kEAA8D;AAC9D,mFAAqE;AACrE,+BAA4B;AAC5B,6CAA4D;AAC5D,wEAAoE;AAiB7D,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB,SAAS,CAAC,QAA4B;QACpC,QAAQ,CAAC,KAAK,CAAC,gCAAc,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC5E,QAAQ,CAAC,KAAK,CAAC,sCAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AALY,8BAAS;oBAAT,SAAS;IAfrB,IAAA,gCAAS,EACR;QACE,cAAc,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,cAAc,CAAC;QAC/C,UAAU,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,WAAW,CAAC;KACzC,EACD;QACE,WAAW,EAAE,CAAC,GAAG,6BAAuB,CAAC;QACzC,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,yBAAY;aACvB;SACF;KACF,CACF;GACY,SAAS,CAKrB"}
+7
View File
@@ -0,0 +1,7 @@
import { CanActivate, ExecutionContext } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
export declare class ApiAuthGuard implements CanActivate {
private reflector;
constructor(reflector: Reflector);
canActivate(context: ExecutionContext): boolean;
}
+47
View File
@@ -0,0 +1,47 @@
"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.ApiAuthGuard = void 0;
const common_1 = require("@nestjs/common");
const core_1 = require("@nestjs/core");
const public_decorator_1 = require("../common/decorator/public.decorator");
const user_id_context_1 = require("../common/context/user_id.context");
const app_info_context_1 = require("./context/app_info.context");
let ApiAuthGuard = class ApiAuthGuard {
reflector;
constructor(reflector) {
this.reflector = reflector;
}
canActivate(context) {
const req = context.switchToHttp().getRequest();
if (!req.path.startsWith('/api')) {
return true;
}
const info = app_info_context_1.AppInfoContext.getAppInfo();
if (!info.device || !info.system || !info.version) {
throw new common_1.HttpException('非法访问', 401);
}
if ((0, public_decorator_1.isAuthPublic)(this.reflector, context)) {
return true;
}
const userId = (0, user_id_context_1.getUserIdContext)();
if (!userId) {
throw new common_1.UnauthorizedException();
}
return true;
}
};
exports.ApiAuthGuard = ApiAuthGuard;
exports.ApiAuthGuard = ApiAuthGuard = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [core_1.Reflector])
], ApiAuthGuard);
//# sourceMappingURL=auth.guard.js.map

Some files were not shown because too many files have changed in this diff Show More