活动:月卡领取
This commit is contained in:
@@ -7,10 +7,10 @@ import { addReward, stringToRewardParam, useGiftPackage } from '../../../service
|
||||
import { ActivityFirstGiftModel } from '../../../db/ActivityFirstGift';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new firstGiftHandler(app);
|
||||
return new FirstGiftHandler(app);
|
||||
}
|
||||
|
||||
export class firstGiftHandler {
|
||||
export class FirstGiftHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export class firstGiftHandler {
|
||||
* @description 获取首充礼包数据
|
||||
* @param {{ }} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof firstGiftHandler
|
||||
* @memberof FirstGiftHandler
|
||||
*/
|
||||
async getFirstGiftActivity(msg: {}, session: BackendSession) {
|
||||
const { } = msg;
|
||||
@@ -44,7 +44,7 @@ export class firstGiftHandler {
|
||||
* @description 领取礼包奖励
|
||||
* @param {{ activityId: number, index: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof firstGiftHandler
|
||||
* @memberof FirstGiftHandler
|
||||
*/
|
||||
async getFirstGiftReward(msg: { activityId: number, index: number }, session: BackendSession) {
|
||||
const { activityId, index } = msg;
|
||||
|
||||
@@ -8,10 +8,10 @@ import { ActivityGrowthFundModel } from '../../../db/ActivityGrowthFund';
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
return new SevenDaysHandler(app);
|
||||
return new GrowthFundHandler(app);
|
||||
}
|
||||
|
||||
export class SevenDaysHandler {
|
||||
export class GrowthFundHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export class SevenDaysHandler {
|
||||
* @description 获取成长基金活动数据
|
||||
* @param {{ type: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof SevenDaysHandler
|
||||
* @memberof GrowthFundHandler
|
||||
*/
|
||||
async getGrowthFundActivity(msg: { type: number }, session: BackendSession) {
|
||||
const { type } = msg;
|
||||
@@ -39,7 +39,7 @@ export class SevenDaysHandler {
|
||||
* @description 获取成长基金奖励
|
||||
* @param {{ activityId: number, pageIndex: number, cellIndex: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof SevenDaysHandler
|
||||
* @memberof GrowthFundHandler
|
||||
*/
|
||||
async getGrowthFundCellReward(msg: { activityId: number, pageIndex: number, cellIndex: number }, session: BackendSession) {
|
||||
const { activityId, pageIndex, cellIndex } = msg;
|
||||
|
||||
@@ -7,10 +7,10 @@ import { ActivityShopModel } from '../../../db/ActivityShop';
|
||||
import moment = require('moment');
|
||||
|
||||
export default function (app: Application) {
|
||||
return new limitPackageHandler(app);
|
||||
return new LimitPackageHandler(app);
|
||||
}
|
||||
|
||||
export class limitPackageHandler {
|
||||
export class LimitPackageHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export class limitPackageHandler {
|
||||
* @description 获取新手限定活动数据
|
||||
* @param {{ activityId:number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof limitPackageHandler
|
||||
* @memberof LimitPackageHandler
|
||||
*/
|
||||
async getNewPlayerLimitPackageActivity(msg: { activityId: number }, session: BackendSession) {
|
||||
const { activityId } = msg;
|
||||
@@ -40,7 +40,7 @@ export class limitPackageHandler {
|
||||
* @description 获取每日/每周限购礼包数据
|
||||
* @param {{ activityId:number, type:number }} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof limitPackageHandler
|
||||
* @memberof LimitPackageHandler
|
||||
*/
|
||||
async getLimitPackageActivity(msg: { activityId: number, type: number }, session: BackendSession) {
|
||||
const { activityId, type } = msg;
|
||||
@@ -59,7 +59,7 @@ export class limitPackageHandler {
|
||||
* @description 购买礼包
|
||||
* @param {{ activityId: number, roundIndex: number, id: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof limitPackageHandler
|
||||
* @memberof LimitPackageHandler
|
||||
*/
|
||||
async buyGood(msg: { activityId: number, roundIndex: number, id: number }, session: BackendSession) {
|
||||
const { activityId, roundIndex, id, } = msg;
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { STATUS, ACTIVITY_RESOURCES_TYPE, ACTIVITY_TYPE } from '../../../consts';
|
||||
import { getPlayerMonthlyTicketData, makeMonthlyTicketReward, getPlayerMonthlyTicketDayReward } from '../../../services/monthlyTicketService';
|
||||
import moment = require('moment');
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
return new MonthlyTicketHandler(app);
|
||||
}
|
||||
|
||||
export class MonthlyTicketHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
/************************月卡活动****************************/
|
||||
|
||||
/**
|
||||
* @description 获取月卡活动数据
|
||||
* @param {BackendSession} session
|
||||
* @memberof MonthlyTicketHandler
|
||||
*/
|
||||
async getMonthlyTicketActivity(msg: { activityId: number }, session: BackendSession) {
|
||||
const { activityId } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
|
||||
let playerData = await getPlayerMonthlyTicketData(activityId, serverId, roleId);
|
||||
if (!playerData) return resResult(STATUS.ACTIVITY_MISSING);
|
||||
return resResult(STATUS.SUCCESS, playerData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 领取月卡奖品
|
||||
* @param {BackendSession} session
|
||||
* @memberof MonthlyTicketHandler
|
||||
*/
|
||||
async getMonthlyTicketReward(msg: { activityId: number }, session: BackendSession) {
|
||||
const { activityId } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
const sid = session.get('sid');
|
||||
const roleName = session.get('roleName');
|
||||
const funcs: number[] = session.get('funcs');
|
||||
|
||||
let result = await getPlayerMonthlyTicketDayReward(roleId, roleName, sid, serverId, funcs, activityId)
|
||||
if (result) {
|
||||
return resResult(STATUS.SUCCESS, result);
|
||||
}
|
||||
return resResult(STATUS.NO_MOTHLY_TICKET_REWARD);
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@ import Activity, { ActivityModel, ActivityModelType } from '../../../db/Activity
|
||||
import { addSelfServiceShopGiftReward, getActivityData, getPlayerActivityData } from '../../../services/selfServiceShopActivityService';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new thirtyDaysHandler(app);
|
||||
return new SelfServiceShopHandler(app);
|
||||
}
|
||||
|
||||
export class thirtyDaysHandler {
|
||||
export class SelfServiceShopHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export class thirtyDaysHandler {
|
||||
* @description 获取自助商店数据
|
||||
* @param {{ }} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof thirtyDaysHandler
|
||||
* @memberof SelfServiceShopHandler
|
||||
*/
|
||||
async getSelfServiceShopActivity(msg: {}, session: BackendSession) {
|
||||
const { } = msg;
|
||||
@@ -40,7 +40,7 @@ export class thirtyDaysHandler {
|
||||
* @description 购买礼包
|
||||
* @param {{ activityId: number, roundIndex: number, index: number, cellIndex: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof thirtyDaysHandler
|
||||
* @memberof SelfServiceShopHandler
|
||||
*/
|
||||
async buyGift(msg: { activityId: number, roundIndex: number, index: number }, session: BackendSession) {
|
||||
const { activityId, roundIndex, index } = msg;
|
||||
@@ -80,7 +80,7 @@ export class thirtyDaysHandler {
|
||||
* @description 操作礼包
|
||||
* @param {{ activityId: number, roundIndex: number, index: number, cellIndex: number, gift: number, rewardIndex: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof thirtyDaysHandler
|
||||
* @memberof SelfServiceShopHandler
|
||||
*/
|
||||
async saveGood(msg: { activityId: number, roundIndex: number, index: number, cellIndex: number, gift: number, rewardIndex: number }, session: BackendSession) {
|
||||
const { activityId, roundIndex, index, cellIndex, gift, rewardIndex } = msg;
|
||||
|
||||
@@ -6,15 +6,14 @@ import { ThirtyDaysData, ThirtyDaysItem, ThirtyDaysPointItem } from '../../../do
|
||||
import { addItems, createHeroes } from '../../../services/rewardService';
|
||||
import { ActivityThirtyDaysModel } from '../../../db/ActivityThirtyDays';
|
||||
import { ActivityThirtyDaysPointRewardModel } from '../../../db/ActivityThirtyDaysPointReward';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import moment = require('moment');
|
||||
import { ActivityModel, ActivityModelType } from '../../../db/Activity';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new thirtyDaysHandler(app);
|
||||
return new ThirtyDaysHandler(app);
|
||||
}
|
||||
|
||||
export class thirtyDaysHandler {
|
||||
export class ThirtyDaysHandler {
|
||||
constructor(private app: Application) {
|
||||
}
|
||||
|
||||
@@ -24,7 +23,7 @@ export class thirtyDaysHandler {
|
||||
* @description 获取30目标活动数据
|
||||
* @param {{ }} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof thirtyDaysHandler
|
||||
* @memberof ThirtyDaysHandler
|
||||
*/
|
||||
async getThirtyDaysActivity(msg: {}, session: BackendSession) {
|
||||
const { } = msg;
|
||||
@@ -43,7 +42,7 @@ export class thirtyDaysHandler {
|
||||
* @description 获取30天完成任务的奖励
|
||||
* @param {{ activityId: number, pageIndex: number, cellIndex: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof thirtyDaysHandler
|
||||
* @memberof ThirtyDaysHandler
|
||||
*/
|
||||
async getThirtyDaysCellReward(msg: { activityId: number, pageIndex: number, cellIndex: number }, session: BackendSession) {
|
||||
const { activityId, pageIndex, cellIndex } = msg;
|
||||
@@ -113,7 +112,7 @@ export class thirtyDaysHandler {
|
||||
* @description 点数兑换奖励
|
||||
* @param {{ activityId: number, cellIndex: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof thirtyDaysHandler
|
||||
* @memberof ThirtyDaysHandler
|
||||
*/
|
||||
async getThirtyDaysPointReward(msg: { activityId: number, cellIndex: number }, session: BackendSession) {
|
||||
const { activityId, cellIndex } = msg;
|
||||
|
||||
Reference in New Issue
Block a user