You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
578 B
29 lines
578 B
'use strict';
|
|
|
|
const QUOTA_LIMITED_RESPONSE_CODE = 'QUOTA_LIMITED';
|
|
|
|
const respondQuotaLimited = (ctx, {
|
|
message,
|
|
limitType = 'create',
|
|
docKind = null,
|
|
code = QUOTA_LIMITED_RESPONSE_CODE,
|
|
confirmToken = null,
|
|
confirmExpireAt = null,
|
|
} = {}) => {
|
|
ctx.status = 200;
|
|
ctx.body = {
|
|
success: false,
|
|
quotaLimited: true,
|
|
code,
|
|
limitType,
|
|
docKind,
|
|
message: message || '操作次数已达上限',
|
|
confirmToken,
|
|
confirmExpireAt,
|
|
};
|
|
};
|
|
|
|
module.exports = {
|
|
QUOTA_LIMITED_RESPONSE_CODE,
|
|
respondQuotaLimited,
|
|
};
|
|
|