YiAi/YiAiQuickDeploy/dist/modules/midjourney/midjourney.controller.js
2024-07-02 16:38:26 +08:00

1 line
11 KiB
JavaScript

'use strict';const _0x508791=_0x576e;(function(_0x2e9120,_0x20d4de){const _0x53cd03=_0x576e,_0x194836=_0x2e9120();while(!![]){try{const _0x3e529d=-parseInt(_0x53cd03(0x1e9))/0x1+parseInt(_0x53cd03(0x1b4))/0x2+parseInt(_0x53cd03(0x1b6))/0x3+parseInt(_0x53cd03(0x1ec))/0x4+-parseInt(_0x53cd03(0x1c2))/0x5+-parseInt(_0x53cd03(0x1ba))/0x6*(parseInt(_0x53cd03(0x1a0))/0x7)+parseInt(_0x53cd03(0x1d0))/0x8*(-parseInt(_0x53cd03(0x1b1))/0x9);if(_0x3e529d===_0x20d4de)break;else _0x194836['push'](_0x194836['shift']());}catch(_0x1a4661){_0x194836['push'](_0x194836['shift']());}}}(_0x596a,0xf2c86));var __decorate=this&&this['__decorate']||function(_0x5b79dd,_0x4b9754,_0xb4d436,_0x2f56a8){const _0x4b231d=_0x576e;var _0xd93f30=arguments[_0x4b231d(0x1ac)],_0x333b46=_0xd93f30<0x3?_0x4b9754:_0x2f56a8===null?_0x2f56a8=Object[_0x4b231d(0x1c5)](_0x4b9754,_0xb4d436):_0x2f56a8,_0x51a7ac;if(typeof Reflect===_0x4b231d(0x1b5)&&typeof Reflect['decorate']===_0x4b231d(0x1e3))_0x333b46=Reflect[_0x4b231d(0x1ee)](_0x5b79dd,_0x4b9754,_0xb4d436,_0x2f56a8);else{for(var _0x136991=_0x5b79dd[_0x4b231d(0x1ac)]-0x1;_0x136991>=0x0;_0x136991--)if(_0x51a7ac=_0x5b79dd[_0x136991])_0x333b46=(_0xd93f30<0x3?_0x51a7ac(_0x333b46):_0xd93f30>0x3?_0x51a7ac(_0x4b9754,_0xb4d436,_0x333b46):_0x51a7ac(_0x4b9754,_0xb4d436))||_0x333b46;}return _0xd93f30>0x3&&_0x333b46&&Object[_0x4b231d(0x1e8)](_0x4b9754,_0xb4d436,_0x333b46),_0x333b46;},__metadata=this&&this[_0x508791(0x1d7)]||function(_0x3ac56a,_0x94c1c0){const _0x3d1715=_0x508791;if(typeof Reflect===_0x3d1715(0x1b5)&&typeof Reflect['metadata']==='function')return Reflect[_0x3d1715(0x1ae)](_0x3ac56a,_0x94c1c0);},__param=this&&this[_0x508791(0x1ea)]||function(_0x1f06b7,_0x3bbce2){return function(_0x54ec77,_0x4cff05){_0x3bbce2(_0x54ec77,_0x4cff05,_0x1f06b7);};};function _0x596a(){const _0x147312=['删除log','MidjourneyService','MidjourneyController','ApiBearerAuth','../../common/auth/superAuth.guard','del','添加修改prompt提示词','getFullPrompt','推荐图片','JwtAuthGuard','url','length','delPrompt','metadata','get','proxy','317790IakyLr','ApiOperation','send','3050206CTXhNh','object','1070430MxQhRL','download','AdminAuthGuard','../../common/auth/adminAuth.guard','1362vpeDXS','获取绘画列表','getDrawList','Res','Controller','__esModule','./dto/getList.dto','获取我的绘画列表','2329305rlGUtb','UseGuards','@nestjs/swagger','getOwnPropertyDescriptor','SuperAuthGuard','drawList','GetListDto','deleteDraw','queryPrompts','from','Get','data','image/png','design:returntype','96wGeyja','set','../../common/auth/jwtAuth.guard','setPrompt','default','delLog','代理图片','__metadata','design:type','Body','@nestjs/common','Req','delete','Query','recDraw','midjourneyService','getAdminDrawList','prototype','rec','function','design:paramtypes','proxyImg','getList','queryPrompt','defineProperty','1338268XiiukD','__param','删除绘画','7910252cNtNqC','Post','decorate','管理端获取绘画列表','19649iDUmml'];_0x596a=function(){return _0x147312;};return _0x596a();}Object[_0x508791(0x1e8)](exports,_0x508791(0x1bf),{'value':!![]}),exports[_0x508791(0x1a3)]=void 0x0;const superAuth_guard_1=require(_0x508791(0x1a5)),midjourney_service_1=require('./midjourney.service'),jwtAuth_guard_1=require(_0x508791(0x1d2)),common_1=require(_0x508791(0x1da)),swagger_1=require(_0x508791(0x1c4)),axios_1=require('axios'),getList_dto_1=require(_0x508791(0x1c0)),adminAuth_guard_1=require(_0x508791(0x1b9));let MidjourneyController=class MidjourneyController{constructor(_0x4a7f55){const _0x49982f=_0x508791;this[_0x49982f(0x1df)]=_0x4a7f55;}async[_0x508791(0x1bc)](_0x3f1237,_0x38541b){const _0x59f6f3=_0x508791;return await this[_0x59f6f3(0x1df)][_0x59f6f3(0x1bc)](_0x3f1237,_0x38541b);}async[_0x508791(0x1e6)](_0x12fedf){const _0x3b2361=_0x508791;return await this[_0x3b2361(0x1df)][_0x3b2361(0x1e6)](_0x12fedf);}async['getFullPrompt'](_0xa63f15){const _0x37b1ce=_0x508791;return await this[_0x37b1ce(0x1df)][_0x37b1ce(0x1a8)](_0xa63f15);}async[_0x508791(0x1e0)](_0x11e11c,_0xc9807b){const _0x494316=_0x508791;return await this[_0x494316(0x1df)][_0x494316(0x1e0)](_0x11e11c,_0xc9807b);}async['recDraw'](_0x3824ef){const _0x4387af=_0x508791;return await this[_0x4387af(0x1df)]['recDraw'](_0x3824ef);}async[_0x508791(0x1b7)](_0xd891a8,_0x42f576){const _0x1b827b=_0x508791,_0x94f34=await axios_1[_0x1b827b(0x1d4)][_0x1b827b(0x1af)](_0xd891a8,{'responseType':'arraybuffer'}),_0x320166=Buffer[_0x1b827b(0x1cb)](_0x94f34[_0x1b827b(0x1cd)],'binary');_0x42f576[_0x1b827b(0x1d1)]({'Content-Type':_0x1b827b(0x1ce)}),_0x42f576[_0x1b827b(0x1b3)](_0x320166);}async[_0x508791(0x1c9)](_0xf72bfe,_0x370f57){const _0x40fb2b=_0x508791;return await this[_0x40fb2b(0x1df)][_0x40fb2b(0x1c9)](_0xf72bfe,_0x370f57);}async[_0x508791(0x1d5)](_0x5d89e6,_0x1484d5){const _0x318004=_0x508791;return await this[_0x318004(0x1df)][_0x318004(0x1d5)](_0x5d89e6,_0x1484d5);}async[_0x508791(0x1d3)](_0x5ed8da,_0x257a07){const _0x5a03d4=_0x508791;return await this[_0x5a03d4(0x1df)][_0x5a03d4(0x1d3)](_0x5ed8da,_0x257a07);}async[_0x508791(0x1ad)](_0x45fd4f,_0x27c6b3){const _0x1f9f24=_0x508791;return await this[_0x1f9f24(0x1df)][_0x1f9f24(0x1ad)](_0x45fd4f,_0x27c6b3);}async['queryPrompt'](){return await this['midjourneyService']['queryPrompt']();}async[_0x508791(0x1e5)](_0x3a4dd6){const _0x1d4537=_0x508791;return await this[_0x1d4537(0x1df)]['proxyImg'](_0x3a4dd6);}};function _0x576e(_0x171f44,_0xe3f3dd){const _0x596af1=_0x596a();return _0x576e=function(_0x576e06,_0x5529c8){_0x576e06=_0x576e06-0x1a0;let _0xe42bcc=_0x596af1[_0x576e06];return _0xe42bcc;},_0x576e(_0x171f44,_0xe3f3dd);}__decorate([(0x0,common_1[_0x508791(0x1cc)])(_0x508791(0x1c7)),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1c1)}),(0x0,common_1[_0x508791(0x1c3)])(jwtAuth_guard_1[_0x508791(0x1aa)]),(0x0,swagger_1[_0x508791(0x1a4)])(),__param(0x0,(0x0,common_1['Req'])()),__param(0x1,(0x0,common_1[_0x508791(0x1dd)])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Object,Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController[_0x508791(0x1e1)],_0x508791(0x1bc),null),__decorate([(0x0,common_1[_0x508791(0x1cc)])('getList'),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1bb)}),__param(0x0,(0x0,common_1[_0x508791(0x1dd)])()),__metadata('design:type',Function),__metadata(_0x508791(0x1e4),[getList_dto_1[_0x508791(0x1c8)]]),__metadata('design:returntype',Promise)],MidjourneyController['prototype'],'getList',null),__decorate([(0x0,common_1['Get'])(_0x508791(0x1a8)),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1bb)}),__param(0x0,(0x0,common_1[_0x508791(0x1dd)])('id')),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Number]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController['prototype'],'getFullPrompt',null),__decorate([(0x0,common_1[_0x508791(0x1cc)])('adminDrawList'),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1ef)}),(0x0,common_1['UseGuards'])(adminAuth_guard_1[_0x508791(0x1b8)]),(0x0,swagger_1[_0x508791(0x1a4)])(),__param(0x0,(0x0,common_1[_0x508791(0x1db)])()),__param(0x1,(0x0,common_1[_0x508791(0x1dd)])()),__metadata('design:type',Function),__metadata(_0x508791(0x1e4),[Object,getList_dto_1[_0x508791(0x1c8)]]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController['prototype'],_0x508791(0x1e0),null),__decorate([(0x0,common_1[_0x508791(0x1ed)])(_0x508791(0x1e2)),(0x0,swagger_1['ApiOperation'])({'summary':_0x508791(0x1a9)}),(0x0,common_1[_0x508791(0x1c3)])(superAuth_guard_1[_0x508791(0x1c6)]),(0x0,swagger_1[_0x508791(0x1a4)])(),__param(0x0,(0x0,common_1[_0x508791(0x1d9)])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController['prototype'],_0x508791(0x1de),null),__decorate([(0x0,common_1[_0x508791(0x1ed)])(_0x508791(0x1b7)),(0x0,swagger_1['ApiOperation'])({'summary':'下载绘画'}),__param(0x0,(0x0,common_1[_0x508791(0x1d9)])(_0x508791(0x1ab))),__param(0x1,(0x0,common_1[_0x508791(0x1bd)])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[String,Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController[_0x508791(0x1e1)],'download',null),__decorate([(0x0,common_1[_0x508791(0x1ed)])(_0x508791(0x1dc)),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1eb)}),(0x0,common_1['UseGuards'])(jwtAuth_guard_1[_0x508791(0x1aa)]),(0x0,swagger_1['ApiBearerAuth'])(),__param(0x0,(0x0,common_1['Body'])('id')),__param(0x1,(0x0,common_1['Req'])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Number,Object]),__metadata('design:returntype',Promise)],MidjourneyController['prototype'],_0x508791(0x1c9),null),__decorate([(0x0,common_1[_0x508791(0x1ed)])(_0x508791(0x1a6)),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1a1)}),(0x0,common_1[_0x508791(0x1c3)])(superAuth_guard_1[_0x508791(0x1c6)]),(0x0,swagger_1['ApiBearerAuth'])(),__param(0x0,(0x0,common_1[_0x508791(0x1db)])()),__param(0x1,(0x0,common_1[_0x508791(0x1d9)])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Object,Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController[_0x508791(0x1e1)],'delLog',null),__decorate([(0x0,common_1[_0x508791(0x1ed)])('setPrompt'),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1a7)}),(0x0,common_1['UseGuards'])(superAuth_guard_1[_0x508791(0x1c6)]),(0x0,swagger_1[_0x508791(0x1a4)])(),__param(0x0,(0x0,common_1['Req'])()),__param(0x1,(0x0,common_1[_0x508791(0x1d9)])()),__metadata(_0x508791(0x1d8),Function),__metadata('design:paramtypes',[Object,Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController[_0x508791(0x1e1)],'setPrompt',null),__decorate([(0x0,common_1[_0x508791(0x1ed)])('delPrompt'),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1a7)}),(0x0,common_1['UseGuards'])(superAuth_guard_1[_0x508791(0x1c6)]),(0x0,swagger_1[_0x508791(0x1a4)])(),__param(0x0,(0x0,common_1[_0x508791(0x1db)])()),__param(0x1,(0x0,common_1[_0x508791(0x1d9)])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Object,Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController[_0x508791(0x1e1)],'delPrompt',null),__decorate([(0x0,common_1['Get'])(_0x508791(0x1ca)),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':'查询prompt列表'}),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[]),__metadata('design:returntype',Promise)],MidjourneyController['prototype'],_0x508791(0x1e7),null),__decorate([(0x0,common_1[_0x508791(0x1cc)])(_0x508791(0x1b0)),(0x0,swagger_1[_0x508791(0x1b2)])({'summary':_0x508791(0x1d6)}),(0x0,swagger_1[_0x508791(0x1a4)])(),__param(0x0,(0x0,common_1['Query'])()),__metadata(_0x508791(0x1d8),Function),__metadata(_0x508791(0x1e4),[Object]),__metadata(_0x508791(0x1cf),Promise)],MidjourneyController[_0x508791(0x1e1)],_0x508791(0x1e5),null),MidjourneyController=__decorate([(0x0,common_1[_0x508791(0x1be)])('midjourney'),__metadata(_0x508791(0x1e4),[midjourney_service_1[_0x508791(0x1a2)]])],MidjourneyController),exports['MidjourneyController']=MidjourneyController;