'use strict'; async function bindAnxin2pep (ctx) { try { const models = ctx.fs.dc.models; const { clickHouse } = ctx.app.fs const { bindId, name, pepProjectId, anxinProjectId = [], app = [] } = ctx.request.body const existRes = await models.ProjectCorrelation.findOne({ where: { pepProjectId: pepProjectId } }) if (bindId) { } else { if (existRes) { throw '当前项企项目已绑定' } } ctx.status = 20; } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { message: typeof error == 'string' ? error : undefined } } } module.exports = { bindAnxin2pep };