const base64 = require('base-64');
const JiraClient = require('jira-connector');
const jira = new JiraClient( {
host: 'ksr-ca-qmaltjira.ca.kronos.com',
protocol: 'http',
basic_auth: {
base64: base64.encode("username:password")
},
port: 8061
});
//endpoint
app.get('/jiraWIPCRs', (req, res) =>{
jira.search.search({
jql: ' "ECR #" != NULL AND "status" != Accepted AND "status" != Canceled AND
"type" = "Change Request" AND "project"="Customer Support"',
maxResults: 5000
}, function(error, issue) {
res.send(issue);
});
});
const port = process.env.PORT || 2000;
app.listen(port, () => {
console.log("App is running on port " + port);
});
继续收到错误消息,指出+不支持的操作数类型:“ int”和“ function”
答案 0 :(得分:0)
您的代码中有一些错误:
return 0
和return clean_list
。l1[0] + clean_list(l1[1:], l2)
。l1
为空(not l1
),则应返回空列表。话虽如此,您在这里是代码:
def clean_list(l1, l2):
if l1 == l2:
return []
if not l1:
return []
if l1[0] not in l2:
return [l1[0]] + clean_list(l1[1:], l2)
else:
return clean_list(l1[1:], l2)
unique = clean_list([1, 2, 3, 4, 5, 6, 7], [2, 4, 6])
print(unique)
输出
[1, 3, 5, 7]