35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { Application, BackendSession, HandlerService, } from 'pinus';
|
|
import { resResult } from '@pubUtils/util';
|
|
import { STATUS } from '../../../consts';
|
|
import { getPlayerNewHeroGachaData } from '../../../services/activity/newHeroService';
|
|
|
|
|
|
export default function (app: Application) {
|
|
new HandlerService(app, {});
|
|
return new NewHeroGachaHandler(app);
|
|
}
|
|
|
|
export class NewHeroGachaHandler {
|
|
constructor(private app: Application) {
|
|
}
|
|
|
|
/**
|
|
* @description 获取关卡活动数据
|
|
* @param {{ activityId: number}} msg
|
|
* @param {BackendSession} session
|
|
* @memberof NewHeroGachaHandler
|
|
*/
|
|
async getData(msg: { activityId: number }, session: BackendSession) {
|
|
const { activityId } = msg;
|
|
const roleId = session.get('roleId');
|
|
const serverId = session.get('serverId');
|
|
|
|
let playerData = await getPlayerNewHeroGachaData(activityId, serverId, roleId)
|
|
|
|
if (!playerData) return resResult(STATUS.ACTIVITY_MISSING);
|
|
|
|
return resResult(STATUS.SUCCESS, playerData);
|
|
}
|
|
}
|
|
|