42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { Application, ChannelService, BackendSession } from "pinus";
|
|
import { GUILD_ACTIVITY_TYPE, STATUS } from "../../../consts";
|
|
import { resResult } from "../../../pubUtils/util";
|
|
import { getGuildActivityStatus } from "../../../services/guildActivityService";
|
|
|
|
export default function (app: Application) {
|
|
return new RaceActivityHandler(app);
|
|
}
|
|
|
|
export class RaceActivityHandler {
|
|
|
|
channelService: ChannelService;
|
|
constructor(private app: Application) {
|
|
this.channelService = app.get('channelService');
|
|
}
|
|
|
|
private aid = GUILD_ACTIVITY_TYPE.GATE_ACTIVITY; // 蛮夷入侵id
|
|
|
|
// 进入粮草先行界面
|
|
async getRaceActivity(msg: {}, session: BackendSession) {
|
|
|
|
const roleId = session.get('roleId');
|
|
const roleName = session.get('roleName');
|
|
const serverId = session.get('serverId');
|
|
const guildCode = session.get('guildCode');
|
|
if(!guildCode) return resResult(STATUS.GUILD_AUTH_NOT_ENOUGH);
|
|
|
|
let statusResult = getGuildActivityStatus(this.aid);
|
|
if(!statusResult) return resResult(STATUS.DIC_DATA_NOT_FOUND);
|
|
|
|
|
|
|
|
return resResult(STATUS.SUCCESS, {
|
|
...statusResult,
|
|
hasJoin: true,
|
|
woodenHorse: {},
|
|
guildRank:[]
|
|
});
|
|
}
|
|
|
|
|
|
} |