feat(api): 完善家谱系统API客户端契约

- 实现家谱管理相关方法,包括创建、详情、概览、我的家谱和选项查询
- 添加家谱加入申请功能,支持申请、审核、取消和待审核列表操作
- 集成通知详情获取方法和通知ID安全验证机制
- 完善功德记录、谱文、相册、视频、祭祀活动的完整CRUD操作契约
- 实现家谱成员管理功能,包含成员列表、更新、移除和转让所有者操作
- 优化路径ID验证逻辑,拒绝不安全的数值ID并提供明确错误提示
- 更新测试用例以验证所有新增API方法的路径和请求体白名单机制
This commit is contained in:
fizzleaf
2026-07-29 16:57:27 +08:00
parent 59a72fb22b
commit fb1743aa2a
74 changed files with 13166 additions and 1320 deletions
+37 -48
View File
@@ -3,25 +3,26 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>添加功德人 - 个人中心 - 代代相传</title>
<title>新增功德记录 - 个人中心 - 代代相传</title>
<link rel="stylesheet" href="public/css/public.css" />
<link rel="stylesheet" href="public/layui/css/layui.css" />
<link rel="stylesheet" href="public/css/profile-module.css" />
<link rel="stylesheet" href="public/js/wangeditor5/css/style.css" />
</head>
<body class="page-profile-module" data-merit-edit-page data-feature-status="pending" data-feature-message="功德录服务正在开发中,当前页面仅保留设计预览。">
<body class="page-profile-module" data-merit-edit-page>
<header class="site-header">
<div class="container nav">
<a class="brand magnetic" href="profile.html"
><img class="brand-logo brand-logo-mark" src="public/images/logo-mark.png" alt="" /><span class="brand-text">个人中心</span></a
>
<a class="brand magnetic" href="profile.html">
<img class="brand-logo brand-logo-mark" src="public/images/logo-mark.png" alt="" />
<span class="brand-text">个人中心</span>
</a>
<nav class="nav-links">
<a href="profile-content.html">内容发布</a
><a class="active" href="profile-merit.html">功德录</a>
<a href="profile-content.html">内容发布</a>
<a class="active" href="profile-merit.html" data-genealogy-context-link>功德录</a>
</nav>
<div class="nav-actions">
<a href="profile-merit.html">返回功德录</a
><button class="btn primary magnetic" type="submit" form="merit-edit-form">保存</button>
<a href="profile-merit.html" data-genealogy-context-link>返回功德录</a>
<button class="btn primary magnetic" type="submit" form="merit-edit-form" data-merit-editor-action hidden>保存</button>
</div>
</div>
</header>
@@ -31,10 +32,8 @@
<div class="module-kicker">Merit Editor</div>
<div class="module-title-row">
<div>
<h1>添加功德人</h1>
<p>
记录功德人姓名、事迹、时间和图片资料,正文使用富文本编辑器。
</p>
<h1 data-merit-editor-title>新增功德记录</h1>
<p>功德类型严格使用 PC 契约枚举,金额按后端未限定的数值规则提交。</p>
</div>
</div>
</div>
@@ -42,34 +41,23 @@
<section class="section">
<div class="container module-layout">
<aside class="module-nav">
<a href="profile-content.html">内容发布</a
><a class="active" href="profile-merit.html">功德录</a
><a href="profile-gift.html">贺礼邀请</a
><a href="profile-growth.html">成长日志</a>
<a href="profile-content.html">内容发布</a>
<a class="active" href="profile-merit.html" data-genealogy-context-link>功德录</a>
<a href="profile-gift.html" data-genealogy-context-link>贺礼邀请</a>
<a href="profile-growth.html" data-genealogy-context-link>成长日志</a>
</aside>
<div class="module-main">
<section class="module-panel">
<h2>功德资料</h2>
<form id="merit-edit-form" class="editor-form layui-form" data-merit-form>
<form id="merit-edit-form" class="editor-form" data-merit-form data-merit-editor hidden>
<div class="editor-two">
<div class="editor-field">
<label for="meritName">姓名</label
><input
id="meritName"
name="donorName"
type="text"
placeholder="请输入姓名"
required
/>
<label for="meritName">功德人姓名</label>
<input id="meritName" name="donorName" type="text" placeholder="请输入功德人姓名" required />
</div>
<div class="editor-field">
<label for="meritDate">日期</label
><input
id="meritDate"
name="meritTime"
type="text"
placeholder="请选择日期"
/>
<label for="meritTime">功德时间</label>
<input id="meritTime" name="meritTime" type="datetime-local" />
</div>
</div>
<div class="editor-field">
@@ -77,35 +65,36 @@
<input id="meritTitle" name="meritTitle" type="text" placeholder="请输入功德标题" required />
</div>
<div class="editor-field">
<label for="meritContent">事迹内容</label
><textarea
id="meritContent"
name="meritContent"
class="js-rich-editor"
placeholder="请输入内容"
></textarea>
<label for="meritContent">事迹内容</label>
<textarea id="meritContent" name="meritContent" class="js-rich-editor" placeholder="可选,记录功德事迹"></textarea>
</div>
<div class="editor-two">
<div class="editor-field">
<label for="meritType">功德类型</label>
<select id="meritType" name="meritType">
<option value="donation">捐赠</option>
<option value="service">义务服务</option>
<option value="repair">修缮</option>
<option value="public">公益</option>
<option value="other">其他</option>
</select>
</div>
<div class="editor-field">
<label for="meritAmount">金额</label>
<input id="meritAmount" name="amount" type="number" step="0.01" placeholder="请输入金额" />
<input id="meritAmount" name="amount" type="number" step="any" placeholder="可选;后端未限定精度、范围或正负" />
</div>
</div>
<div class="editor-field">
<label for="meritSortOrder">排序值</label>
<input id="meritSortOrder" name="sortOrder" type="number" step="1" placeholder="可选;安全整数" />
</div>
<input name="status" type="hidden" value="0" />
<div class="bottom-actions">
<button class="btn primary magnetic" type="submit">保存</button
><a class="btn ghost magnetic" href="profile-merit.html"
>取消</a
>
<button class="btn primary magnetic" type="submit">保存</button>
<a class="btn ghost magnetic" href="profile-merit.html" data-genealogy-context-link>取消</a>
<span class="form-status" data-merit-form-status></span>
</div>
</form>
<div class="api-empty" data-merit-editor-placeholder>正在加载功德记录编辑信息…</div>
</section>
</div>
</div>
@@ -116,13 +105,13 @@
<script src="public/js/lay-config.js"></script>
<script src="public/js/wangeditor5/index.js"></script>
<script src="public/js/rich-editor.js"></script>
<script src="public/js/profile-common.js"></script>
<script src="public/js/profile-common.js?v=20260725-entry"></script>
<script src="config.js"></script>
<script src="utils/StorageUtil.js"></script>
<script src="utils/axios.js"></script>
<script src="utils/AxiosRequestUtil.js"></script>
<script src="utils/ApiClient.js"></script>
<script src="public/js/pending-pages.js"></script>
<script src="public/js/merit-pages.js"></script>
<script src="public/js/page-effects.js"></script>
</body>
</html>