mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-09 18:23:41 +08:00
v4.1.0
This commit is contained in:
218
AIWebQuickDeploy/dist/modules/app/app.controller.js
vendored
Normal file
218
AIWebQuickDeploy/dist/modules/app/app.controller.js
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
"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.AppController = void 0;
|
||||
const adminAuth_guard_1 = require("../../common/auth/adminAuth.guard");
|
||||
const jwtAuth_guard_1 = require("../../common/auth/jwtAuth.guard");
|
||||
const superAuth_guard_1 = require("../../common/auth/superAuth.guard");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const app_service_1 = require("./app.service");
|
||||
const collectApp_dto_1 = require("./dto/collectApp.dto");
|
||||
const createApp_dto_1 = require("./dto/createApp.dto");
|
||||
const createCats_dto_1 = require("./dto/createCats.dto");
|
||||
const deleteApp_dto_1 = require("./dto/deleteApp.dto");
|
||||
const deleteCats_dto_1 = require("./dto/deleteCats.dto");
|
||||
const queryApp_dto_1 = require("./dto/queryApp.dto");
|
||||
const queryCats_dto_1 = require("./dto/queryCats.dto");
|
||||
const updateApp_dto_1 = require("./dto/updateApp.dto");
|
||||
const updateCats_dto_1 = require("./dto/updateCats.dto");
|
||||
let AppController = class AppController {
|
||||
constructor(appService) {
|
||||
this.appService = appService;
|
||||
}
|
||||
appCatsList(query) {
|
||||
return this.appService.appCatsList(query);
|
||||
}
|
||||
catsList() {
|
||||
const params = { status: 1, page: 1, size: 1000, name: '' };
|
||||
return this.appService.appCatsList(params);
|
||||
}
|
||||
queryOneCats(query) {
|
||||
return this.appService.queryOneCat(query);
|
||||
}
|
||||
createAppCat(body) {
|
||||
return this.appService.createAppCat(body);
|
||||
}
|
||||
updateAppCats(body) {
|
||||
return this.appService.updateAppCats(body);
|
||||
}
|
||||
delAppCat(body) {
|
||||
return this.appService.delAppCat(body);
|
||||
}
|
||||
appList(req, query) {
|
||||
return this.appService.appList(req, query);
|
||||
}
|
||||
list(req, query) {
|
||||
return this.appService.frontAppList(req, query);
|
||||
}
|
||||
async searchList(body) {
|
||||
return this.appService.searchAppList(body);
|
||||
}
|
||||
createApp(body) {
|
||||
return this.appService.createApp(body);
|
||||
}
|
||||
updateApp(body) {
|
||||
return this.appService.updateApp(body);
|
||||
}
|
||||
delApp(body) {
|
||||
return this.appService.delApp(body);
|
||||
}
|
||||
collect(body, req) {
|
||||
return this.appService.collect(body, req);
|
||||
}
|
||||
mineApps(req) {
|
||||
return this.appService.mineApps(req);
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
(0, common_1.Get)('queryAppCats'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '获取App分类列表' }),
|
||||
(0, common_1.UseGuards)(adminAuth_guard_1.AdminAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [queryCats_dto_1.QuerCatsDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "appCatsList", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('queryCats'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '用户端获取App分类列表' }),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "catsList", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('queryOneCat'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '用户端获取App分类列表' }),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "queryOneCats", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('createAppCats'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '添加App分类' }),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [createCats_dto_1.CreateCatsDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "createAppCat", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('updateAppCats'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '修改App分类' }),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [updateCats_dto_1.UpdateCatsDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "updateAppCats", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('delAppCats'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '删除App分类' }),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [deleteCats_dto_1.DeleteCatsDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "delAppCat", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('queryApp'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '获取App列表' }),
|
||||
(0, common_1.UseGuards)(adminAuth_guard_1.AdminAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, queryApp_dto_1.QuerAppDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "appList", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('list'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '客户端获取App' }),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, queryApp_dto_1.QuerAppDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "list", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('searchList'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '客户端获取App' }),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AppController.prototype, "searchList", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('createApp'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '添加App' }),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [createApp_dto_1.CreateAppDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "createApp", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('updateApp'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '修改App' }),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [updateApp_dto_1.UpdateAppDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "updateApp", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('delApp'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '删除App' }),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [deleteApp_dto_1.OperateAppDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "delApp", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('collect'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '收藏/取消收藏App' }),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__param(1, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [collectApp_dto_1.CollectAppDto, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "collect", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('mineApps'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '我的收藏' }),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], AppController.prototype, "mineApps", null);
|
||||
AppController = __decorate([
|
||||
(0, swagger_1.ApiTags)('App'),
|
||||
(0, common_1.Controller)('app'),
|
||||
__metadata("design:paramtypes", [app_service_1.AppService])
|
||||
], AppController);
|
||||
exports.AppController = AppController;
|
||||
84
AIWebQuickDeploy/dist/modules/app/app.entity.js
vendored
Normal file
84
AIWebQuickDeploy/dist/modules/app/app.entity.js
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"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.AppEntity = void 0;
|
||||
const baseEntity_1 = require("../../common/entity/baseEntity");
|
||||
const typeorm_1 = require("typeorm");
|
||||
let AppEntity = class AppEntity extends baseEntity_1.BaseEntity {
|
||||
};
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ unique: true, comment: 'App应用名称' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App分类Id' }),
|
||||
__metadata("design:type", Number)
|
||||
], AppEntity.prototype, "catId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用描述信息' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "des", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用预设场景信息', type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "preset", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用封面图片', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "coverImg", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用排序、数字越大越靠前', default: 100 }),
|
||||
__metadata("design:type", Number)
|
||||
], AppEntity.prototype, "order", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用是否启用中 0:禁用 1:启用', default: 1 }),
|
||||
__metadata("design:type", Number)
|
||||
], AppEntity.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App示例数据', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "demoData", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用角色 system user', default: 'system' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "role", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用是否是GPTs', default: '0' }),
|
||||
__metadata("design:type", Number)
|
||||
], AppEntity.prototype, "isGPTs", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用是否是固定使用模型', default: '0' }),
|
||||
__metadata("design:type", Number)
|
||||
], AppEntity.prototype, "isFixedModel", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用使用的模型', type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "appModel", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'GPTs 的调用ID', default: '' }),
|
||||
__metadata("design:type", String)
|
||||
], AppEntity.prototype, "gizmoID", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App是否共享到应用广场', default: false }),
|
||||
__metadata("design:type", Boolean)
|
||||
], AppEntity.prototype, "public", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '用户Id', nullable: true }),
|
||||
__metadata("design:type", Number)
|
||||
], AppEntity.prototype, "userId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '是否系统预留', default: false, nullable: true }),
|
||||
__metadata("design:type", Boolean)
|
||||
], AppEntity.prototype, "isSystemReserved", void 0);
|
||||
AppEntity = __decorate([
|
||||
(0, typeorm_1.Entity)({ name: 'app' })
|
||||
], AppEntity);
|
||||
exports.AppEntity = AppEntity;
|
||||
26
AIWebQuickDeploy/dist/modules/app/app.module.js
vendored
Normal file
26
AIWebQuickDeploy/dist/modules/app/app.module.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"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 app_controller_1 = require("./app.controller");
|
||||
const app_service_1 = require("./app.service");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const appCats_entity_1 = require("./appCats.entity");
|
||||
const app_entity_1 = require("./app.entity");
|
||||
const userApps_entity_1 = require("./userApps.entity");
|
||||
let AppModule = class AppModule {
|
||||
};
|
||||
AppModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
imports: [typeorm_1.TypeOrmModule.forFeature([appCats_entity_1.AppCatsEntity, app_entity_1.AppEntity, userApps_entity_1.UserAppsEntity])],
|
||||
controllers: [app_controller_1.AppController],
|
||||
providers: [app_service_1.AppService],
|
||||
})
|
||||
], AppModule);
|
||||
exports.AppModule = AppModule;
|
||||
331
AIWebQuickDeploy/dist/modules/app/app.service.js
vendored
Normal file
331
AIWebQuickDeploy/dist/modules/app/app.service.js
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
"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.AppService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const typeorm_2 = require("typeorm");
|
||||
const app_entity_1 = require("./app.entity");
|
||||
const appCats_entity_1 = require("./appCats.entity");
|
||||
const userApps_entity_1 = require("./userApps.entity");
|
||||
let AppService = class AppService {
|
||||
constructor(appCatsEntity, appEntity, userAppsEntity) {
|
||||
this.appCatsEntity = appCatsEntity;
|
||||
this.appEntity = appEntity;
|
||||
this.userAppsEntity = userAppsEntity;
|
||||
}
|
||||
async createAppCat(body) {
|
||||
const { name } = body;
|
||||
const c = await this.appCatsEntity.findOne({ where: { name } });
|
||||
if (c) {
|
||||
throw new common_1.HttpException('该分类名称已存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
return await this.appCatsEntity.save(body);
|
||||
}
|
||||
async delAppCat(body) {
|
||||
const { id } = body;
|
||||
const c = await this.appCatsEntity.findOne({ where: { id } });
|
||||
if (!c) {
|
||||
throw new common_1.HttpException('该分类不存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const count = await this.appEntity.count({ where: { catId: id } });
|
||||
if (count > 0) {
|
||||
throw new common_1.HttpException('该分类下存在App,不可删除!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const res = await this.appCatsEntity.delete(id);
|
||||
if (res.affected > 0)
|
||||
return '删除成功';
|
||||
throw new common_1.HttpException('删除失败!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
async updateAppCats(body) {
|
||||
const { id, name } = body;
|
||||
const c = await this.appCatsEntity.findOne({
|
||||
where: { name, id: (0, typeorm_2.Not)(id) },
|
||||
});
|
||||
if (c) {
|
||||
throw new common_1.HttpException('该分类名称已存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const res = await this.appCatsEntity.update({ id }, body);
|
||||
if (res.affected > 0)
|
||||
return '修改成功';
|
||||
throw new common_1.HttpException('修改失败!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
async queryOneCat(params) {
|
||||
const { id } = params;
|
||||
if (!id) {
|
||||
throw new common_1.HttpException('缺失必要参数!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const app = await this.appEntity.findOne({ where: { id } });
|
||||
const { demoData: demo, coverImg, des, name, isFixedModel, isGPTs, appModel, } = app;
|
||||
return {
|
||||
demoData: demo ? demo.split('\n') : [],
|
||||
coverImg,
|
||||
des,
|
||||
name,
|
||||
isGPTs,
|
||||
isFixedModel,
|
||||
appModel,
|
||||
};
|
||||
}
|
||||
async appCatsList(query) {
|
||||
const { page = 1, size = 10, name, status } = query;
|
||||
const where = {};
|
||||
name && (where.name = (0, typeorm_2.Like)(`%${name}%`));
|
||||
[0, 1, '0', '1'].includes(status) && (where.status = status);
|
||||
const [rows, count] = await this.appCatsEntity.findAndCount({
|
||||
where,
|
||||
order: { order: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
});
|
||||
const catIds = rows.map((item) => item.id);
|
||||
const apps = await this.appEntity.find({ where: { catId: (0, typeorm_2.In)(catIds) } });
|
||||
const appCountMap = {};
|
||||
apps.forEach((item) => {
|
||||
if (appCountMap[item.catId]) {
|
||||
appCountMap[item.catId] += 1;
|
||||
}
|
||||
else {
|
||||
appCountMap[item.catId] = 1;
|
||||
}
|
||||
});
|
||||
rows.forEach((item) => (item.appCount = appCountMap[item.id] || 0));
|
||||
return { rows, count };
|
||||
}
|
||||
async appList(req, query, orderKey = 'id') {
|
||||
var _a;
|
||||
const { page = 1, size = 10, name, status, catId, role } = query;
|
||||
const where = { isSystemReserved: 0 };
|
||||
name && (where.name = (0, typeorm_2.Like)(`%${name}%`));
|
||||
catId && (where.catId = catId);
|
||||
role && (where.role = role);
|
||||
status && (where.status = status);
|
||||
const [rows, count] = await this.appEntity.findAndCount({
|
||||
where,
|
||||
order: { [orderKey]: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
});
|
||||
const catIds = rows.map((item) => item.catId);
|
||||
const cats = await this.appCatsEntity.find({ where: { id: (0, typeorm_2.In)(catIds) } });
|
||||
rows.forEach((item) => {
|
||||
const cat = cats.find((c) => c.id === item.catId);
|
||||
item.catName = cat ? cat.name : '';
|
||||
});
|
||||
if (((_a = req === null || req === void 0 ? void 0 : req.user) === null || _a === void 0 ? void 0 : _a.role) !== 'super') {
|
||||
rows.forEach((item) => {
|
||||
delete item.preset;
|
||||
});
|
||||
}
|
||||
return { rows, count };
|
||||
}
|
||||
async frontAppList(req, query, orderKey = 'id') {
|
||||
var _a;
|
||||
const { page = 1, size = 1000, name, catId, role } = query;
|
||||
const where = [
|
||||
{
|
||||
status: (0, typeorm_2.In)([1, 4]),
|
||||
userId: (0, typeorm_2.IsNull)(),
|
||||
public: false,
|
||||
isSystemReserved: 0,
|
||||
},
|
||||
{ userId: (0, typeorm_2.MoreThan)(0), public: true },
|
||||
];
|
||||
const [rows, count] = await this.appEntity.findAndCount({
|
||||
where,
|
||||
order: { order: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
});
|
||||
const catIds = rows.map((item) => item.catId);
|
||||
const cats = await this.appCatsEntity.find({ where: { id: (0, typeorm_2.In)(catIds) } });
|
||||
rows.forEach((item) => {
|
||||
const cat = cats.find((c) => c.id === item.catId);
|
||||
item.catName = cat ? cat.name : '';
|
||||
});
|
||||
if (((_a = req === null || req === void 0 ? void 0 : req.user) === null || _a === void 0 ? void 0 : _a.role) !== 'super') {
|
||||
rows.forEach((item) => {
|
||||
delete item.preset;
|
||||
});
|
||||
}
|
||||
return { rows, count };
|
||||
}
|
||||
async searchAppList(body) {
|
||||
console.log('搜索App列表', body);
|
||||
const { page = 1, size = 1000, keyword } = body;
|
||||
console.log(`搜索关键词:${keyword}`);
|
||||
let baseWhere = [
|
||||
{
|
||||
status: (0, typeorm_2.In)([1, 4]),
|
||||
userId: (0, typeorm_2.IsNull)(),
|
||||
public: false,
|
||||
isSystemReserved: 0,
|
||||
},
|
||||
{ userId: (0, typeorm_2.MoreThan)(0), public: true },
|
||||
];
|
||||
console.log('初始查询条件:', JSON.stringify(baseWhere));
|
||||
if (keyword) {
|
||||
baseWhere = baseWhere.map((condition) => (Object.assign(Object.assign({}, condition), { name: (0, typeorm_2.Like)(`%${keyword}%`) })));
|
||||
console.log('更新后的查询条件:', JSON.stringify(baseWhere));
|
||||
}
|
||||
try {
|
||||
const [rows, count] = await this.appEntity.findAndCount({
|
||||
where: baseWhere,
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
});
|
||||
console.log(`查询返回 ${count} 条结果,显示第 ${page} 页的结果。`);
|
||||
rows.forEach((item) => {
|
||||
delete item.preset;
|
||||
});
|
||||
console.log('完成查询,准备返回结果');
|
||||
return { rows, count };
|
||||
}
|
||||
catch (error) {
|
||||
console.error('查询数据库时出错:', error);
|
||||
throw new Error('Database query failed');
|
||||
}
|
||||
}
|
||||
async createApp(body) {
|
||||
const { name, catId } = body;
|
||||
body.role = 'system';
|
||||
const a = await this.appEntity.findOne({ where: { name } });
|
||||
if (a) {
|
||||
throw new common_1.HttpException('该应用名称已存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const c = await this.appCatsEntity.findOne({ where: { id: catId } });
|
||||
if (!c) {
|
||||
throw new common_1.HttpException('该分类不存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
return await this.appEntity.save(body);
|
||||
}
|
||||
async updateApp(body) {
|
||||
const { id, name, catId, status } = body;
|
||||
const a = await this.appEntity.findOne({ where: { name, id: (0, typeorm_2.Not)(id) } });
|
||||
if (a) {
|
||||
throw new common_1.HttpException('该应用名称已存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const c = await this.appCatsEntity.findOne({ where: { id: catId } });
|
||||
if (!c) {
|
||||
throw new common_1.HttpException('该分类不存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const curApp = await this.appEntity.findOne({ where: { id } });
|
||||
if (curApp.status !== body.status) {
|
||||
await this.userAppsEntity.update({ appId: id }, { status });
|
||||
}
|
||||
const res = await this.appEntity.update({ id }, body);
|
||||
if (res.affected > 0)
|
||||
return '修改App信息成功';
|
||||
throw new common_1.HttpException('修改App信息失败!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
async delApp(body) {
|
||||
const { id } = body;
|
||||
const a = await this.appEntity.findOne({ where: { id } });
|
||||
if (!a) {
|
||||
throw new common_1.HttpException('该应用不存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const useApp = await this.userAppsEntity.count({ where: { appId: id } });
|
||||
const res = await this.appEntity.delete(id);
|
||||
if (res.affected > 0)
|
||||
return '删除App成功';
|
||||
throw new common_1.HttpException('删除App失败!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
async auditPass(body) {
|
||||
const { id } = body;
|
||||
const a = await this.appEntity.findOne({ where: { id, status: 3 } });
|
||||
if (!a) {
|
||||
throw new common_1.HttpException('该应用不存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
await this.appEntity.update({ id }, { status: 4 });
|
||||
await this.userAppsEntity.update({ appId: id }, { status: 4 });
|
||||
return '应用审核通过';
|
||||
}
|
||||
async auditFail(body) {
|
||||
const { id } = body;
|
||||
const a = await this.appEntity.findOne({ where: { id, status: 3 } });
|
||||
if (!a) {
|
||||
throw new common_1.HttpException('该应用不存在!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
await this.appEntity.update({ id }, { status: 5 });
|
||||
await this.userAppsEntity.update({ appId: id }, { status: 5 });
|
||||
return '应用审核拒绝完成';
|
||||
}
|
||||
async collect(body, req) {
|
||||
const { appId } = body;
|
||||
const { id: userId } = req.user;
|
||||
const historyApp = await this.userAppsEntity.findOne({
|
||||
where: { appId, userId },
|
||||
});
|
||||
if (historyApp) {
|
||||
const r = await this.userAppsEntity.delete({ appId, userId });
|
||||
if (r.affected > 0) {
|
||||
return '取消收藏成功!';
|
||||
}
|
||||
else {
|
||||
throw new common_1.HttpException('取消收藏失败!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
const app = await this.appEntity.findOne({ where: { id: appId } });
|
||||
const { id, role: appRole, catId } = app;
|
||||
const collectInfo = {
|
||||
userId,
|
||||
appId: id,
|
||||
catId,
|
||||
appRole,
|
||||
public: true,
|
||||
status: 1,
|
||||
};
|
||||
await this.userAppsEntity.save(collectInfo);
|
||||
return '已将应用加入到我的收藏!';
|
||||
}
|
||||
async mineApps(req, query = { page: 1, size: 30 }) {
|
||||
const { id } = req.user;
|
||||
const { page = 1, size = 30 } = query;
|
||||
let rows, count;
|
||||
try {
|
||||
[rows, count] = await this.userAppsEntity.findAndCount({
|
||||
where: { userId: id, status: (0, typeorm_2.In)([1, 3, 4, 5]) },
|
||||
order: { id: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
});
|
||||
const appIds = rows.map((item) => item.appId);
|
||||
const appsInfo = await this.appEntity.find({ where: { id: (0, typeorm_2.In)(appIds) } });
|
||||
rows.forEach((item) => {
|
||||
const app = appsInfo.find((c) => c.id === item.appId);
|
||||
item.appName = app ? app.name : '未知';
|
||||
item.appRole = app ? app.role : '未知';
|
||||
item.appDes = app ? app.des : '未知';
|
||||
item.coverImg = app ? app.coverImg : '未知';
|
||||
item.demoData = app ? app.demoData : '未知';
|
||||
item.preset = app.userId === id ? app.preset : '******';
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`处理用户ID: ${id} 的mineApps请求时发生错误`, error);
|
||||
throw error;
|
||||
}
|
||||
return { rows, count };
|
||||
}
|
||||
};
|
||||
AppService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__param(0, (0, typeorm_1.InjectRepository)(appCats_entity_1.AppCatsEntity)),
|
||||
__param(1, (0, typeorm_1.InjectRepository)(app_entity_1.AppEntity)),
|
||||
__param(2, (0, typeorm_1.InjectRepository)(userApps_entity_1.UserAppsEntity)),
|
||||
__metadata("design:paramtypes", [typeorm_2.Repository,
|
||||
typeorm_2.Repository,
|
||||
typeorm_2.Repository])
|
||||
], AppService);
|
||||
exports.AppService = AppService;
|
||||
32
AIWebQuickDeploy/dist/modules/app/appCats.entity.js
vendored
Normal file
32
AIWebQuickDeploy/dist/modules/app/appCats.entity.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"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.AppCatsEntity = void 0;
|
||||
const baseEntity_1 = require("../../common/entity/baseEntity");
|
||||
const typeorm_1 = require("typeorm");
|
||||
let AppCatsEntity = class AppCatsEntity extends baseEntity_1.BaseEntity {
|
||||
};
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ unique: true, comment: 'App分类名称' }),
|
||||
__metadata("design:type", String)
|
||||
], AppCatsEntity.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App分类排序、数字越大越靠前', default: 100 }),
|
||||
__metadata("design:type", Number)
|
||||
], AppCatsEntity.prototype, "order", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App分类是否启用中 0:禁用 1:启用', default: 1 }),
|
||||
__metadata("design:type", Number)
|
||||
], AppCatsEntity.prototype, "status", void 0);
|
||||
AppCatsEntity = __decorate([
|
||||
(0, typeorm_1.Entity)({ name: 'app_cats' })
|
||||
], AppCatsEntity);
|
||||
exports.AppCatsEntity = AppCatsEntity;
|
||||
22
AIWebQuickDeploy/dist/modules/app/dto/collectApp.dto.js
vendored
Normal file
22
AIWebQuickDeploy/dist/modules/app/dto/collectApp.dto.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"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.CollectAppDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const class_validator_1 = require("class-validator");
|
||||
class CollectAppDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '要收藏的appId', required: true }),
|
||||
(0, class_validator_1.IsNumber)({}, { message: 'ID必须是Number' }),
|
||||
__metadata("design:type", Number)
|
||||
], CollectAppDto.prototype, "appId", void 0);
|
||||
exports.CollectAppDto = CollectAppDto;
|
||||
75
AIWebQuickDeploy/dist/modules/app/dto/createApp.dto.js
vendored
Normal file
75
AIWebQuickDeploy/dist/modules/app/dto/createApp.dto.js
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
"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.CreateAppDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class CreateAppDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '前端助手', description: 'app名称', required: true }),
|
||||
(0, class_validator_1.IsDefined)({ message: 'app名称是必传参数' }),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: 'app分类Id', required: true }),
|
||||
(0, class_validator_1.IsDefined)({ message: 'app分类Id必传参数' }),
|
||||
__metadata("design:type", Number)
|
||||
], CreateAppDto.prototype, "catId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
example: '适用于编程编码、期望成为您的编程助手',
|
||||
description: 'app名称详情描述',
|
||||
required: false,
|
||||
}),
|
||||
(0, class_validator_1.IsDefined)({ message: 'app名称描述是必传参数' }),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "des", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '你现在是一个翻译官。接下来我说的所有话帮我翻译成中文', description: '预设的prompt', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "preset", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'GPTs 的调用ID', description: 'GPTs 使用的 ID', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "gizmoID", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ description: '是否GPTs', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], CreateAppDto.prototype, "isGPTs", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'https://xxxx.png', description: '套餐封面图片', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "coverImg", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 100, description: '套餐排序、数字越大越靠前', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], CreateAppDto.prototype, "order", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '套餐状态 0:禁用 1:启用', required: true }),
|
||||
(0, class_validator_1.IsNumber)({}, { message: '套餐状态必须是Number' }),
|
||||
(0, class_validator_1.IsIn)([0, 1, 3, 4, 5], { message: '套餐状态错误' }),
|
||||
__metadata("design:type", Number)
|
||||
], CreateAppDto.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '这是一句示例数据', description: 'app示例数据', required: false }),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "demoData", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'system', description: '创建的角色', required: false }),
|
||||
__metadata("design:type", String)
|
||||
], CreateAppDto.prototype, "role", void 0);
|
||||
exports.CreateAppDto = CreateAppDto;
|
||||
45
AIWebQuickDeploy/dist/modules/app/dto/createCats.dto.js
vendored
Normal file
45
AIWebQuickDeploy/dist/modules/app/dto/createCats.dto.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"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.CreateCatsDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const class_validator_1 = require("class-validator");
|
||||
class CreateCatsDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
example: '编程助手',
|
||||
description: 'app分类名称',
|
||||
required: true,
|
||||
}),
|
||||
(0, class_validator_1.IsDefined)({ message: 'app分类名称是必传参数' }),
|
||||
__metadata("design:type", String)
|
||||
], CreateCatsDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
example: 100,
|
||||
description: '分类排序、数字越大越靠前',
|
||||
required: false,
|
||||
}),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], CreateCatsDto.prototype, "order", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
example: 1,
|
||||
description: '分类状态 0:禁用 1:启用',
|
||||
required: true,
|
||||
}),
|
||||
(0, class_validator_1.IsNumber)({}, { message: '状态必须是Number' }),
|
||||
(0, class_validator_1.IsIn)([0, 1, 3, 4, 5], { message: '套餐状态错误' }),
|
||||
__metadata("design:type", Number)
|
||||
], CreateCatsDto.prototype, "status", void 0);
|
||||
exports.CreateCatsDto = CreateCatsDto;
|
||||
55
AIWebQuickDeploy/dist/modules/app/dto/custonApp.dto.js
vendored
Normal file
55
AIWebQuickDeploy/dist/modules/app/dto/custonApp.dto.js
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"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.CustomAppDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class CustomAppDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '前端助手', description: 'app名称', required: true }),
|
||||
__metadata("design:type", String)
|
||||
], CustomAppDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: 'app分类Id', required: true }),
|
||||
__metadata("design:type", Number)
|
||||
], CustomAppDto.prototype, "catId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({
|
||||
example: '适用于编程编码、期望成为您的编程助手',
|
||||
description: 'app名称详情描述',
|
||||
required: false,
|
||||
}),
|
||||
(0, class_validator_1.IsDefined)({ message: 'app名称描述是必传参数' }),
|
||||
__metadata("design:type", String)
|
||||
], CustomAppDto.prototype, "des", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '你现在是一个翻译官。接下来我说的所有话帮我翻译成中文', description: '预设的prompt', required: true }),
|
||||
__metadata("design:type", String)
|
||||
], CustomAppDto.prototype, "preset", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'https://xxxx.png', description: '套餐封面图片', required: false }),
|
||||
__metadata("design:type", String)
|
||||
], CustomAppDto.prototype, "coverImg", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '这是一句示例数据', description: 'app示例数据', required: false }),
|
||||
__metadata("design:type", String)
|
||||
], CustomAppDto.prototype, "demoData", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: false, description: '是否共享到所有人', required: false }),
|
||||
__metadata("design:type", Boolean)
|
||||
], CustomAppDto.prototype, "public", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '应用ID', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], CustomAppDto.prototype, "appId", void 0);
|
||||
exports.CustomAppDto = CustomAppDto;
|
||||
22
AIWebQuickDeploy/dist/modules/app/dto/deleteApp.dto.js
vendored
Normal file
22
AIWebQuickDeploy/dist/modules/app/dto/deleteApp.dto.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"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.OperateAppDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const class_validator_1 = require("class-validator");
|
||||
class OperateAppDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '要删除的appId', required: true }),
|
||||
(0, class_validator_1.IsNumber)({}, { message: 'ID必须是Number' }),
|
||||
__metadata("design:type", Number)
|
||||
], OperateAppDto.prototype, "id", void 0);
|
||||
exports.OperateAppDto = OperateAppDto;
|
||||
22
AIWebQuickDeploy/dist/modules/app/dto/deleteCats.dto.js
vendored
Normal file
22
AIWebQuickDeploy/dist/modules/app/dto/deleteCats.dto.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"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.DeleteCatsDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const class_validator_1 = require("class-validator");
|
||||
class DeleteCatsDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '要删除app分类Id', required: true }),
|
||||
(0, class_validator_1.IsNumber)({}, { message: 'ID必须是Number' }),
|
||||
__metadata("design:type", Number)
|
||||
], DeleteCatsDto.prototype, "id", void 0);
|
||||
exports.DeleteCatsDto = DeleteCatsDto;
|
||||
52
AIWebQuickDeploy/dist/modules/app/dto/queryApp.dto.js
vendored
Normal file
52
AIWebQuickDeploy/dist/modules/app/dto/queryApp.dto.js
vendored
Normal 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);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.QuerAppDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const class_validator_1 = require("class-validator");
|
||||
class QuerAppDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '查询页数', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAppDto.prototype, "page", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 10, description: '每页数量', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAppDto.prototype, "size", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'name', description: 'app名称', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerAppDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: 'app状态 0:禁用 1:启用 3:审核加入广场中 4:已拒绝加入广场', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAppDto.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 2, description: 'app分类Id', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAppDto.prototype, "catId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'role', description: 'app角色', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerAppDto.prototype, "role", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '关键词', description: '搜索关键词', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerAppDto.prototype, "keyword", void 0);
|
||||
exports.QuerAppDto = QuerAppDto;
|
||||
37
AIWebQuickDeploy/dist/modules/app/dto/queryCats.dto.js
vendored
Normal file
37
AIWebQuickDeploy/dist/modules/app/dto/queryCats.dto.js
vendored
Normal 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;
|
||||
};
|
||||
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.QuerCatsDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class QuerCatsDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '查询页数', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerCatsDto.prototype, "page", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 10, description: '每页数量', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerCatsDto.prototype, "size", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'name', description: '分类名称', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerCatsDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '分类状态 0:禁用 1:启用', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerCatsDto.prototype, "status", void 0);
|
||||
exports.QuerCatsDto = QuerCatsDto;
|
||||
23
AIWebQuickDeploy/dist/modules/app/dto/updateApp.dto.js
vendored
Normal file
23
AIWebQuickDeploy/dist/modules/app/dto/updateApp.dto.js
vendored
Normal 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;
|
||||
};
|
||||
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.UpdateAppDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const createApp_dto_1 = require("./createApp.dto");
|
||||
class UpdateAppDto extends createApp_dto_1.CreateAppDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '要修改的分类Id', required: true }),
|
||||
(0, class_validator_1.IsNumber)({}, { message: '分类ID必须是Number' }),
|
||||
__metadata("design:type", Number)
|
||||
], UpdateAppDto.prototype, "id", void 0);
|
||||
exports.UpdateAppDto = UpdateAppDto;
|
||||
23
AIWebQuickDeploy/dist/modules/app/dto/updateCats.dto.js
vendored
Normal file
23
AIWebQuickDeploy/dist/modules/app/dto/updateCats.dto.js
vendored
Normal 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;
|
||||
};
|
||||
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.UpdateCatsDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const createCats_dto_1 = require("./createCats.dto");
|
||||
class UpdateCatsDto extends createCats_dto_1.CreateCatsDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '要修改的分类Id', required: true }),
|
||||
(0, class_validator_1.IsNumber)({}, { message: '分类ID必须是Number' }),
|
||||
__metadata("design:type", Number)
|
||||
], UpdateCatsDto.prototype, "id", void 0);
|
||||
exports.UpdateCatsDto = UpdateCatsDto;
|
||||
48
AIWebQuickDeploy/dist/modules/app/userApps.entity.js
vendored
Normal file
48
AIWebQuickDeploy/dist/modules/app/userApps.entity.js
vendored
Normal 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.UserAppsEntity = void 0;
|
||||
const typeorm_1 = require("typeorm");
|
||||
const baseEntity_1 = require("../../common/entity/baseEntity");
|
||||
let UserAppsEntity = class UserAppsEntity extends baseEntity_1.BaseEntity {
|
||||
};
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '用户ID' }),
|
||||
__metadata("design:type", Number)
|
||||
], UserAppsEntity.prototype, "userId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '应用ID' }),
|
||||
__metadata("design:type", Number)
|
||||
], UserAppsEntity.prototype, "appId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '应用分类ID' }),
|
||||
__metadata("design:type", Number)
|
||||
], UserAppsEntity.prototype, "catId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'app类型 system/user', default: 'user' }),
|
||||
__metadata("design:type", String)
|
||||
], UserAppsEntity.prototype, "appType", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '是否公开到公告菜单', default: false }),
|
||||
__metadata("design:type", Boolean)
|
||||
], UserAppsEntity.prototype, "public", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'app状态 1正常 2审核 3违规', default: 1 }),
|
||||
__metadata("design:type", Number)
|
||||
], UserAppsEntity.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'App应用排序、数字越大越靠前', default: 100 }),
|
||||
__metadata("design:type", Number)
|
||||
], UserAppsEntity.prototype, "order", void 0);
|
||||
UserAppsEntity = __decorate([
|
||||
(0, typeorm_1.Entity)({ name: 'user_apps' })
|
||||
], UserAppsEntity);
|
||||
exports.UserAppsEntity = UserAppsEntity;
|
||||
Reference in New Issue
Block a user