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) + } +} /** * 合作伙伴相关接口 */