用户状态接口增加排名
This commit is contained in:
parent
c08d7a465a
commit
a5f67cf4da
@ -302,11 +302,12 @@ body:
|
||||
"address": "钱包地址",
|
||||
"boost": 1, // 正常值为1
|
||||
"twitterId": "",
|
||||
"twitterName: "",
|
||||
"twitterName": "",
|
||||
"discordId": "",
|
||||
"discordName": "",
|
||||
"scoreToday": 100, // 今日获得积分
|
||||
"scoreTotal": 200, // 总积分
|
||||
"rankTotal": "-",
|
||||
"invite": "邀请人address",
|
||||
"code": "自己的邀请码"
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ class SignController extends BaseController {
|
||||
const todayScore = await new RedisClient().zscore(todayKey, user.id)
|
||||
const totalKey = rankKey(user.activity);
|
||||
const totalScore = await new RedisClient().zscore(totalKey, user.id)
|
||||
const totalRank = await new RedisClient().zrevrank(totalKey, user.id)
|
||||
let invite = ''
|
||||
if (user.inviteUser) {
|
||||
const inviteUser = await ActivityUser.findById(user.inviteUser)
|
||||
@ -101,6 +102,7 @@ class SignController extends BaseController {
|
||||
discordName: user.discordName,
|
||||
scoreToday: todayScore ? parseInt(todayScore+'') : 0,
|
||||
scoreTotal: totalScore ? parseInt(totalScore+'') : 0,
|
||||
rankTotal: totalRank ? totalRank : '-',
|
||||
invite,
|
||||
code: user.inviteCode,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user