37 lines
973 B
TypeScript
37 lines
973 B
TypeScript
import { Application, ChannelService } from 'pinus';
|
||
import { sendAllGuildRanks, sendGuildActEndMsg, calWoodenHorseAndSend } from '../../../services/guildActivityService';
|
||
|
||
export default function (app: Application) {
|
||
return new GuildActivityRemote(app);
|
||
}
|
||
|
||
export class GuildActivityRemote {
|
||
|
||
constructor(private app: Application) {
|
||
this.app = app;
|
||
this.channelService = app.get('channelService');
|
||
}
|
||
|
||
private channelService: ChannelService;
|
||
|
||
/**
|
||
* 从systimer服分发到guild各个服,发送排行榜数据
|
||
*/
|
||
public async sendRankToGuilds(aid: number) {
|
||
await sendAllGuildRanks(aid);
|
||
}
|
||
|
||
/**
|
||
* 发送结束活动消息
|
||
*/
|
||
public async guildActivityEnd(aid: number) {
|
||
await sendGuildActEndMsg(aid);
|
||
}
|
||
|
||
/**
|
||
* 计算粮草先行木马状态并发送
|
||
*/
|
||
public async calWoodenHorseAndSend(serverId: number) {
|
||
await calWoodenHorseAndSend(serverId);
|
||
}
|
||
} |