feat(mindspace): add SEO/GEO delivery, page template catalog, and admin hooks
Memind CI / Test, build, and release guards (push) Has been cancelled

Enable optional SEO/GEO injection and discovery routes for confirmed public pages while keeping private pages noindex. Add premium page template skills, portal catalog API, template shop UI, and Baidu push gated by memind_adm config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-10 08:06:12 +08:00
parent 7c65540366
commit fde6503bdf
158 changed files with 9194 additions and 270 deletions
+26
View File
@@ -67,6 +67,7 @@ export function createAdminApi({
wechatAdmin,
wechatIntentRouterConfigService,
subscriptionService,
templateCatalogService,
}) {
function requireAdmin(req, res, next) {
if (!req.currentUser || req.currentUser.role !== 'admin') {
@@ -780,6 +781,31 @@ export function createAdminApi({
res.json(result);
});
adminApi.get('/template-catalog', requireAdmin, async (_req, res) => {
if (!templateCatalogService?.adminListCatalog) {
return res.status(503).json({ message: '模板商城未启用' });
}
res.json({ items: await templateCatalogService.adminListCatalog() });
});
adminApi.put('/template-catalog/:skillName', requireAdmin, async (req, res) => {
if (!templateCatalogService?.adminUpsertCatalog) {
return res.status(503).json({ message: '模板商城未启用' });
}
const result = await templateCatalogService.adminUpsertCatalog(req.params.skillName, req.body ?? {});
if (!result.ok) return res.status(400).json({ message: result.message });
res.json(result);
});
adminApi.post('/users/:userId/template-grants/:skillName', requireAdmin, async (req, res) => {
if (!templateCatalogService?.adminGrantTemplate) {
return res.status(503).json({ message: '模板商城未启用' });
}
const result = await templateCatalogService.adminGrantTemplate(req.params.userId, req.params.skillName);
if (!result.ok) return res.status(400).json({ message: result.message });
res.json(result);
});
adminApi.get('/ledger', requireAdmin, async (req, res) => {
const userId = typeof req.query.userId === 'string' ? req.query.userId : null;
const { page, pageSize } = req.query;