ob-repository-synchronize/web/mock/Account/deleteGithubAccount.js

28 lines
835 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const Mock = require('mockjs');
const dist =
// 接收 req 参数, 用于传递 req.query 或 req.body 等参数
(req) => ({
default: {
headers: {},
statusCode: 200,
data: {
// 生成大小在 0~10000 之间的整数
code: '@integer(0, 10000)',
// 生成长度在 0~32 之间的小写字母
msg: '@string("lower", 0, 32)',
// 生成一个布尔值10% 的概率为 false, 90% 的概率为 true
success: '@boolean(1, 9, false)',
// 生成一个布尔值10% 的概率为 false, 90% 的概率为 true
finished: '@boolean(1, 9, false)',
},
},
});
module.exports = {
'DELETE /cerobot/account/github_accounts': (req, res) => {
const response = Mock.mock(dist(req)['default']).data;
res.status(200).send(response);
},
};