This commit is contained in:
2026-07-05 14:43:34 +08:00
commit 17a8027b20
277 changed files with 63794 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
/// modules/center/dto.js
const { toAbsoluteUrl } = require('../../utils/url');
const toDto = (row) => ({
id: row.id,
name: row.name,
slug: row.slug,
icon: row.icon || '',
iconImage: toAbsoluteUrl(row.icon_image || ''),
intro: row.intro || '',
image: toAbsoluteUrl(row.image || ''),
sort: Number(row.sort || 0),
enabled: row.enabled === 1 || row.enabled === true,
createdAt: row.created_at
});
const toCreateDto = (body) => ({
name: body.name,
slug: body.slug,
icon: body.icon,
iconImage: body.iconImage,
intro: body.intro,
image: body.image,
sort: body.sort,
enabled: body.enabled
});
module.exports = { toDto, toCreateDto };