feat(consignment): 寄卖规格与价格动态配置重构

This commit is contained in:
2026-11-05 17:09:05 +08:00
parent 2ef16ddcc7
commit d41ec44679
22 changed files with 3761 additions and 621 deletions
@@ -128,6 +128,8 @@ router.post(
inventoryIds: Array.isArray(req.body?.inventoryIds)
? req.body.inventoryIds.map((id: unknown) => Number(id))
: [],
allowNonExact: Boolean(req.body?.allowNonExact),
reason: String(req.body?.reason || '').trim(),
actorName: req.adminSession?.displayName || req.adminSession?.username || 'admin',
}),
{
@@ -80,6 +80,7 @@ router.post('/consignment/publish', requireActiveWorker, async (req, res) => {
router.get('/consignment/price-suggestion', requireActiveWorker, async (req, res) => {
try {
const result = await getWorkerConsignmentPriceSuggestion({
profileId: req.query.profileId,
system: req.query.system,
series: req.query.series,
diamondLevel: req.query.diamondLevel,
@@ -91,6 +92,22 @@ router.get('/consignment/price-suggestion', requireActiveWorker, async (req, res
}
})
/**
* POST /api/v1/worker/consignment/price-preview
* 动态规格发布时按 profileId + specValues 算价(支持自定义字段与配置价)。
*/
router.post('/consignment/price-preview', requireActiveWorker, async (req, res) => {
try {
const result = await getWorkerConsignmentPriceSuggestion({
profileId: req.body?.profileId,
values: req.body?.specValues,
})
res.json({ ok: true, data: result })
} catch (error) {
sendRouteError(res, error, '获取价格预览失败', '[worker/consignment/price-preview]')
}
})
/**
* GET /api/v1/worker/consignment/my-items?group=&keyword=&page=&pageSize=
* 打手查看自己在接单平台寄卖的手枪列表与状态(服务端搜索 + 分组 + 分页)