From 441792a16f6ed041ca13eec6f32f674811bd4993 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/nft.controller.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/controllers/nft.controller.ts b/src/controllers/nft.controller.ts index 28f321b..cdc994e 100644 --- a/src/controllers/nft.controller.ts +++ b/src/controllers/nft.controller.ts @@ -14,6 +14,7 @@ const nftList = sourceList.map(o => { projectName: o['Project'], link: o['Twitter'], collection: o['Collection name'], + group: o['GROUP'], guild: o['SERVER ID'] || DEFAULT_GUILD, role: o['ROLE ID'], tier: o['TIER'] == 'Tier 2' ? 2 : 1, @@ -23,7 +24,7 @@ if (process.env.NODE_ENV !== 'production') { nftList.unshift({ projectName: 'Test', link: 'https://x.com/sparky-chain', - contract: '0x50A8e60041A206AcaA5F844a1104896224be6F39', + contract: '0x50a8e60041a206acaa5f844a1104896224be6f39', collection: 'Test Collection', guild: '1222509817411665920', role: '1229658972793999391', @@ -32,7 +33,16 @@ if (process.env.NODE_ENV !== 'production') { } const nftListStr = JSON.stringify(nftList) const nftMap = new Map() -nftList.forEach(o => nftMap.set(o.contract.toLowerCase(), o)) +const groupMap = new Map() +for (let o of nftList) { + nftMap.set(o.contract.toLowerCase(), o) + if (o.group) { + if (!groupMap.has(o.group)) { + groupMap.set(o.group, []) + } + groupMap.get(o.group).push(o) + } +} /** * 合作伙伴相关接口 */