|
@@ -73,6 +73,11 @@
|
|
|
.field-desc-table td { padding: 4px 8px; border: 1px solid #ddd; color: #555; }
|
|
.field-desc-table td { padding: 4px 8px; border: 1px solid #ddd; color: #555; }
|
|
|
.field-desc-table td code { background: #e8e8e8; padding: 1px 4px; border-radius: 2px; font-size: 11px; }
|
|
.field-desc-table td code { background: #e8e8e8; padding: 1px 4px; border-radius: 2px; font-size: 11px; }
|
|
|
|
|
|
|
|
|
|
+ .field-desc-details { margin-bottom: 12px; background: #f5f7fa; border: 1px solid #e0e0e0; border-radius: 4px; padding: 8px 12px; }
|
|
|
|
|
+ .field-desc-summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #555; user-select: none; padding: 2px 0; }
|
|
|
|
|
+ .field-desc-summary:hover { color: #1976d2; }
|
|
|
|
|
+ .curl-example { background: #1e1e1e; color: #dcdcaa; padding: 12px 14px; border-radius: 4px; font-family: Consolas, Monaco, 'Courier New', monospace; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0 0; line-height: 1.6; }
|
|
|
|
|
+
|
|
|
.summary-bar { display: flex; gap: 16px; padding: 12px 16px; background: white; border-radius: 8px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); align-items: center; flex-wrap: wrap; }
|
|
.summary-bar { display: flex; gap: 16px; padding: 12px 16px; background: white; border-radius: 8px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); align-items: center; flex-wrap: wrap; }
|
|
|
.summary-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
|
|
.summary-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
|
|
|
.summary-count { font-weight: 700; font-size: 20px; }
|
|
.summary-count { font-weight: 700; font-size: 20px; }
|
|
@@ -460,7 +465,7 @@ const FIELD_DESC = {
|
|
|
'checkinStatus': [
|
|
'checkinStatus': [
|
|
|
['data.checkedToday', 'Boolean', '今日是否已签到'],
|
|
['data.checkedToday', 'Boolean', '今日是否已签到'],
|
|
|
['data.continuousDays', 'Integer', '当前连续签到天数(今日未签到时为若签到将达成的天数-1)'],
|
|
['data.continuousDays', 'Integer', '当前连续签到天数(今日未签到时为若签到将达成的天数-1)'],
|
|
|
- ['data.todayReward', 'Integer', '今日签到可获奖励数量'],
|
|
|
|
|
|
|
+ ['data.todayReward', 'Integer', '今日签到可获会员天数'],
|
|
|
['data.nextCheckinDate', 'Date', '下一次可签到日期(今日未签到=今天)'],
|
|
['data.nextCheckinDate', 'Date', '下一次可签到日期(今日未签到=今天)'],
|
|
|
['data.enabled', 'Boolean', '签到功能是否启用']
|
|
['data.enabled', 'Boolean', '签到功能是否启用']
|
|
|
],
|
|
],
|
|
@@ -468,8 +473,8 @@ const FIELD_DESC = {
|
|
|
['data.id', 'Long', '签到记录ID'],
|
|
['data.id', 'Long', '签到记录ID'],
|
|
|
['data.checkinDate', 'Date', '签到日期'],
|
|
['data.checkinDate', 'Date', '签到日期'],
|
|
|
['data.continuousDays', 'Integer', '签到时连续天数'],
|
|
['data.continuousDays', 'Integer', '签到时连续天数'],
|
|
|
- ['data.rewardAmount', 'Integer', '本次奖励数量(爬虫次数)'],
|
|
|
|
|
- ['data.rewardType', 'String', '奖励类型(CRAWLER)'],
|
|
|
|
|
|
|
+ ['data.rewardAmount', 'Integer', '本次奖励会员天数'],
|
|
|
|
|
+ ['data.rewardType', 'String', '奖励类型(MEMBERSHIP)'],
|
|
|
['data.createTime', 'DateTime', '签到时间']
|
|
['data.createTime', 'DateTime', '签到时间']
|
|
|
],
|
|
],
|
|
|
'checkinCalendar': [
|
|
'checkinCalendar': [
|
|
@@ -482,12 +487,11 @@ const FIELD_DESC = {
|
|
|
'checkinConfig': [
|
|
'checkinConfig': [
|
|
|
['data.id', 'Long', '配置ID(固定1)'],
|
|
['data.id', 'Long', '配置ID(固定1)'],
|
|
|
['data.enabled', 'Integer', '是否启用:0-停用 1-启用'],
|
|
['data.enabled', 'Integer', '是否启用:0-停用 1-启用'],
|
|
|
- ['data.rewardType', 'String', '奖励类型(CRAWLER)'],
|
|
|
|
|
- ['data.baseReward', 'Integer', '基础签到奖励(每日)'],
|
|
|
|
|
- ['data.continuousReward', 'Integer', '连续签到额外奖励'],
|
|
|
|
|
- ['data.continuousThreshold', 'Integer', '连续奖励触发阈值(天)'],
|
|
|
|
|
- ['data.continuousCap', 'Integer', '连续奖励累计上限'],
|
|
|
|
|
- ['data.rewardExpireDays', 'Integer', '奖励有效天数(null=永久)'],
|
|
|
|
|
|
|
+ ['data.rewardType', 'String', '奖励类型(MEMBERSHIP-会员天数)'],
|
|
|
|
|
+ ['data.baseReward', 'Integer', '基础会员天数(每日)'],
|
|
|
|
|
+ ['data.continuousReward', 'Integer', '连续签到额外会员天数'],
|
|
|
|
|
+ ['data.continuousThreshold', 'Integer', '连续额外触发阈值(天)'],
|
|
|
|
|
+ ['data.continuousCap', 'Integer', '连续额外累计上限(天)'],
|
|
|
['data.remark', 'String', '备注'],
|
|
['data.remark', 'String', '备注'],
|
|
|
['data.createTime', 'DateTime', '创建时间'],
|
|
['data.createTime', 'DateTime', '创建时间'],
|
|
|
['data.updateTime', 'DateTime', '更新时间']
|
|
['data.updateTime', 'DateTime', '更新时间']
|
|
@@ -499,7 +503,7 @@ const FIELD_DESC = {
|
|
|
['data.last30DaysCount', 'Long', '近30天签到人数(去重)'],
|
|
['data.last30DaysCount', 'Long', '近30天签到人数(去重)'],
|
|
|
['data.totalCheckinCount', 'Long', '累计签到总次数'],
|
|
['data.totalCheckinCount', 'Long', '累计签到总次数'],
|
|
|
['data.totalCheckinUsers', 'Long', '累计签到用户数(去重)'],
|
|
['data.totalCheckinUsers', 'Long', '累计签到用户数(去重)'],
|
|
|
- ['data.totalRewardAmount', 'Long', '累计发放奖励次数总和'],
|
|
|
|
|
|
|
+ ['data.totalRewardAmount', 'Long', '累计发放会员天数总和'],
|
|
|
['data.statDate', 'Date', '统计日期'],
|
|
['data.statDate', 'Date', '统计日期'],
|
|
|
['data.enabled', 'Boolean', '签到功能是否启用']
|
|
['data.enabled', 'Boolean', '签到功能是否启用']
|
|
|
],
|
|
],
|
|
@@ -512,14 +516,113 @@ const FIELD_DESC = {
|
|
|
['data.records[].checkinDate', 'Date', '签到日期'],
|
|
['data.records[].checkinDate', 'Date', '签到日期'],
|
|
|
['data.records[].continuousDays', 'Integer', '签到时连续天数'],
|
|
['data.records[].continuousDays', 'Integer', '签到时连续天数'],
|
|
|
['data.records[].rewardType', 'String', '奖励类型'],
|
|
['data.records[].rewardType', 'String', '奖励类型'],
|
|
|
- ['data.records[].rewardAmount', 'Integer', '本次奖励数量'],
|
|
|
|
|
- ['data.records[].grantId', 'Long', '关联配额发放记录ID'],
|
|
|
|
|
|
|
+ ['data.records[].rewardAmount', 'Integer', '本次奖励会员天数'],
|
|
|
['data.records[].clientSource', 'String', '签到端'],
|
|
['data.records[].clientSource', 'String', '签到端'],
|
|
|
['data.records[].createTime', 'DateTime', '签到时间'],
|
|
['data.records[].createTime', 'DateTime', '签到时间'],
|
|
|
['data.total', 'Long', '总记录数'],
|
|
['data.total', 'Long', '总记录数'],
|
|
|
['data.current', 'Long', '当前页'],
|
|
['data.current', 'Long', '当前页'],
|
|
|
['data.size', 'Long', '每页条数'],
|
|
['data.size', 'Long', '每页条数'],
|
|
|
['data.pages', 'Long', '总页数']
|
|
['data.pages', 'Long', '总页数']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'activityInviteStatus': [
|
|
|
|
|
+ ['data.enabled', 'Boolean', '活动是否启用'],
|
|
|
|
|
+ ['data.inWindow', 'Boolean', '是否在活动时间窗内'],
|
|
|
|
|
+ ['data.rewardedCount', 'Long', '已获奖励次数'],
|
|
|
|
|
+ ['data.maxInviterReward', 'Integer', '邀请人最多奖励次数'],
|
|
|
|
|
+ ['data.remainingCount', 'Long', '剩余可获奖励次数']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'activityCheckinStatus': [
|
|
|
|
|
+ ['data.enabled', 'Boolean', '活动是否启用'],
|
|
|
|
|
+ ['data.inWindow', 'Boolean', '是否在活动时间窗内'],
|
|
|
|
|
+ ['data.currentCycleStart', 'Date', '当前周期起始日(周五)'],
|
|
|
|
|
+ ['data.currentCycleEnd', 'Date', '当前周期截止日(下周四)'],
|
|
|
|
|
+ ['data.currentCycleCheckinCount', 'Integer', '当前周期内已签到天数'],
|
|
|
|
|
+ ['data.requiredDays', 'Integer', '达标所需签到天数'],
|
|
|
|
|
+ ['data.reachedTarget', 'Boolean', '当前周期是否已达标'],
|
|
|
|
|
+ ['data.rewardDays', 'Integer', '达标后可获会员天数'],
|
|
|
|
|
+ ['data.rewardedCount', 'Long', '已领取奖励次数'],
|
|
|
|
|
+ ['data.maxRewardCount', 'Integer', '最多可领取奖励次数'],
|
|
|
|
|
+ ['data.remainingCount', 'Long', '剩余可领取奖励次数']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'activityLotteryStatus': [
|
|
|
|
|
+ ['data.enabled', 'Boolean', '活动是否启用'],
|
|
|
|
|
+ ['data.inWindow', 'Boolean', '是否在活动时间窗内'],
|
|
|
|
|
+ ['data.eligible', 'Boolean', '是否满足参与资格(会员等级)'],
|
|
|
|
|
+ ['data.membershipLevel', 'String', '当前用户会员等级'],
|
|
|
|
|
+ ['data.requireMembershipLevel', 'String', '所需会员等级'],
|
|
|
|
|
+ ['data.availableChances', 'Integer', '今日可用抽奖机会数'],
|
|
|
|
|
+ ['data.usedChances', 'Integer', '今日已用抽奖机会数']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'activityLotteryPrizes': [
|
|
|
|
|
+ ['data[].id', 'Long', '奖品ID'],
|
|
|
|
|
+ ['data[].name', 'String', '奖品名称'],
|
|
|
|
|
+ ['data[].rewardType', 'String', '奖励类型(MEMBERSHIP会员/CRAWLER爬虫次数/EMPTY谢谢参与)'],
|
|
|
|
|
+ ['data[].rewardDays', 'Integer', '会员奖励天数'],
|
|
|
|
|
+ ['data[].rewardLevel', 'String', '会员奖励等级(PRO/ULTRA)'],
|
|
|
|
|
+ ['data[].rewardAmount', 'Integer', '爬虫奖励次数(CRAWLER类型时有效,暂未实现)'],
|
|
|
|
|
+ ['data[].sort', 'Integer', '排序']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'activityLotteryDraw': [
|
|
|
|
|
+ ['data.recordId', 'Long', '抽奖记录ID'],
|
|
|
|
|
+ ['data.prizeName', 'String', '奖品名称'],
|
|
|
|
|
+ ['data.rewardType', 'String', '奖励类型(MEMBERSHIP会员/CRAWLER爬虫次数/EMPTY谢谢参与)'],
|
|
|
|
|
+ ['data.rewardAmount', 'Integer', '奖励数量(预留)'],
|
|
|
|
|
+ ['data.rewardDays', 'Integer', '会员奖励天数'],
|
|
|
|
|
+ ['data.rewardLevel', 'String', '会员奖励等级(PRO/ULTRA)'],
|
|
|
|
|
+ ['data.win', 'Boolean', '是否中奖(EMPTY=未中奖)'],
|
|
|
|
|
+ ['data.createTime', 'DateTime', '抽奖时间']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'adminActivityInviteConfig': [
|
|
|
|
|
+ ['data.id', 'Long', '配置ID(固定1)'],
|
|
|
|
|
+ ['data.enabled', 'Integer', '是否启用:0-停用 1-启用'],
|
|
|
|
|
+ ['data.startTime', 'DateTime', '活动开始时间'],
|
|
|
|
|
+ ['data.endTime', 'DateTime', '活动结束时间'],
|
|
|
|
|
+ ['data.inviterRewardDays', 'Integer', '邀请人奖励天数'],
|
|
|
|
|
+ ['data.inviteeRewardDays', 'Integer', '被邀请人奖励天数'],
|
|
|
|
|
+ ['data.maxInviterReward', 'Integer', '邀请人最多奖励次数'],
|
|
|
|
|
+ ['data.rewardTrigger', 'String', '奖励触发模式(REGISTRATION/LICENSE_APPROVED)'],
|
|
|
|
|
+ ['data.requireMiniappInviter', 'Integer', '是否要求邀请人为小程序用户:0-否 1-是'],
|
|
|
|
|
+ ['data.remark', 'String', '备注'],
|
|
|
|
|
+ ['data.createTime', 'DateTime', '创建时间'],
|
|
|
|
|
+ ['data.updateTime', 'DateTime', '更新时间']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'adminActivityInviteRevoke': [
|
|
|
|
|
+ ['data', 'Integer', '撤销的奖励记录数']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'adminActivityCheckinConfig': [
|
|
|
|
|
+ ['data.id', 'Long', '配置ID(固定1)'],
|
|
|
|
|
+ ['data.enabled', 'Integer', '是否启用:0-停用 1-启用'],
|
|
|
|
|
+ ['data.startTime', 'DateTime', '活动开始时间'],
|
|
|
|
|
+ ['data.endTime', 'DateTime', '活动结束时间'],
|
|
|
|
|
+ ['data.cycleMode', 'String', '周期模式(FRI_THU=周五至下周四)'],
|
|
|
|
|
+ ['data.requiredDays', 'Integer', '达标所需签到天数'],
|
|
|
|
|
+ ['data.rewardDays', 'Integer', '达标奖励会员天数'],
|
|
|
|
|
+ ['data.maxRewardCount', 'Integer', '每人最多可领取奖励次数'],
|
|
|
|
|
+ ['data.remark', 'String', '备注'],
|
|
|
|
|
+ ['data.createTime', 'DateTime', '创建时间'],
|
|
|
|
|
+ ['data.updateTime', 'DateTime', '更新时间']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'adminActivityLotteryConfig': [
|
|
|
|
|
+ ['data.id', 'Long', '配置ID(固定1)'],
|
|
|
|
|
+ ['data.enabled', 'Integer', '是否启用:0-停用 1-启用'],
|
|
|
|
|
+ ['data.startTime', 'DateTime', '活动开始时间'],
|
|
|
|
|
+ ['data.endTime', 'DateTime', '活动结束时间'],
|
|
|
|
|
+ ['data.dailyMaxChance', 'Integer', '每个自然日最多获得抽奖机会数'],
|
|
|
|
|
+ ['data.requireMembershipLevel', 'String', '参与所需会员等级(PRO/ULTRA/PLUS)'],
|
|
|
|
|
+ ['data.remark', 'String', '备注'],
|
|
|
|
|
+ ['data.createTime', 'DateTime', '创建时间'],
|
|
|
|
|
+ ['data.updateTime', 'DateTime', '更新时间']
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'adminActivityLotteryPrize': [
|
|
|
|
|
+ ['data.id', 'Long', '奖品ID'],
|
|
|
|
|
+ ['data.name', 'String', '奖品名称'],
|
|
|
|
|
+ ['data.rewardType', 'String', '奖励类型(MEMBERSHIP会员/CRAWLER爬虫次数/EMPTY谢谢参与)'],
|
|
|
|
|
+ ['data.rewardAmount', 'Integer', '奖励数量(预留)'],
|
|
|
|
|
+ ['data.rewardDays', 'Integer', '会员奖励天数'],
|
|
|
|
|
+ ['data.rewardLevel', 'String', '会员奖励等级'],
|
|
|
|
|
+ ['data.probabilityWeight', 'Integer', '中奖概率权重(越大越容易中)'],
|
|
|
|
|
+ ['data.enabled', 'Integer', '是否启用:0-停用 1-启用'],
|
|
|
|
|
+ ['data.sort', 'Integer', '排序(数字越小越靠前)']
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -527,10 +630,35 @@ function renderFieldDesc(descKey) {
|
|
|
const fields = FIELD_DESC[descKey];
|
|
const fields = FIELD_DESC[descKey];
|
|
|
if (!fields) return '';
|
|
if (!fields) return '';
|
|
|
let rows = fields.map(f => `<tr><td><code>${f[0]}</code></td><td>${f[1]}</td><td>${f[2]}</td></tr>`).join('');
|
|
let rows = fields.map(f => `<tr><td><code>${f[0]}</code></td><td>${f[1]}</td><td>${f[2]}</td></tr>`).join('');
|
|
|
- return `<div class="field-desc-box">
|
|
|
|
|
- <div class="field-desc-title">返回字段说明</div>
|
|
|
|
|
|
|
+ return `<details open class="field-desc-details">
|
|
|
|
|
+ <summary class="field-desc-summary">📋 返回字段说明</summary>
|
|
|
<table class="field-desc-table"><tr><th>字段名</th><th>类型</th><th>说明</th></tr>${rows}</table>
|
|
<table class="field-desc-table"><tr><th>字段名</th><th>类型</th><th>说明</th></tr>${rows}</table>
|
|
|
- </div>`;
|
|
|
|
|
|
|
+ </details>`;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// ==================== 调用示例生成 ====================
|
|
|
|
|
+function renderCurlExample(id, method, path, fields) {
|
|
|
|
|
+ const methodUpper = method.toUpperCase();
|
|
|
|
|
+ const baseUrl = document.getElementById('baseUrl').value;
|
|
|
|
|
+ let curl = `curl -X ${methodUpper} "${baseUrl}${path}"`;
|
|
|
|
|
+ curl += ` \\\n -H "Authorization: Bearer \${TOKEN}"`;
|
|
|
|
|
+ if (methodUpper === 'POST' || methodUpper === 'PUT') {
|
|
|
|
|
+ curl += ` \\\n -H "Content-Type: application/json"`;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (fields && fields.length > 0) {
|
|
|
|
|
+ let bodyParts = [];
|
|
|
|
|
+ fields.forEach(f => {
|
|
|
|
|
+ let val = f.default || f.placeholder || '';
|
|
|
|
|
+ bodyParts.push(`"${f.name}": "${val}"`);
|
|
|
|
|
+ });
|
|
|
|
|
+ if (bodyParts.length > 0) {
|
|
|
|
|
+ curl += ` \\\n -d '{${bodyParts.join(', ')}}'`;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return `<details class="field-desc-details">
|
|
|
|
|
+ <summary class="field-desc-summary">📞 cURL 调用示例</summary>
|
|
|
|
|
+ <pre class="curl-example">${curl}</pre>
|
|
|
|
|
+ </details>`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ==================== 测试用例区块渲染 ====================
|
|
// ==================== 测试用例区块渲染 ====================
|
|
@@ -553,6 +681,7 @@ function testSection(id, title, method, methodClass, path, authTag, authClass, f
|
|
|
}
|
|
}
|
|
|
const descHtml = desc ? `<div class="section-desc">${desc}</div>` : '';
|
|
const descHtml = desc ? `<div class="section-desc">${desc}</div>` : '';
|
|
|
const fieldDescHtml = descKey ? renderFieldDesc(descKey) : '';
|
|
const fieldDescHtml = descKey ? renderFieldDesc(descKey) : '';
|
|
|
|
|
+ const curlHtml = renderCurlExample(id, method, path, fields);
|
|
|
return `
|
|
return `
|
|
|
<div class="test-section">
|
|
<div class="test-section">
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
@@ -562,6 +691,8 @@ function testSection(id, title, method, methodClass, path, authTag, authClass, f
|
|
|
<span class="${ac} auth-tag">${authLabel}</span>
|
|
<span class="${ac} auth-tag">${authLabel}</span>
|
|
|
</div>
|
|
</div>
|
|
|
${descHtml}
|
|
${descHtml}
|
|
|
|
|
+ ${curlHtml}
|
|
|
|
|
+ ${fieldDescHtml}
|
|
|
${fieldsHtml}
|
|
${fieldsHtml}
|
|
|
<button class="btn btn-primary" onclick="runTest('${id}', '${method}', '${path}', ${buildBody(id, fields)}, ${authTag === '公开' ? 'false' : 'true'}, ${hasValidator ? `'${toValidatorName(id)}'` : 'null'})">执行测试</button>
|
|
<button class="btn btn-primary" onclick="runTest('${id}', '${method}', '${path}', ${buildBody(id, fields)}, ${authTag === '公开' ? 'false' : 'true'}, ${hasValidator ? `'${toValidatorName(id)}'` : 'null'})">执行测试</button>
|
|
|
<div class="response-box" id="${id}-box" style="display:none;">
|
|
<div class="response-box" id="${id}-box" style="display:none;">
|
|
@@ -570,7 +701,6 @@ function testSection(id, title, method, methodClass, path, authTag, authClass, f
|
|
|
<span class="status-badge" id="${id}-status"></span>
|
|
<span class="status-badge" id="${id}-status"></span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="response-content" id="${id}-raw"></div>
|
|
<div class="response-content" id="${id}-raw"></div>
|
|
|
- ${fieldDescHtml}
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>`;
|
|
</div>`;
|
|
|
}
|
|
}
|
|
@@ -618,9 +748,9 @@ function renderCheckinModule() {
|
|
|
<div class="batch-buttons">
|
|
<div class="batch-buttons">
|
|
|
<button class="btn btn-warning btn-sm" onclick="runCheckinTests()">运行全部签到测试</button>
|
|
<button class="btn btn-warning btn-sm" onclick="runCheckinTests()">运行全部签到测试</button>
|
|
|
</div>
|
|
</div>
|
|
|
- ${testSection('checkin-status', '今日签到状态', 'GET', 'get', '/api/checkin/status', '需认证', 'auth-required', null, true, 'checkinStatus', '获取当前用户今日签到状态、连续天数、可获奖励')}
|
|
|
|
|
|
|
+ ${testSection('checkin-status', '今日签到状态', 'GET', 'get', '/api/checkin/status', '需认证', 'auth-required', null, true, 'checkinStatus', '获取当前用户今日签到状态、连续天数、可获会员天数')}
|
|
|
${testSection('checkin-do', '执行签到', 'POST', 'post', '/api/checkin', '需认证', 'auth-required',
|
|
${testSection('checkin-do', '执行签到', 'POST', 'post', '/api/checkin', '需认证', 'auth-required',
|
|
|
- [{label:'签到端(clientSource,可选)', name:'clientSource', placeholder:'WINDOWS/ANDROID/MINIAPP', default:'WINDOWS'}], true, 'checkinResult', '执行当日签到,发放爬虫次数奖励。每个自然日仅可签到一次')}
|
|
|
|
|
|
|
+ [{label:'签到端(clientSource,可选)', name:'clientSource', placeholder:'WINDOWS/ANDROID/MINIAPP', default:'WINDOWS'}], true, 'checkinResult', '执行当日签到,发放高级会员天数奖励。每个自然日仅可签到一次')}
|
|
|
${testSection('checkin-calendar', '当月签到日历', 'GET', 'get', '/api/checkin/calendar?year=2026&month=7', '需认证', 'auth-required',
|
|
${testSection('checkin-calendar', '当月签到日历', 'GET', 'get', '/api/checkin/calendar?year=2026&month=7', '需认证', 'auth-required',
|
|
|
[{label:'年份(year,可选)', name:'year', placeholder:'2026', default:'2026'},
|
|
[{label:'年份(year,可选)', name:'year', placeholder:'2026', default:'2026'},
|
|
|
{label:'月份(month,可选)', name:'month', placeholder:'7', default:'7'}], true, 'checkinCalendar', '获取指定月份的签到日历,不传默认当月')}
|
|
{label:'月份(month,可选)', name:'month', placeholder:'7', default:'7'}], true, 'checkinCalendar', '获取指定月份的签到日历,不传默认当月')}
|
|
@@ -652,6 +782,7 @@ function renderActivityLotteryModule() {
|
|
|
<div class="batch-buttons">
|
|
<div class="batch-buttons">
|
|
|
<button class="btn btn-warning btn-sm" onclick="runActivityLotteryTests()">运行全部比价抽奖测试</button>
|
|
<button class="btn btn-warning btn-sm" onclick="runActivityLotteryTests()">运行全部比价抽奖测试</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ ${testSection('activity-lottery-prizes', '奖励信息(可抽奖品列表)', 'GET', 'get', '/api/activity/lottery/prizes', '需认证', 'auth-required', null, true, 'activityLotteryPrizes', '查看当前可抽奖品列表(仅启用奖品,不显示概率权重等敏感信息)')}
|
|
|
${testSection('activity-lottery-status', '比价抽奖活动状态', 'GET', 'get', '/api/activity/lottery/status', '需认证', 'auth-required', null, true, 'activityLotteryStatus', '查询抽奖活动状态:是否开启、是否满足资格、今日可用机会')}
|
|
${testSection('activity-lottery-status', '比价抽奖活动状态', 'GET', 'get', '/api/activity/lottery/status', '需认证', 'auth-required', null, true, 'activityLotteryStatus', '查询抽奖活动状态:是否开启、是否满足资格、今日可用机会')}
|
|
|
${testSection('activity-lottery-draw', '执行抽奖', 'POST', 'post', '/api/activity/lottery/draw', '需认证', 'auth-required', null, true, 'activityLotteryDraw', '消耗一次抽奖机会,随机抽取奖品(会员/爬虫次数/谢谢参与)')}
|
|
${testSection('activity-lottery-draw', '执行抽奖', 'POST', 'post', '/api/activity/lottery/draw', '需认证', 'auth-required', null, true, 'activityLotteryDraw', '消耗一次抽奖机会,随机抽取奖品(会员/爬虫次数/谢谢参与)')}
|
|
|
${testSection('activity-lottery-records', '我的抽奖记录', 'GET', 'get', '/api/activity/lottery/records?limit=20', '需认证', 'auth-required',
|
|
${testSection('activity-lottery-records', '我的抽奖记录', 'GET', 'get', '/api/activity/lottery/records?limit=20', '需认证', 'auth-required',
|
|
@@ -668,14 +799,12 @@ function renderAdminCheckinModule() {
|
|
|
${testSection('admin-checkin-config-update', '更新签到配置', 'PUT', 'put', '/api/admin/checkin/config', '需认证', 'auth-required',
|
|
${testSection('admin-checkin-config-update', '更新签到配置', 'PUT', 'put', '/api/admin/checkin/config', '需认证', 'auth-required',
|
|
|
[
|
|
[
|
|
|
{label:'启用(enabled)', name:'enabled', placeholder:'0停用/1启用', default:'1'},
|
|
{label:'启用(enabled)', name:'enabled', placeholder:'0停用/1启用', default:'1'},
|
|
|
- {label:'奖励类型(rewardType)', name:'rewardType', placeholder:'CRAWLER', default:'CRAWLER'},
|
|
|
|
|
- {label:'基础奖励(baseReward)', name:'baseReward', placeholder:'1', default:'1'},
|
|
|
|
|
- {label:'连续奖励(continuousReward)', name:'continuousReward', placeholder:'1', default:'1'},
|
|
|
|
|
|
|
+ {label:'基础会员天数(baseReward)', name:'baseReward', placeholder:'1', default:'1'},
|
|
|
|
|
+ {label:'连续额外天数(continuousReward)', name:'continuousReward', placeholder:'1', default:'1'},
|
|
|
{label:'连续阈值(continuousThreshold)', name:'continuousThreshold', placeholder:'7', default:'7'},
|
|
{label:'连续阈值(continuousThreshold)', name:'continuousThreshold', placeholder:'7', default:'7'},
|
|
|
- {label:'连续上限(continuousCap)', name:'continuousCap', placeholder:'30', default:'30'},
|
|
|
|
|
- {label:'有效天数(rewardExpireDays)', name:'rewardExpireDays', placeholder:'30', default:'30'},
|
|
|
|
|
- {label:'备注(remark)', name:'remark', placeholder:'默认签到配置', default:'默认签到配置:每日1次,连续7天起每日额外+1'}
|
|
|
|
|
- ], true, 'checkinConfig', '更新签到规则配置。连续签到满阈值后每日额外发放continuousReward,累计不超过continuousCap')}
|
|
|
|
|
|
|
+ {label:'连续额外上限(continuousCap)', name:'continuousCap', placeholder:'30', default:'30'},
|
|
|
|
|
+ {label:'备注(remark)', name:'remark', placeholder:'默认签到配置', default:'默认签到配置:每日1天高级会员,连续7天起每日额外+1天'}
|
|
|
|
|
+ ], true, 'checkinConfig', '更新签到规则配置。连续签到满阈值后每日额外发放 continuousReward 天,累计不超过 continuousCap 天')}
|
|
|
${testSection('admin-checkin-stats', '签到统计概览', 'GET', 'get', '/api/admin/checkin/stats', '需认证', 'auth-required', null, true, 'checkinStats', '签到数据统计:今日/昨日/近7天/近30天签到人数、累计签到次数与用户数、累计发放奖励')}
|
|
${testSection('admin-checkin-stats', '签到统计概览', 'GET', 'get', '/api/admin/checkin/stats', '需认证', 'auth-required', null, true, 'checkinStats', '签到数据统计:今日/昨日/近7天/近30天签到人数、累计签到次数与用户数、累计发放奖励')}
|
|
|
${testSection('admin-checkin-records', '签到记录分页查询', 'GET', 'get', '/api/admin/checkin/records?page=1&size=10&userId=1&startDate=2026-07-01&endDate=2026-07-07&clientSource=WINDOWS', '需认证', 'auth-required',
|
|
${testSection('admin-checkin-records', '签到记录分页查询', 'GET', 'get', '/api/admin/checkin/records?page=1&size=10&userId=1&startDate=2026-07-01&endDate=2026-07-07&clientSource=WINDOWS', '需认证', 'auth-required',
|
|
|
[{label:'页码(page)', name:'page', placeholder:'1', default:'1'},
|
|
[{label:'页码(page)', name:'page', placeholder:'1', default:'1'},
|
|
@@ -753,26 +882,26 @@ function renderAdminActivityLotteryModule() {
|
|
|
${testSection('admin-activity-lottery-prizes', '奖品池列表', 'GET', 'get', '/api/admin/activity/lottery/prizes', '需认证', 'auth-required', null, true, null, '获取所有奖品及其权重配置')}
|
|
${testSection('admin-activity-lottery-prizes', '奖品池列表', 'GET', 'get', '/api/admin/activity/lottery/prizes', '需认证', 'auth-required', null, true, null, '获取所有奖品及其权重配置')}
|
|
|
${testSection('admin-activity-lottery-prize-create', '新增奖品', 'POST', 'post', '/api/admin/activity/lottery/prizes', '需认证', 'auth-required',
|
|
${testSection('admin-activity-lottery-prize-create', '新增奖品', 'POST', 'post', '/api/admin/activity/lottery/prizes', '需认证', 'auth-required',
|
|
|
[
|
|
[
|
|
|
- {label:'奖品名称(name)', name:'name', placeholder:'高级会员3天', default:'爬虫次数+10'},
|
|
|
|
|
- {label:'奖励类型(rewardType)', name:'rewardType', placeholder:'MEMBERSHIP/CRAWLER/EMPTY', default:'CRAWLER'},
|
|
|
|
|
- {label:'奖励数量(rewardAmount)', name:'rewardAmount', placeholder:'爬虫次数填数量', default:'10'},
|
|
|
|
|
- {label:'会员天数(rewardDays)', name:'rewardDays', placeholder:'MEMBERSHIP类型填', default:''},
|
|
|
|
|
- {label:'会员等级(rewardLevel)', name:'rewardLevel', placeholder:'PRO/ULTRA', default:''},
|
|
|
|
|
- {label:'概率权重(probabilityWeight)', name:'probabilityWeight', placeholder:'权重越大越容易中', default:'5'},
|
|
|
|
|
|
|
+ {label:'奖品名称(name)', name:'name', placeholder:'高级会员3天', default:'高级会员3天'},
|
|
|
|
|
+ {label:'奖励类型(rewardType)', name:'rewardType', placeholder:'MEMBERSHIP/CRAWLER/EMPTY', default:'MEMBERSHIP'},
|
|
|
|
|
+ {label:'会员天数(rewardDays)', name:'rewardDays', placeholder:'3', default:'3'},
|
|
|
|
|
+ {label:'会员等级(rewardLevel)', name:'rewardLevel', placeholder:'PRO/ULTRA', default:'PRO'},
|
|
|
|
|
+ {label:'爬虫次数(rewardAmount)', name:'rewardAmount', placeholder:'CRAWLER类型时填写', default:'0'},
|
|
|
|
|
+ {label:'概率权重(probabilityWeight)', name:'probabilityWeight', placeholder:'权重越大越容易中', default:'20'},
|
|
|
{label:'启用(enabled)', name:'enabled', placeholder:'0停用/1启用', default:'1'},
|
|
{label:'启用(enabled)', name:'enabled', placeholder:'0停用/1启用', default:'1'},
|
|
|
- {label:'排序(sort)', name:'sort', placeholder:'0', default:'6'}
|
|
|
|
|
- ], true, 'adminActivityLotteryPrize', '新增奖品到奖品池。rewardType: MEMBERSHIP会员/CRAWLER爬虫/EMPTY谢谢参与')}
|
|
|
|
|
|
|
+ {label:'排序(sort)', name:'sort', placeholder:'0', default:'3'}
|
|
|
|
|
+ ], true, 'adminActivityLotteryPrize', '新增奖品到奖品池。rewardType: MEMBERSHIP会员/CRAWLER爬虫次数(暂未实现)/EMPTY谢谢参与')}
|
|
|
${testSection('admin-activity-lottery-prize-update', '更新奖品', 'PUT', 'put', '/api/admin/activity/lottery/prizes/{id}', '需认证', 'auth-required',
|
|
${testSection('admin-activity-lottery-prize-update', '更新奖品', 'PUT', 'put', '/api/admin/activity/lottery/prizes/{id}', '需认证', 'auth-required',
|
|
|
[
|
|
[
|
|
|
{label:'奖品ID(id)', name:'id', placeholder:'1', default:''},
|
|
{label:'奖品ID(id)', name:'id', placeholder:'1', default:''},
|
|
|
- {label:'奖品名称(name)', name:'name', placeholder:'高级会员3天', default:'爬虫次数+10'},
|
|
|
|
|
- {label:'奖励类型(rewardType)', name:'rewardType', placeholder:'MEMBERSHIP/CRAWLER/EMPTY', default:'CRAWLER'},
|
|
|
|
|
- {label:'奖励数量(rewardAmount)', name:'rewardAmount', placeholder:'爬虫次数填数量', default:'10'},
|
|
|
|
|
- {label:'会员天数(rewardDays)', name:'rewardDays', placeholder:'MEMBERSHIP类型填', default:''},
|
|
|
|
|
- {label:'会员等级(rewardLevel)', name:'rewardLevel', placeholder:'PRO/ULTRA', default:''},
|
|
|
|
|
- {label:'概率权重(probabilityWeight)', name:'probabilityWeight', placeholder:'权重越大越容易中', default:'5'},
|
|
|
|
|
|
|
+ {label:'奖品名称(name)', name:'name', placeholder:'高级会员3天', default:'高级会员3天'},
|
|
|
|
|
+ {label:'奖励类型(rewardType)', name:'rewardType', placeholder:'MEMBERSHIP/CRAWLER/EMPTY', default:'MEMBERSHIP'},
|
|
|
|
|
+ {label:'会员天数(rewardDays)', name:'rewardDays', placeholder:'3', default:'3'},
|
|
|
|
|
+ {label:'会员等级(rewardLevel)', name:'rewardLevel', placeholder:'PRO/ULTRA', default:'PRO'},
|
|
|
|
|
+ {label:'爬虫次数(rewardAmount)', name:'rewardAmount', placeholder:'CRAWLER类型时填写', default:'0'},
|
|
|
|
|
+ {label:'概率权重(probabilityWeight)', name:'probabilityWeight', placeholder:'权重越大越容易中', default:'20'},
|
|
|
{label:'启用(enabled)', name:'enabled', placeholder:'0停用/1启用', default:'1'},
|
|
{label:'启用(enabled)', name:'enabled', placeholder:'0停用/1启用', default:'1'},
|
|
|
- {label:'排序(sort)', name:'sort', placeholder:'0', default:'6'}
|
|
|
|
|
|
|
+ {label:'排序(sort)', name:'sort', placeholder:'0', default:'3'}
|
|
|
], true, 'adminActivityLotteryPrize', '更新奖品池中的奖品配置')}
|
|
], true, 'adminActivityLotteryPrize', '更新奖品池中的奖品配置')}
|
|
|
${testSection('admin-activity-lottery-prize-delete', '删除奖品', 'DELETE', 'delete', '/api/admin/activity/lottery/prizes/{id}', '需认证', 'auth-required',
|
|
${testSection('admin-activity-lottery-prize-delete', '删除奖品', 'DELETE', 'delete', '/api/admin/activity/lottery/prizes/{id}', '需认证', 'auth-required',
|
|
|
[{label:'奖品ID(id)', name:'id', placeholder:'需删除的奖品ID', default:''}], true, null, '从奖品池中删除指定奖品')}`;
|
|
[{label:'奖品ID(id)', name:'id', placeholder:'需删除的奖品ID', default:''}], true, null, '从奖品池中删除指定奖品')}`;
|
|
@@ -896,9 +1025,10 @@ function validate_adminCheckinStats(result) { return result.data?.code === 200 &
|
|
|
function validate_adminCheckinRecords(result) { return result.data?.code === 200 && result.data?.data?.records !== undefined; }
|
|
function validate_adminCheckinRecords(result) { return result.data?.code === 200 && result.data?.data?.records !== undefined; }
|
|
|
function validate_adminCheckinUserRecords(result) { return result.data?.code === 200 && Array.isArray(result.data?.data); }
|
|
function validate_adminCheckinUserRecords(result) { return result.data?.code === 200 && Array.isArray(result.data?.data); }
|
|
|
|
|
|
|
|
-function validate_activityInviteStatus(result) { return result.data?.code === 200 && result.data?.data?.active !== undefined; }
|
|
|
|
|
-function validate_activityCheckinStatus(result) { return result.data?.code === 200 && result.data?.data?.active !== undefined; }
|
|
|
|
|
-function validate_activityLotteryStatus(result) { return result.data?.code === 200 && result.data?.data?.active !== undefined; }
|
|
|
|
|
|
|
+function validate_activityInviteStatus(result) { return result.data?.code === 200 && result.data?.data?.enabled !== undefined; }
|
|
|
|
|
+function validate_activityCheckinStatus(result) { return result.data?.code === 200 && result.data?.data?.enabled !== undefined; }
|
|
|
|
|
+function validate_activityLotteryStatus(result) { return result.data?.code === 200 && result.data?.data?.enabled !== undefined; }
|
|
|
|
|
+function validate_activityLotteryPrizes(result) { return result.data?.code === 200 && Array.isArray(result.data?.data); }
|
|
|
function validate_activityLotteryDraw(result) { return result.data?.code === 200 && result.data?.data?.prizeName !== undefined; }
|
|
function validate_activityLotteryDraw(result) { return result.data?.code === 200 && result.data?.data?.prizeName !== undefined; }
|
|
|
function validate_adminActivityInviteConfig(result) { return result.data?.code === 200 && result.data?.data?.id; }
|
|
function validate_adminActivityInviteConfig(result) { return result.data?.code === 200 && result.data?.data?.id; }
|
|
|
function validate_adminActivityInviteRevoke(result) { return result.data?.code === 200 && result.data?.data !== undefined; }
|
|
function validate_adminActivityInviteRevoke(result) { return result.data?.code === 200 && result.data?.data !== undefined; }
|