|
@ -20,7 +20,44 @@ async function appList (ctx) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function projectAnxincloud (ctx) { |
|
|
|
|
|
try { |
|
|
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
|
|
|
|
|
|
|
|
const projectRes = await clickHouse.anxinyun.query(`SELECT * FROM t_project WHERE project_state = 4 ORDER BY id DESC`).toPromise() |
|
|
|
|
|
|
|
|
|
|
|
ctx.status = 200; |
|
|
|
|
|
ctx.body = projectRes |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: error`); |
|
|
|
|
|
ctx.status = 400; |
|
|
|
|
|
ctx.body = { |
|
|
|
|
|
message: typeof error == 'string' ? error : undefined |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function projectPManage (ctx) { |
|
|
|
|
|
try { |
|
|
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
|
|
const { clickHouse } = ctx.app.fs |
|
|
|
|
|
|
|
|
|
|
|
const projectRes = await clickHouse.projectManage.query(`SELECT * FROM t_project WHERE project_state = 4 ORDER BY id DESC`).toPromise() |
|
|
|
|
|
|
|
|
|
|
|
ctx.status = 200; |
|
|
|
|
|
ctx.body = projectRes |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: error`); |
|
|
|
|
|
ctx.status = 400; |
|
|
|
|
|
ctx.body = { |
|
|
|
|
|
message: typeof error == 'string' ? error : undefined |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
module.exports = { |
|
|
module.exports = { |
|
|
appList, |
|
|
appList, |
|
|
|
|
|
projectAnxincloud, |
|
|
|
|
|
projectPManage, |
|
|
}; |
|
|
}; |