Extract memind_adm admin server, add local dev tooling, and remove image-generation.
Split platform admin and ops APIs into standalone admin-server.mjs with network guards; simplify billing to RMB token pricing, refactor user auth, and add rsync deploy plus local-test scripts and docs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -103,15 +103,13 @@ async function ensureBundle(conn, row, html) {
|
||||
async function main() {
|
||||
const pool = createDbPool();
|
||||
const [rows] = await pool.query(
|
||||
`SELECT pp.id AS post_id, pp.title, pp.summary, pp.tags,
|
||||
c.slug AS category_slug,
|
||||
`SELECT pp.id AS post_id, pp.title,
|
||||
pr.id AS publication_id, pr.page_id, pr.page_version_id, pr.user_id, pr.status AS pub_status,
|
||||
p.space_id, p.category_id, p.title AS page_title,
|
||||
pv.bundle_asset_id,
|
||||
(SELECT av.id FROM h5_asset_versions av
|
||||
WHERE av.asset_id = pv.bundle_asset_id AND av.version_no = 1 LIMIT 1) AS bundle_version_id
|
||||
FROM plaza_posts pp
|
||||
JOIN plaza_categories c ON c.id = pp.category_id
|
||||
JOIN h5_publish_records pr ON pr.id = pp.publication_id
|
||||
JOIN h5_page_records p ON p.id = pr.page_id
|
||||
JOIN h5_page_versions pv ON pv.id = pr.page_version_id
|
||||
@@ -124,17 +122,7 @@ async function main() {
|
||||
try {
|
||||
await conn.beginTransaction();
|
||||
for (const row of rows) {
|
||||
let tags = [];
|
||||
try {
|
||||
tags = typeof row.tags === 'string' ? JSON.parse(row.tags) : row.tags ?? [];
|
||||
} catch {
|
||||
tags = [];
|
||||
}
|
||||
const { summary, html, skipHtml } = getEnrichment(row.post_id, row.title, {
|
||||
categorySlug: row.category_slug,
|
||||
summary: row.summary,
|
||||
tags,
|
||||
});
|
||||
const { summary, html, skipHtml } = getEnrichment(row.post_id, row.title);
|
||||
const summaryOnly = skipHtml && row.bundle_asset_id;
|
||||
if (!summaryOnly) {
|
||||
await ensureBundle(conn, row, html);
|
||||
|
||||
Reference in New Issue
Block a user