排行榜: 获取排行榜

This commit is contained in:
luying
2021-04-07 21:00:07 +08:00
parent 34e02dea89
commit 5dca7b304d
32 changed files with 1077 additions and 290 deletions

View File

@@ -13,6 +13,7 @@ import { getGuildChannelSid } from "../../../services/chatService";
import { UserGuildModel } from "../../../db/UserGuild";
import { GuildActivityCityModel } from "../../../db/GuildActivityCity";
import { Rank } from "../../../services/rankService";
import { getNextHourPoint } from "../../../pubUtils/timeUtil";
export default function (app: Application) {
return new GateActivityHandler(app);
@@ -138,10 +139,12 @@ export class GateActivityHandler {
// 更新redis数据
let myR = new Rank(REDIS_KEY.USER_GATE_ACTIVITY, { serverId, guildCode }, false);
let myScore = await myR.setRankWithRoleInfo(roleId, score, Date.now(), null, false, true);
let myScore = await myR.setRankWithRoleInfo(roleId, score, Date.now(), null, false);
await myR.setExpire(getNextHourPoint(5));
let r = new Rank(REDIS_KEY.GATE_ACTIVITY, { serverId }, true);
let guildScore = await r.setRankWithGuildInfo(guildCode, score, Date.now(), null, true);
await r.setExpire(getNextHourPoint(5));
// 更新数据库
let rec = await UserGuildActivityRecModel.pushRecord(code, newRecords, round);