init
This commit is contained in:
@@ -1,33 +1,34 @@
|
||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { STATUS } from '../../../consts';
|
||||
import { getPlayerYuanbaoShopData } from '../../../services/activity/yuanbaoService';
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
return new YuanbaoShopHandler(app);
|
||||
}
|
||||
|
||||
export class YuanbaoShopHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
/************************元宝商店****************************/
|
||||
|
||||
/**
|
||||
* @description 获取商店活动数据
|
||||
* @param {BackendSession} session
|
||||
* @memberof YuanbaoShopHandler
|
||||
*/
|
||||
async getShopActivity(msg: { activityId: number }, session: BackendSession) {
|
||||
const { activityId } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
|
||||
let playerData = await getPlayerYuanbaoShopData(activityId, serverId, roleId);
|
||||
if (!playerData) return resResult(STATUS.ACTIVITY_MISSING);
|
||||
|
||||
return resResult(STATUS.SUCCESS, playerData);
|
||||
}
|
||||
}
|
||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
||||
import { resResult } from '@pubUtils/util';
|
||||
import { STATUS } from '../../../consts';
|
||||
import { getPlayerYuanbaoShopData } from '../../../services/activity/yuanbaoService';
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
return new YuanbaoShopHandler(app);
|
||||
}
|
||||
|
||||
export class YuanbaoShopHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
/************************元宝商店****************************/
|
||||
|
||||
/**
|
||||
* @description 获取商店活动数据
|
||||
* @param {BackendSession} session
|
||||
* @memberof YuanbaoShopHandler
|
||||
*/
|
||||
async getShopActivity(msg: { activityId: number }, session: BackendSession) {
|
||||
const { activityId } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
|
||||
let playerData = await getPlayerYuanbaoShopData(activityId, serverId, roleId);
|
||||
if (!playerData) return resResult(STATUS.ACTIVITY_MISSING);
|
||||
|
||||
return resResult(STATUS.SUCCESS, playerData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user