Browse Source

绑定关系删除接口

dev
巴林闲侠 2 years ago
parent
commit
f743f95567
  1. 26
      api/app/lib/controllers/project/bind.js
  2. 3
      api/app/lib/routes/project/index.js

26
api/app/lib/controllers/project/bind.js

@ -153,7 +153,31 @@ async function bindAnxin2pep (ctx) {
}
}
async function del (ctx) {
try {
const models = ctx.fs.dc.models;
const { bindId } = ctx.query
await models.ProjectCorrelation.update({
del: true
}, {
where: {
id: bindId
}
})
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
bindAnxin2pep,
del
};

3
api/app/lib/routes/project/index.js

@ -10,6 +10,9 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['POST/project/bind'] = { content: '绑定安心云、项目管理项目', visible: true };
router.post('/project/bind', projectBind.bindAnxin2pep);
app.fs.api.logAttr['DEL/project/bind/:bindId'] = { content: '删除安心云、项目管理项目绑定关系', visible: true };
router.delete('/project/bind/:bindId', projectBind.del);
app.fs.api.logAttr['GET/project/anxincloud'] = { content: '获取安心云项目', visible: true };
router.get('/project/anxincloud', project.projectAnxincloud);

Loading…
Cancel
Save