YiAi/YiAiQuickDeploy/dist/modules/midjourney/midjourney.controller.js

1 line
10 KiB
JavaScript

'use strict';const _0xce322=_0x2f18;(function(_0x14cc27,_0x50889b){const _0x2137ab=_0x2f18,_0x3461ad=_0x14cc27();while(!![]){try{const _0xca8bf=parseInt(_0x2137ab(0xbd))/0x1+-parseInt(_0x2137ab(0x8b))/0x2+-parseInt(_0x2137ab(0xb3))/0x3*(parseInt(_0x2137ab(0x7f))/0x4)+parseInt(_0x2137ab(0xac))/0x5+-parseInt(_0x2137ab(0xa3))/0x6*(-parseInt(_0x2137ab(0x7d))/0x7)+parseInt(_0x2137ab(0x86))/0x8+-parseInt(_0x2137ab(0xa5))/0x9*(parseInt(_0x2137ab(0x84))/0xa);if(_0xca8bf===_0x50889b)break;else _0x3461ad['push'](_0x3461ad['shift']());}catch(_0x24c2b0){_0x3461ad['push'](_0x3461ad['shift']());}}}(_0x6f2b,0xc2ca9));function _0x6f2b(){const _0x4ca4f2=['MidjourneyService','__decorate','508703wamHDI','function','推荐图片','queryPrompts','design:paramtypes','MidjourneyController','@nestjs/swagger','添加修改prompt提示词','prototype','queryPrompt','SuperAuthGuard','rec','9661939eHpYZP','set','1023172apwtFv','查询prompt列表','recDraw','getList','GetListDto','10eSaLRR','Query','9444240YpGvUz','object','UseGuards','管理端获取绘画列表','defineProperty','915974TqVuwj','__param','Get','./dto/getList.dto','删除log','AdminAuthGuard','Controller','delPrompt','获取绘画列表','../../common/auth/adminAuth.guard','Req','getAdminDrawList','midjourneyService','下载绘画','Body','length','getFullPrompt','代理图片','adminDrawList','design:type','deleteDraw','getDrawList','获取我的绘画列表','del','6Zbbjyo','metadata','12001923syCZcr','setPrompt','axios','arraybuffer','url','proxy','__esModule','3994270YJtRnA','Res','delLog','data','Post','design:returntype','删除绘画','15WvMMbU','ApiOperation','delete','download','ApiBearerAuth','__metadata','proxyImg','getOwnPropertyDescriptor'];_0x6f2b=function(){return _0x4ca4f2;};return _0x6f2b();}var __decorate=this&&this[_0xce322(0xbc)]||function(_0xc47de4,_0x54a67f,_0x40d756,_0x5ccdb1){const _0x18fe9a=_0xce322;var _0x1bc867=arguments[_0x18fe9a(0x9a)],_0x40e6d8=_0x1bc867<0x3?_0x54a67f:_0x5ccdb1===null?_0x5ccdb1=Object[_0x18fe9a(0xba)](_0x54a67f,_0x40d756):_0x5ccdb1,_0x11ccae;if(typeof Reflect===_0x18fe9a(0x87)&&typeof Reflect['decorate']===_0x18fe9a(0xbe))_0x40e6d8=Reflect['decorate'](_0xc47de4,_0x54a67f,_0x40d756,_0x5ccdb1);else{for(var _0x40fc63=_0xc47de4[_0x18fe9a(0x9a)]-0x1;_0x40fc63>=0x0;_0x40fc63--)if(_0x11ccae=_0xc47de4[_0x40fc63])_0x40e6d8=(_0x1bc867<0x3?_0x11ccae(_0x40e6d8):_0x1bc867>0x3?_0x11ccae(_0x54a67f,_0x40d756,_0x40e6d8):_0x11ccae(_0x54a67f,_0x40d756))||_0x40e6d8;}return _0x1bc867>0x3&&_0x40e6d8&&Object[_0x18fe9a(0x8a)](_0x54a67f,_0x40d756,_0x40e6d8),_0x40e6d8;},__metadata=this&&this[_0xce322(0xb8)]||function(_0x2e3349,_0x5caf35){const _0x278baf=_0xce322;if(typeof Reflect===_0x278baf(0x87)&&typeof Reflect[_0x278baf(0xa4)]===_0x278baf(0xbe))return Reflect[_0x278baf(0xa4)](_0x2e3349,_0x5caf35);},__param=this&&this[_0xce322(0x8c)]||function(_0x443ca2,_0x527769){return function(_0x35eafc,_0x189048){_0x527769(_0x35eafc,_0x189048,_0x443ca2);};};function _0x2f18(_0x23bf8f,_0x485065){const _0x6f2bc1=_0x6f2b();return _0x2f18=function(_0x2f18f9,_0xe28070){_0x2f18f9=_0x2f18f9-0x75;let _0x283db6=_0x6f2bc1[_0x2f18f9];return _0x283db6;},_0x2f18(_0x23bf8f,_0x485065);}Object[_0xce322(0x8a)](exports,_0xce322(0xab),{'value':!![]}),exports[_0xce322(0x76)]=void 0x0;const superAuth_guard_1=require('../../common/auth/superAuth.guard'),midjourney_service_1=require('./midjourney.service'),jwtAuth_guard_1=require('../../common/auth/jwtAuth.guard'),common_1=require('@nestjs/common'),swagger_1=require(_0xce322(0x77)),axios_1=require(_0xce322(0xa7)),getList_dto_1=require(_0xce322(0x8e)),adminAuth_guard_1=require(_0xce322(0x94));let MidjourneyController=class MidjourneyController{constructor(_0x30769b){const _0xf9d6bb=_0xce322;this[_0xf9d6bb(0x97)]=_0x30769b;}async[_0xce322(0xa0)](_0x40772e,_0x5267b8){const _0x599291=_0xce322;return await this[_0x599291(0x97)][_0x599291(0xa0)](_0x40772e,_0x5267b8);}async[_0xce322(0x82)](_0x596930){const _0x223563=_0xce322;return await this[_0x223563(0x97)][_0x223563(0x82)](_0x596930);}async[_0xce322(0x9b)](_0x17ac3a){return await this['midjourneyService']['getFullPrompt'](_0x17ac3a);}async[_0xce322(0x96)](_0x5cdca2,_0x2ba317){const _0x1ac88f=_0xce322;return await this[_0x1ac88f(0x97)][_0x1ac88f(0x96)](_0x5cdca2,_0x2ba317);}async[_0xce322(0x81)](_0x1c8ad0){const _0x239cc2=_0xce322;return await this[_0x239cc2(0x97)][_0x239cc2(0x81)](_0x1c8ad0);}async[_0xce322(0xb6)](_0x47cb29,_0x4950ef){const _0x204401=_0xce322,_0x5b5b07=await axios_1['default']['get'](_0x47cb29,{'responseType':_0x204401(0xa8)}),_0x58bd18=Buffer['from'](_0x5b5b07[_0x204401(0xaf)],'binary');_0x4950ef[_0x204401(0x7e)]({'Content-Type':'image/png'}),_0x4950ef['send'](_0x58bd18);}async[_0xce322(0x9f)](_0x3e87b7,_0x139a6c){const _0x4cc2d6=_0xce322;return await this['midjourneyService'][_0x4cc2d6(0x9f)](_0x3e87b7,_0x139a6c);}async[_0xce322(0xae)](_0x48b2a1,_0x3582f8){return await this['midjourneyService']['delLog'](_0x48b2a1,_0x3582f8);}async['setPrompt'](_0x1b154f,_0x1de970){const _0x1da634=_0xce322;return await this[_0x1da634(0x97)][_0x1da634(0xa6)](_0x1b154f,_0x1de970);}async['delPrompt'](_0x55290a,_0x1fd1b1){const _0x142a59=_0xce322;return await this['midjourneyService'][_0x142a59(0x92)](_0x55290a,_0x1fd1b1);}async[_0xce322(0x7a)](){const _0x375c88=_0xce322;return await this[_0x375c88(0x97)][_0x375c88(0x7a)]();}async[_0xce322(0xb9)](_0x272e93){const _0x14dbe5=_0xce322;return await this[_0x14dbe5(0x97)][_0x14dbe5(0xb9)](_0x272e93);}};__decorate([(0x0,common_1[_0xce322(0x8d)])('drawList'),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0xa1)}),(0x0,common_1[_0xce322(0x88)])(jwtAuth_guard_1['JwtAuthGuard']),(0x0,swagger_1['ApiBearerAuth'])(),__param(0x0,(0x0,common_1[_0xce322(0x95)])()),__param(0x1,(0x0,common_1[_0xce322(0x85)])()),__metadata('design:type',Function),__metadata('design:paramtypes',[Object,Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0xa0),null),__decorate([(0x0,common_1[_0xce322(0x8d)])(_0xce322(0x82)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':'获取绘画列表'}),__param(0x0,(0x0,common_1[_0xce322(0x85)])()),__metadata('design:type',Function),__metadata('design:paramtypes',[getList_dto_1[_0xce322(0x83)]]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0x82),null),__decorate([(0x0,common_1[_0xce322(0x8d)])(_0xce322(0x9b)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0x93)}),__param(0x0,(0x0,common_1['Query'])('id')),__metadata(_0xce322(0x9e),Function),__metadata('design:paramtypes',[Number]),__metadata('design:returntype',Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0x9b),null),__decorate([(0x0,common_1[_0xce322(0x8d)])(_0xce322(0x9d)),(0x0,swagger_1['ApiOperation'])({'summary':_0xce322(0x89)}),(0x0,common_1['UseGuards'])(adminAuth_guard_1[_0xce322(0x90)]),(0x0,swagger_1[_0xce322(0xb7)])(),__param(0x0,(0x0,common_1[_0xce322(0x95)])()),__param(0x1,(0x0,common_1[_0xce322(0x85)])()),__metadata(_0xce322(0x9e),Function),__metadata('design:paramtypes',[Object,getList_dto_1[_0xce322(0x83)]]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController['prototype'],_0xce322(0x96),null),__decorate([(0x0,common_1[_0xce322(0xb0)])(_0xce322(0x7c)),(0x0,swagger_1['ApiOperation'])({'summary':_0xce322(0xbf)}),(0x0,common_1[_0xce322(0x88)])(superAuth_guard_1['SuperAuthGuard']),(0x0,swagger_1[_0xce322(0xb7)])(),__param(0x0,(0x0,common_1[_0xce322(0x99)])()),__metadata(_0xce322(0x9e),Function),__metadata(_0xce322(0x75),[Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0x81),null),__decorate([(0x0,common_1[_0xce322(0xb0)])(_0xce322(0xb6)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0x98)}),__param(0x0,(0x0,common_1[_0xce322(0x99)])(_0xce322(0xa9))),__param(0x1,(0x0,common_1[_0xce322(0xad)])()),__metadata(_0xce322(0x9e),Function),__metadata('design:paramtypes',[String,Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0xb6),null),__decorate([(0x0,common_1[_0xce322(0xb0)])(_0xce322(0xb5)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0xb2)}),(0x0,common_1['UseGuards'])(jwtAuth_guard_1['JwtAuthGuard']),(0x0,swagger_1['ApiBearerAuth'])(),__param(0x0,(0x0,common_1[_0xce322(0x99)])('id')),__param(0x1,(0x0,common_1[_0xce322(0x95)])()),__metadata(_0xce322(0x9e),Function),__metadata(_0xce322(0x75),[Number,Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController['prototype'],_0xce322(0x9f),null),__decorate([(0x0,common_1[_0xce322(0xb0)])(_0xce322(0xa2)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0x8f)}),(0x0,common_1[_0xce322(0x88)])(superAuth_guard_1[_0xce322(0x7b)]),(0x0,swagger_1['ApiBearerAuth'])(),__param(0x0,(0x0,common_1[_0xce322(0x95)])()),__param(0x1,(0x0,common_1[_0xce322(0x99)])()),__metadata('design:type',Function),__metadata(_0xce322(0x75),[Object,Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],'delLog',null),__decorate([(0x0,common_1[_0xce322(0xb0)])(_0xce322(0xa6)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0x78)}),(0x0,common_1['UseGuards'])(superAuth_guard_1['SuperAuthGuard']),(0x0,swagger_1[_0xce322(0xb7)])(),__param(0x0,(0x0,common_1['Req'])()),__param(0x1,(0x0,common_1[_0xce322(0x99)])()),__metadata(_0xce322(0x9e),Function),__metadata(_0xce322(0x75),[Object,Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController['prototype'],_0xce322(0xa6),null),__decorate([(0x0,common_1[_0xce322(0xb0)])(_0xce322(0x92)),(0x0,swagger_1['ApiOperation'])({'summary':'添加修改prompt提示词'}),(0x0,common_1['UseGuards'])(superAuth_guard_1[_0xce322(0x7b)]),(0x0,swagger_1[_0xce322(0xb7)])(),__param(0x0,(0x0,common_1['Req'])()),__param(0x1,(0x0,common_1[_0xce322(0x99)])()),__metadata(_0xce322(0x9e),Function),__metadata(_0xce322(0x75),[Object,Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0x92),null),__decorate([(0x0,common_1[_0xce322(0x8d)])(_0xce322(0xc0)),(0x0,swagger_1['ApiOperation'])({'summary':_0xce322(0x80)}),__metadata(_0xce322(0x9e),Function),__metadata(_0xce322(0x75),[]),__metadata('design:returntype',Promise)],MidjourneyController['prototype'],'queryPrompt',null),__decorate([(0x0,common_1['Get'])(_0xce322(0xaa)),(0x0,swagger_1[_0xce322(0xb4)])({'summary':_0xce322(0x9c)}),(0x0,swagger_1[_0xce322(0xb7)])(),__param(0x0,(0x0,common_1[_0xce322(0x85)])()),__metadata(_0xce322(0x9e),Function),__metadata(_0xce322(0x75),[Object]),__metadata(_0xce322(0xb1),Promise)],MidjourneyController[_0xce322(0x79)],_0xce322(0xb9),null),MidjourneyController=__decorate([(0x0,common_1[_0xce322(0x91)])('midjourney'),__metadata(_0xce322(0x75),[midjourney_service_1[_0xce322(0xbb)]])],MidjourneyController),exports['MidjourneyController']=MidjourneyController;