mirror of
https://github.com/vastxie/99AI.git
synced 2025-12-26 01:36:03 +08:00
v4.1.0
This commit is contained in:
176
AIWebQuickDeploy/dist/modules/chatLog/chatLog.controller.js
vendored
Normal file
176
AIWebQuickDeploy/dist/modules/chatLog/chatLog.controller.js
vendored
Normal file
@@ -0,0 +1,176 @@
|
||||
"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.ChatLogController = 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 chatLog_service_1 = require("./chatLog.service");
|
||||
const chatList_dto_1 = require("./dto/chatList.dto");
|
||||
const del_dto_1 = require("./dto/del.dto");
|
||||
const delByGroup_dto_1 = require("./dto/delByGroup.dto");
|
||||
const exportExcelChatlog_dto_1 = require("./dto/exportExcelChatlog.dto");
|
||||
const queryAllChatLog_dto_1 = require("./dto/queryAllChatLog.dto");
|
||||
const queryAllDrawLog_dto_1 = require("./dto/queryAllDrawLog.dto");
|
||||
const queryByAppId_dto_1 = require("./dto/queryByAppId.dto");
|
||||
const queryMyChatLog_dto_1 = require("./dto/queryMyChatLog.dto");
|
||||
const recDrawImg_dto_1 = require("./dto/recDrawImg.dto");
|
||||
let ChatLogController = class ChatLogController {
|
||||
constructor(chatLogService) {
|
||||
this.chatLogService = chatLogService;
|
||||
}
|
||||
querDrawLog(query, req) {
|
||||
return this.chatLogService.querDrawLog(req, query);
|
||||
}
|
||||
recDrawImg(body) {
|
||||
return this.chatLogService.recDrawImg(body);
|
||||
}
|
||||
querAllDrawLog(params) {
|
||||
return this.chatLogService.querAllDrawLog(params);
|
||||
}
|
||||
queryAllChatLog(params, req) {
|
||||
return this.chatLogService.querAllChatLog(params, req);
|
||||
}
|
||||
exportExcel(body, res) {
|
||||
return this.chatLogService.exportExcel(body, res);
|
||||
}
|
||||
chatList(req, params) {
|
||||
return this.chatLogService.chatList(req, params);
|
||||
}
|
||||
del(req, body) {
|
||||
return this.chatLogService.deleteChatLog(req, body);
|
||||
}
|
||||
delByGroupId(req, body) {
|
||||
return this.chatLogService.delByGroupId(req, body);
|
||||
}
|
||||
deleteChatsAfterId(req, body) {
|
||||
return this.chatLogService.deleteChatsAfterId(req, body);
|
||||
}
|
||||
byAppId(req, params) {
|
||||
return this.chatLogService.byAppId(req, params);
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
(0, common_1.Get)('draw'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '查询我的绘制记录' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__param(1, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [queryMyChatLog_dto_1.QuerMyChatLogDto, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "querDrawLog", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('recDrawImg'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '推荐此图片对外展示' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(superAuth_guard_1.SuperAuthGuard),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [recDrawImg_dto_1.recDrawImgDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "recDrawImg", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('drawAll'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '查询所有的绘制记录' }),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [queryAllDrawLog_dto_1.QuerAllDrawLogDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "querAllDrawLog", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('chatAll'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '查询所有的问答记录' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(adminAuth_guard_1.AdminAuthGuard),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__param(1, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [queryAllChatLog_dto_1.QuerAllChatLogDto, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "queryAllChatLog", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('exportExcel'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '导出问答记录' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__param(1, (0, common_1.Res)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [exportExcelChatlog_dto_1.ExportExcelChatlogDto, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "exportExcel", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('chatList'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '查询我的问答记录' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, chatList_dto_1.ChatListDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "chatList", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('del'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '删除我的问答记录' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, del_dto_1.DelDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "del", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('delByGroupId'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '清空一组对话' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, delByGroup_dto_1.DelByGroupDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "delByGroupId", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('deleteChatsAfterId'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '删除对话组中某条对话及其后的所有对话' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "deleteChatsAfterId", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('byAppId'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '查询某个应用的问答记录' }),
|
||||
(0, swagger_1.ApiBearerAuth)(),
|
||||
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, queryByAppId_dto_1.QueryByAppIdDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ChatLogController.prototype, "byAppId", null);
|
||||
ChatLogController = __decorate([
|
||||
(0, common_1.Controller)('chatLog'),
|
||||
(0, swagger_1.ApiTags)('ChatLog'),
|
||||
__metadata("design:paramtypes", [chatLog_service_1.ChatLogService])
|
||||
], ChatLogController);
|
||||
exports.ChatLogController = ChatLogController;
|
||||
144
AIWebQuickDeploy/dist/modules/chatLog/chatLog.entity.js
vendored
Normal file
144
AIWebQuickDeploy/dist/modules/chatLog/chatLog.entity.js
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
"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.ChatLogEntity = void 0;
|
||||
const baseEntity_1 = require("../../common/entity/baseEntity");
|
||||
const typeorm_1 = require("typeorm");
|
||||
let ChatLogEntity = class ChatLogEntity extends baseEntity_1.BaseEntity {
|
||||
};
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '用户ID' }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "userId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '使用的模型', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "model", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({
|
||||
comment: '使用类型1: 普通对话 2: 绘图 3: 拓展性对话',
|
||||
nullable: true,
|
||||
default: 1,
|
||||
}),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "type", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '自定义的模型名称', nullable: true, default: 'AI' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "modelName", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '自定义的模型名称', nullable: false, default: '' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "modelAvatar", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'Ip地址', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "curIp", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '询问的问题', type: 'text', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "prompt", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '附加参数', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "extraParam", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '插件参数', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "pluginParam", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '回答的答案', type: 'text', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "answer", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '提问的token', nullable: true }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "promptTokens", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '回答的token', nullable: true }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "completionTokens", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '总花费的token', nullable: true }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "totalTokens", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: 'role system user assistant', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "role", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '任务进度', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "progress", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '任务状态', nullable: true, default: 3 }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "status", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '任务类型', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "action", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '对图片操作的按钮ID', type: 'text', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "customId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '绘画的ID每条不一样', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "drawId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '文件信息', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "fileInfo", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '对话转语音的链接', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "ttsUrl", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '是否推荐0: 默认 1: 推荐', nullable: true, default: 0 }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "rec", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '分组ID', nullable: true }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "groupId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '使用的应用id', nullable: true }),
|
||||
__metadata("design:type", Number)
|
||||
], ChatLogEntity.prototype, "appId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '是否删除', default: false }),
|
||||
__metadata("design:type", Boolean)
|
||||
], ChatLogEntity.prototype, "isDelete", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '任务ID', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "taskId", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '任务数据', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "taskData", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '视频Url', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "videoUrl", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '音频Url', nullable: true, type: 'text' }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "audioUrl", void 0);
|
||||
__decorate([
|
||||
(0, typeorm_1.Column)({ comment: '提问参考', nullable: true }),
|
||||
__metadata("design:type", String)
|
||||
], ChatLogEntity.prototype, "promptReference", void 0);
|
||||
ChatLogEntity = __decorate([
|
||||
(0, typeorm_1.Entity)({ name: 'chatlog' })
|
||||
], ChatLogEntity);
|
||||
exports.ChatLogEntity = ChatLogEntity;
|
||||
30
AIWebQuickDeploy/dist/modules/chatLog/chatLog.module.js
vendored
Normal file
30
AIWebQuickDeploy/dist/modules/chatLog/chatLog.module.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"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.ChatLogModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const chatGroup_entity_1 = require("../chatGroup/chatGroup.entity");
|
||||
const user_entity_1 = require("../user/user.entity");
|
||||
const chatLog_controller_1 = require("./chatLog.controller");
|
||||
const chatLog_entity_1 = require("./chatLog.entity");
|
||||
const chatLog_service_1 = require("./chatLog.service");
|
||||
let ChatLogModule = class ChatLogModule {
|
||||
};
|
||||
ChatLogModule = __decorate([
|
||||
(0, common_1.Global)(),
|
||||
(0, common_1.Module)({
|
||||
imports: [
|
||||
typeorm_1.TypeOrmModule.forFeature([chatLog_entity_1.ChatLogEntity, user_entity_1.UserEntity, chatGroup_entity_1.ChatGroupEntity]),
|
||||
],
|
||||
controllers: [chatLog_controller_1.ChatLogController],
|
||||
providers: [chatLog_service_1.ChatLogService],
|
||||
exports: [chatLog_service_1.ChatLogService],
|
||||
})
|
||||
], ChatLogModule);
|
||||
exports.ChatLogModule = ChatLogModule;
|
||||
390
AIWebQuickDeploy/dist/modules/chatLog/chatLog.service.js
vendored
Normal file
390
AIWebQuickDeploy/dist/modules/chatLog/chatLog.service.js
vendored
Normal file
@@ -0,0 +1,390 @@
|
||||
"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.ChatLogService = void 0;
|
||||
const balance_constant_1 = require("../../common/constants/balance.constant");
|
||||
const utils_1 = require("../../common/utils");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const typeorm_1 = require("@nestjs/typeorm");
|
||||
const exceljs_1 = require("exceljs");
|
||||
const typeorm_2 = require("typeorm");
|
||||
const chatGroup_entity_1 = require("../chatGroup/chatGroup.entity");
|
||||
const user_entity_1 = require("../user/user.entity");
|
||||
const chatLog_entity_1 = require("./chatLog.entity");
|
||||
const models_service_1 = require("../models/models.service");
|
||||
let ChatLogService = class ChatLogService {
|
||||
constructor(chatLogEntity, userEntity, chatGroupEntity, modelsService) {
|
||||
this.chatLogEntity = chatLogEntity;
|
||||
this.userEntity = userEntity;
|
||||
this.chatGroupEntity = chatGroupEntity;
|
||||
this.modelsService = modelsService;
|
||||
}
|
||||
async saveChatLog(logInfo) {
|
||||
const savedLog = await this.chatLogEntity.save(logInfo);
|
||||
return savedLog;
|
||||
}
|
||||
async updateChatLog(id, logInfo) {
|
||||
return await this.chatLogEntity.update({ id }, logInfo);
|
||||
}
|
||||
async findOneChatLog(id) {
|
||||
return await this.chatLogEntity.findOne({ where: { id } });
|
||||
}
|
||||
async querDrawLog(req, query) {
|
||||
const { id } = req.user;
|
||||
const { model } = query;
|
||||
const where = { userId: id, type: balance_constant_1.ChatType.PAINT };
|
||||
if (model) {
|
||||
where.model = model;
|
||||
if (model === 'DALL-E2') {
|
||||
where.model = (0, typeorm_2.In)(['DALL-E2', 'dall-e-3']);
|
||||
}
|
||||
}
|
||||
const data = await this.chatLogEntity.find({
|
||||
where,
|
||||
order: { id: 'DESC' },
|
||||
select: ['id', 'answer', 'prompt', 'model', 'type', 'fileInfo'],
|
||||
});
|
||||
data.forEach((r) => {
|
||||
if (r.type === 'paintCount') {
|
||||
const w = r.model === 'mj' ? 310 : 160;
|
||||
const imgType = r.answer.includes('cos') ? 'tencent' : 'ali';
|
||||
const compress = imgType === 'tencent'
|
||||
? `?imageView2/1/w/${w}/q/55`
|
||||
: `?x-oss-process=image/resize,w_${w}`;
|
||||
r.thumbImg = r.answer + compress;
|
||||
try {
|
||||
r.fileInfo = r.fileInfo ? JSON.parse(r.fileInfo) : null;
|
||||
}
|
||||
catch (error) {
|
||||
r.fileInfo = {};
|
||||
}
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
async querAllDrawLog(params) {
|
||||
const { page = 1, size = 20, rec, userId, model } = params;
|
||||
const where = {
|
||||
type: 2,
|
||||
prompt: (0, typeorm_2.Not)(''),
|
||||
answer: (0, typeorm_2.Not)(''),
|
||||
fileInfo: (0, typeorm_2.Not)(''),
|
||||
};
|
||||
rec && Object.assign(where, { rec });
|
||||
userId && Object.assign(where, { userId });
|
||||
if (model) {
|
||||
where.model = model;
|
||||
}
|
||||
else {
|
||||
where.model = (0, typeorm_2.In)(['midjourney', 'dall-e-3', 'stable-diffusion']);
|
||||
}
|
||||
const [rows, count] = await this.chatLogEntity.findAndCount({
|
||||
order: { id: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
where,
|
||||
});
|
||||
const userIds = rows
|
||||
.map((item) => item.userId)
|
||||
.filter((id) => id < 100000);
|
||||
const userInfos = await this.userEntity.find({
|
||||
where: { id: (0, typeorm_2.In)(userIds) },
|
||||
select: ['id', 'username', 'avatar', 'email'],
|
||||
});
|
||||
rows.forEach((item) => {
|
||||
item.userInfo = userInfos.find((user) => user.id === item.userId);
|
||||
});
|
||||
rows.forEach((r) => {
|
||||
var _a;
|
||||
const w = r.model === 'midjourney' ? 310 : 160;
|
||||
const imgType = r.answer.includes('cos') ? 'tencent' : 'ali';
|
||||
const compress = imgType === 'tencent'
|
||||
? `?imageView2/1/w/${w}/q/55`
|
||||
: `?x-oss-process=image/resize,w_${w}`;
|
||||
r.thumbImg = r.answer + compress;
|
||||
try {
|
||||
const detailInfo = r.extend ? JSON.parse(r.extend) : null;
|
||||
if (detailInfo) {
|
||||
if (detailInfo) {
|
||||
r.isGroup = ((_a = detailInfo === null || detailInfo === void 0 ? void 0 : detailInfo.components[0]) === null || _a === void 0 ? void 0 : _a.components.length) === 5;
|
||||
}
|
||||
else {
|
||||
r.isGroup = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
console.log('querAllDrawLog Json parse error', error);
|
||||
}
|
||||
});
|
||||
return { rows, count };
|
||||
}
|
||||
async findOneDrawLog(params) {
|
||||
const { id } = params;
|
||||
const record = await this.chatLogEntity.findOne({ where: { id } });
|
||||
return record;
|
||||
}
|
||||
async recDrawImg(body) {
|
||||
const { id } = body;
|
||||
const l = await this.chatLogEntity.findOne({
|
||||
where: { id, type: balance_constant_1.ChatType.PAINT },
|
||||
});
|
||||
if (!l) {
|
||||
throw new common_1.HttpException('你推荐的图片不存在、请检查!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const rec = l.rec === 1 ? 0 : 1;
|
||||
const res = await this.chatLogEntity.update({ id }, { rec });
|
||||
if (res.affected > 0) {
|
||||
return `${rec ? '推荐' : '取消推荐'}图片成功!`;
|
||||
}
|
||||
throw new common_1.HttpException('你操作的图片不存在、请检查!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
async exportExcel(body, res) {
|
||||
const where = { type: balance_constant_1.ChatType.NORMAL_CHAT };
|
||||
const { page = 1, size = 30, prompt, email } = body;
|
||||
prompt && Object.assign(where, { prompt: (0, typeorm_2.Like)(`%${prompt}%`) });
|
||||
if (email) {
|
||||
const user = await this.userEntity.findOne({ where: { email } });
|
||||
(user === null || user === void 0 ? void 0 : user.id) && Object.assign(where, { userId: user.id });
|
||||
}
|
||||
const [rows, count] = await this.chatLogEntity.findAndCount({
|
||||
order: { id: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
where,
|
||||
});
|
||||
const userIds = rows.map((r) => r.userId);
|
||||
const userInfos = await this.userEntity.find({
|
||||
where: { id: (0, typeorm_2.In)(userIds) },
|
||||
});
|
||||
const data = rows.map((r) => {
|
||||
const userInfo = userInfos.find((u) => u.id === r.userId);
|
||||
return {
|
||||
username: userInfo ? userInfo.username : '',
|
||||
email: userInfo ? userInfo.email : '',
|
||||
prompt: r.prompt,
|
||||
answer: r.answer,
|
||||
createdAt: (0, utils_1.formatDate)(r.createdAt),
|
||||
};
|
||||
});
|
||||
const workbook = new exceljs_1.default.Workbook();
|
||||
const worksheet = workbook.addWorksheet('chatlog');
|
||||
worksheet.columns = [
|
||||
{ header: '用户名', key: 'username', width: 20 },
|
||||
{ header: '用户邮箱', key: 'email', width: 20 },
|
||||
{ header: '提问时间', key: 'createdAt', width: 20 },
|
||||
{ header: '提问问题', key: 'prompt', width: 80 },
|
||||
{ header: '回答答案', key: 'answer', width: 150 },
|
||||
];
|
||||
data.forEach((row) => worksheet.addRow(row));
|
||||
res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
res.setHeader('Content-Disposition', 'attachment; filename=' + 'chat.xlsx');
|
||||
await workbook.xlsx.write(res);
|
||||
res.end();
|
||||
}
|
||||
async querAllChatLog(params, req) {
|
||||
const { page = 1, size = 20, userId, prompt } = params;
|
||||
const where = { type: balance_constant_1.ChatType.NORMAL_CHAT, prompt: (0, typeorm_2.Not)('') };
|
||||
userId && Object.assign(where, { userId });
|
||||
prompt && Object.assign(where, { prompt: (0, typeorm_2.Like)(`%${prompt}%`) });
|
||||
const [rows, count] = await this.chatLogEntity.findAndCount({
|
||||
order: { id: 'DESC' },
|
||||
skip: (page - 1) * size,
|
||||
take: size,
|
||||
where,
|
||||
});
|
||||
const userIds = rows.map((item) => item.userId);
|
||||
const userInfo = await this.userEntity.find({
|
||||
where: { id: (0, typeorm_2.In)(userIds) },
|
||||
select: ['id', 'username', 'email'],
|
||||
});
|
||||
rows.forEach((item) => {
|
||||
const { username, email } = userInfo.find((u) => u.id === item.userId) || {};
|
||||
item.username = username;
|
||||
item.email = email;
|
||||
});
|
||||
req.user.role !== 'super' &&
|
||||
rows.forEach((t) => (t.email = (0, utils_1.maskEmail)(t.email)));
|
||||
rows.forEach((item) => {
|
||||
!item.email && (item.email = `${item === null || item === void 0 ? void 0 : item.userId}@aiweb.com`);
|
||||
!item.username && (item.username = `游客${item === null || item === void 0 ? void 0 : item.userId}`);
|
||||
});
|
||||
return { rows, count };
|
||||
}
|
||||
async chatList(req, params) {
|
||||
const { id } = req.user;
|
||||
const { groupId } = params;
|
||||
const where = { userId: id, isDelete: false };
|
||||
groupId && Object.assign(where, { groupId });
|
||||
if (groupId) {
|
||||
const count = await this.chatGroupEntity.count({
|
||||
where: { isDelete: false },
|
||||
});
|
||||
if (count === 0)
|
||||
return [];
|
||||
}
|
||||
const list = await this.chatLogEntity.find({ where });
|
||||
return list.map((item) => {
|
||||
const { prompt, role, answer, createdAt, model, modelName, type, status, action, drawId, id, fileInfo, ttsUrl, videoUrl, audioUrl, customId, pluginParam, modelAvatar, taskData, promptReference, } = item;
|
||||
return {
|
||||
chatId: id,
|
||||
dateTime: (0, utils_1.formatDate)(createdAt),
|
||||
text: role === 'user' ? prompt : answer,
|
||||
modelType: type,
|
||||
status: status,
|
||||
action: action,
|
||||
drawId: drawId,
|
||||
customId: customId,
|
||||
inversion: role === 'user',
|
||||
error: false,
|
||||
fileInfo: fileInfo,
|
||||
ttsUrl: ttsUrl,
|
||||
videoUrl: videoUrl,
|
||||
audioUrl: audioUrl,
|
||||
model: model,
|
||||
modelName: modelName,
|
||||
pluginParam: pluginParam,
|
||||
modelAvatar: modelAvatar,
|
||||
taskData: taskData,
|
||||
promptReference: promptReference,
|
||||
};
|
||||
});
|
||||
}
|
||||
async chatHistory(groupId, rounds) {
|
||||
if (rounds === 0) {
|
||||
return [];
|
||||
}
|
||||
const where = { isDelete: false, groupId: groupId };
|
||||
const list = await this.chatLogEntity.find({
|
||||
where,
|
||||
order: {
|
||||
createdAt: 'DESC',
|
||||
},
|
||||
take: rounds * 2,
|
||||
});
|
||||
const result = list
|
||||
.map((item) => {
|
||||
const { role, prompt, answer, fileInfo } = item;
|
||||
const record = {
|
||||
role: role,
|
||||
text: role === 'user' ? prompt : answer,
|
||||
fileInfo: fileInfo,
|
||||
};
|
||||
return record;
|
||||
})
|
||||
.reverse();
|
||||
return result;
|
||||
}
|
||||
async deleteChatLog(req, body) {
|
||||
const { id: userId } = req.user;
|
||||
const { id } = body;
|
||||
const c = await this.chatLogEntity.findOne({ where: { id, userId } });
|
||||
if (!c) {
|
||||
throw new common_1.HttpException('你删除的对话记录不存在、请检查!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const r = await this.chatLogEntity.update({ id }, { isDelete: true });
|
||||
if (r.affected > 0) {
|
||||
return '删除对话记录成功!';
|
||||
}
|
||||
else {
|
||||
throw new common_1.HttpException('你删除的对话记录不存在、请检查!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
async delByGroupId(req, body) {
|
||||
const { groupId } = body;
|
||||
const { id } = req.user;
|
||||
const g = await this.chatGroupEntity.findOne({
|
||||
where: { id: groupId, userId: id },
|
||||
});
|
||||
if (!g) {
|
||||
throw new common_1.HttpException('你删除的对话记录不存在、请检查!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const r = await this.chatLogEntity.update({ groupId }, { isDelete: true });
|
||||
if (r.affected > 0) {
|
||||
return '删除对话记录成功!';
|
||||
}
|
||||
if (r.affected === 0) {
|
||||
throw new common_1.HttpException('当前页面已经没有东西可以删除了!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
async deleteChatsAfterId(req, body) {
|
||||
const { id } = body;
|
||||
const { id: userId } = req.user;
|
||||
const chatLog = await this.chatLogEntity.findOne({ where: { id, userId } });
|
||||
if (!chatLog) {
|
||||
throw new common_1.HttpException('你删除的对话记录不存在、请检查!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const { groupId } = chatLog;
|
||||
const result = await this.chatLogEntity.update({ groupId, id: (0, typeorm_2.MoreThanOrEqual)(id) }, { isDelete: true });
|
||||
if (result.affected > 0) {
|
||||
return '删除对话记录成功!';
|
||||
}
|
||||
else {
|
||||
throw new common_1.HttpException('当前页面已经没有东西可以删除了!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
async byAppId(req, body) {
|
||||
const { id } = req.user;
|
||||
const { appId, page = 1, size = 10 } = body;
|
||||
const [rows, count] = await this.chatLogEntity.findAndCount({
|
||||
where: { userId: id, appId, role: 'assistant' },
|
||||
order: { id: 'DESC' },
|
||||
take: size,
|
||||
skip: (page - 1) * size,
|
||||
});
|
||||
return { rows, count };
|
||||
}
|
||||
async checkModelLimits(userId, model) {
|
||||
const ONE_HOUR_IN_MS = 3600 * 1000;
|
||||
const oneHourAgo = new Date(Date.now() - ONE_HOUR_IN_MS);
|
||||
try {
|
||||
const usageCount = await this.chatLogEntity.count({
|
||||
where: {
|
||||
userId: userId.id,
|
||||
model,
|
||||
createdAt: (0, typeorm_2.MoreThan)(oneHourAgo),
|
||||
},
|
||||
});
|
||||
const adjustedUsageCount = Math.ceil(usageCount / 2);
|
||||
common_1.Logger.log(`用户ID: ${userId.id} 一小时内调用 ${model} 模型 ${adjustedUsageCount + 1} 次`, 'ChatLogService');
|
||||
let modelInfo;
|
||||
if (model.startsWith('gpt-4-gizmo')) {
|
||||
modelInfo = await this.modelsService.getCurrentModelKeyInfo('gpts');
|
||||
}
|
||||
else {
|
||||
modelInfo = await this.modelsService.getCurrentModelKeyInfo(model);
|
||||
}
|
||||
const modelLimits = Number(modelInfo.modelLimits);
|
||||
common_1.Logger.log(`模型 ${model} 的使用次数限制为 ${modelLimits}`, 'ChatLogService');
|
||||
if (adjustedUsageCount > modelLimits) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`查询数据库出错 - 用户ID: ${userId.id}, 模型: ${model}, 错误信息: ${error.message}`, error.stack, 'ChatLogService');
|
||||
}
|
||||
}
|
||||
};
|
||||
ChatLogService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__param(0, (0, typeorm_1.InjectRepository)(chatLog_entity_1.ChatLogEntity)),
|
||||
__param(1, (0, typeorm_1.InjectRepository)(user_entity_1.UserEntity)),
|
||||
__param(2, (0, typeorm_1.InjectRepository)(chatGroup_entity_1.ChatGroupEntity)),
|
||||
__metadata("design:paramtypes", [typeorm_2.Repository,
|
||||
typeorm_2.Repository,
|
||||
typeorm_2.Repository,
|
||||
models_service_1.ModelsService])
|
||||
], ChatLogService);
|
||||
exports.ChatLogService = ChatLogService;
|
||||
22
AIWebQuickDeploy/dist/modules/chatLog/dto/chatList.dto.js
vendored
Normal file
22
AIWebQuickDeploy/dist/modules/chatLog/dto/chatList.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.ChatListDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class ChatListDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '对话分组ID', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], ChatListDto.prototype, "groupId", void 0);
|
||||
exports.ChatListDto = ChatListDto;
|
||||
20
AIWebQuickDeploy/dist/modules/chatLog/dto/del.dto.js
vendored
Normal file
20
AIWebQuickDeploy/dist/modules/chatLog/dto/del.dto.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"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.DelDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class DelDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '对话Id', required: true }),
|
||||
__metadata("design:type", Number)
|
||||
], DelDto.prototype, "id", void 0);
|
||||
exports.DelDto = DelDto;
|
||||
20
AIWebQuickDeploy/dist/modules/chatLog/dto/delByGroup.dto.js
vendored
Normal file
20
AIWebQuickDeploy/dist/modules/chatLog/dto/delByGroup.dto.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"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.DelByGroupDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class DelByGroupDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '对话组Id', required: true }),
|
||||
__metadata("design:type", Number)
|
||||
], DelByGroupDto.prototype, "groupId", void 0);
|
||||
exports.DelByGroupDto = DelByGroupDto;
|
||||
37
AIWebQuickDeploy/dist/modules/chatLog/dto/exportExcelChatlog.dto.js
vendored
Normal file
37
AIWebQuickDeploy/dist/modules/chatLog/dto/exportExcelChatlog.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.ExportExcelChatlogDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class ExportExcelChatlogDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '查询页数', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], ExportExcelChatlogDto.prototype, "page", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 10, description: '每页数量', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], ExportExcelChatlogDto.prototype, "size", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '您好', description: '用户询问的问题', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], ExportExcelChatlogDto.prototype, "prompt", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'J_longyan@163.com', description: '用户邮箱', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], ExportExcelChatlogDto.prototype, "email", void 0);
|
||||
exports.ExportExcelChatlogDto = ExportExcelChatlogDto;
|
||||
41
AIWebQuickDeploy/dist/modules/chatLog/dto/queryAllChatLog.dto.js
vendored
Normal file
41
AIWebQuickDeploy/dist/modules/chatLog/dto/queryAllChatLog.dto.js
vendored
Normal 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.QuerAllChatLogDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class QuerAllChatLogDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '查询页数', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllChatLogDto.prototype, "page", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 10, description: '每页数量', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllChatLogDto.prototype, "size", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 99, description: '对话的用户id', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllChatLogDto.prototype, "userId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: '您好', description: '用户询问的问题', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerAllChatLogDto.prototype, "prompt", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'user', description: '身份', required: false }),
|
||||
__metadata("design:type", String)
|
||||
], QuerAllChatLogDto.prototype, "role", void 0);
|
||||
exports.QuerAllChatLogDto = QuerAllChatLogDto;
|
||||
42
AIWebQuickDeploy/dist/modules/chatLog/dto/queryAllDrawLog.dto.js
vendored
Normal file
42
AIWebQuickDeploy/dist/modules/chatLog/dto/queryAllDrawLog.dto.js
vendored
Normal 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.QuerAllDrawLogDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class QuerAllDrawLogDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '查询页数', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllDrawLogDto.prototype, "page", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 10, description: '每页数量', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllDrawLogDto.prototype, "size", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '是否推荐0: 默认 1: 推荐', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllDrawLogDto.prototype, "rec", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 99, description: '生成图片的用户id', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QuerAllDrawLogDto.prototype, "userId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'DALL-E2', description: '生成图片使用的模型', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerAllDrawLogDto.prototype, "model", void 0);
|
||||
exports.QuerAllDrawLogDto = QuerAllDrawLogDto;
|
||||
32
AIWebQuickDeploy/dist/modules/chatLog/dto/queryByAppId.dto.js
vendored
Normal file
32
AIWebQuickDeploy/dist/modules/chatLog/dto/queryByAppId.dto.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.QueryByAppIdDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class QueryByAppIdDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '应用Id', required: true }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QueryByAppIdDto.prototype, "appId", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '查询页数', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QueryByAppIdDto.prototype, "page", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 10, description: '每页数量', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", Number)
|
||||
], QueryByAppIdDto.prototype, "size", void 0);
|
||||
exports.QueryByAppIdDto = QueryByAppIdDto;
|
||||
22
AIWebQuickDeploy/dist/modules/chatLog/dto/queryMyChatLog.dto.js
vendored
Normal file
22
AIWebQuickDeploy/dist/modules/chatLog/dto/queryMyChatLog.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.QuerMyChatLogDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class QuerMyChatLogDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'mj', description: '使用的模型', required: false }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
], QuerMyChatLogDto.prototype, "model", void 0);
|
||||
exports.QuerMyChatLogDto = QuerMyChatLogDto;
|
||||
20
AIWebQuickDeploy/dist/modules/chatLog/dto/recDrawImg.dto.js
vendored
Normal file
20
AIWebQuickDeploy/dist/modules/chatLog/dto/recDrawImg.dto.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"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.recDrawImgDto = void 0;
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
class recDrawImgDto {
|
||||
}
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 1, description: '推荐图片的id' }),
|
||||
__metadata("design:type", Number)
|
||||
], recDrawImgDto.prototype, "id", void 0);
|
||||
exports.recDrawImgDto = recDrawImgDto;
|
||||
Reference in New Issue
Block a user