ad2bf983248683cd62953935a9d84bfde4f4b13a
[motion-next.git] / server / api / squareProject / squareProject.rpc.js
1 const a601_0x819a=['model','message','options','../../rediscache','info','map','../../config/logger','raw','catch','include','error','where','then','stringify','SquareProject','lodash','ShowSquareProject','debug'];(function(_0x2c36cd,_0x819a1c){const _0x11cccd=function(_0x5083ba){while(--_0x5083ba){_0x2c36cd['push'](_0x2c36cd['shift']());}};_0x11cccd(++_0x819a1c);}(a601_0x819a,0x1de));const a601_0x11cc=function(_0x2c36cd,_0x819a1c){_0x2c36cd=_0x2c36cd-0x0;let _0x11cccd=a601_0x819a[_0x2c36cd];return _0x11cccd;};const _0x2a78c9=a601_0x11cc;'use strict';const db=require('../../mysqldb')['db'],logger=require(_0x2a78c9('0xe'))('rpc'),_=require(_0x2a78c9('0x5')),{getSocket}=require(_0x2a78c9('0xb')),socket=getSocket();require('./squareProject.socket')['register'](socket),exports['ShowSquareProject']=function(_0x5083ba){const _0x147b97=this;return new Promise(function(_0xc2e4fa,_0x1e2425){const _0x1f6afa=a601_0x11cc;return db[_0x1f6afa('0x4')]['findOne']({'raw':_0x5083ba[_0x1f6afa('0xa')]?_0x5083ba[_0x1f6afa('0xa')][_0x1f6afa('0xf')]===undefined?!![]:![]:!![],'where':_0x5083ba[_0x1f6afa('0xa')]?_0x5083ba['options'][_0x1f6afa('0x1')]||null:null,'attributes':_0x5083ba[_0x1f6afa('0xa')]?_0x5083ba['options']['attributes']||null:null,'include':_0x5083ba[_0x1f6afa('0xa')]?_0x5083ba[_0x1f6afa('0xa')]['include']?_[_0x1f6afa('0xd')](_0x5083ba[_0x1f6afa('0xa')][_0x1f6afa('0x11')],function(_0x5de774){const _0x455a47=_0x1f6afa;return{'model':db[_0x5de774[_0x455a47('0x8')]],'as':_0x5de774['as'],'attributes':_0x5de774['attributes'],'include':_0x5de774['include']?_[_0x455a47('0xd')](_0x5de774[_0x455a47('0x11')],function(_0x2d752c){return{'model':db[_0x2d752c['model']],'as':_0x2d752c['as'],'attributes':_0x2d752c['attributes'],'include':_0x2d752c['include']?_['map'](_0x2d752c['include'],function(_0x140da9){const _0x3844aa=a601_0x11cc;return{'model':db[_0x140da9[_0x3844aa('0x8')]],'as':_0x140da9['as'],'attributes':_0x140da9['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f6afa('0x2')](function(_0x555777){const _0x844d76=_0x1f6afa;logger[_0x844d76('0xc')](_0x844d76('0x6'),_0x5083ba),logger[_0x844d76('0x7')](_0x844d76('0x6'),_0x5083ba,JSON[_0x844d76('0x3')](_0x555777)),_0xc2e4fa(_0x555777);})[_0x1f6afa('0x10')](function(_0x5200c2){const _0x33d71b=_0x1f6afa;logger[_0x33d71b('0x0')](_0x33d71b('0x6'),_0x5200c2[_0x33d71b('0x9')],_0x5083ba),_0x1e2425(_0x147b97[_0x33d71b('0x0')](0x1f4,_0x5200c2['message']));});});};