用户状态接口增加返回是否获得白名单的字段

This commit is contained in:
CounterFire2023 2024-04-13 10:38:18 +08:00
parent a5221144ab
commit 149a44cc76
2 changed files with 17 additions and 6 deletions

View File

@ -316,13 +316,21 @@ class BoxController extends BaseController {
chest.status = ChestStatusEnum.OPENED
const score = chest.scoreInit + chest.scoreBonus
const dateTag = formatDate(new Date())
let items = await generateChestBonus(chest)
if (!chest.items) {
chest.items = []
let items: any[] = []
if (!user.inWhiteList) {
items = await generateChestBonus(chest)
if (!chest.items) {
chest.items = []
}
items.forEach(item => {
chest.items.push(item.id)
})
if (items.find(item => item.type === 1)) {
user.inWhiteList = true
await user.save()
}
}
items.forEach(item => {
chest.items.push(item.id)
})
await updateRankScore({
user: user.id,
score: score,

View File

@ -102,6 +102,9 @@ export class ActivityUserClass extends BaseModule {
@prop()
public discordName?: string
@prop({ default: false })
public inWhiteList: boolean
@prop({ default: 1 })
public boost: number
/**