活动:每日兑换铜币活动
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
import { decodeArrayListStr, deltaDays, resResult, splitString } from '../../../pubUtils/util';
|
||||
import { STATUS, ACTIVITY_RESOURCES_TYPE, ACTIVITY_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE } from '../../../consts';
|
||||
import { SelfServiceShopData, SelfServiceShopItem, SelfServiceShopItemInfo } from '../../../domain/activityField/selfServiceShopField';
|
||||
import { addItems, handleCost } from '../../../services/rewardService';
|
||||
import { resResult, splitString } from '../../../pubUtils/util';
|
||||
import { STATUS, } from '../../../consts';
|
||||
import { SelfServiceShopData } from '../../../domain/activityField/selfServiceShopField';
|
||||
import { handleCost } from '../../../services/rewardService';
|
||||
import { ActivitySelfServiceShopModel, ActivitySelfServiceShopModelType } from '../../../db/ActivitySelfServiceShop';
|
||||
import { ActivitySelfServiceModel, ActivitySelfServiceModelType } from '../../../db/ActivitySelfService';
|
||||
import { ActivitySelfServiceGoodsModel, ActivitySelfServiceGoodsModelType } from '../../../db/ActivitySelfServiceGoods';
|
||||
import moment = require('moment');
|
||||
import Activity, { ActivityModel, ActivityModelType } from '../../../db/Activity';
|
||||
import { ActivitySelfServiceModel } from '../../../db/ActivitySelfService';
|
||||
import { ActivitySelfServiceGoodsModel } from '../../../db/ActivitySelfServiceGoods';
|
||||
import { ActivityModel, ActivityModelType } from '../../../db/Activity';
|
||||
import { addSelfServiceShopGiftReward, getSelfServiceShopActivityData, getPlayerActivityData } from '../../../services/selfServiceShopActivityService';
|
||||
import { addReward, stringToConsumeParam, stringToRewardParam } from '../../../services/giftPackageService';
|
||||
import { random } from 'underscore';
|
||||
@@ -73,17 +72,17 @@ export class SelfServiceShopHandler {
|
||||
let consumeResult = await handleCost(roleId, sid, consume);
|
||||
if (!consumeResult) return resResult(STATUS.ROLE_MATERIAL_NOT_ENOUGH);
|
||||
|
||||
let result = await addSelfServiceShopGiftReward(roleId, roleName, sid, serverId, funcs, activityId, roundIndex, index);
|
||||
let result = await addSelfServiceShopGiftReward(roleId, roleName, sid, serverId, funcs, activityId, roundIndex, index, item);
|
||||
return resResult(STATUS.SUCCESS, Object.assign(result, {}));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 操作礼包
|
||||
* @param {{ data:Array<{activityId: number, roundIndex: number, index: number, cellIndex: number, gift: number, rewardIndex: number}>}} msg
|
||||
* @param {{ data:Array<{activityId: number, roundIndex: number, index: number, cellIndex: number, rewardIndex: number}>}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof SelfServiceShopHandler
|
||||
*/
|
||||
async saveGood(msg: { data: Array<{ activityId: number, roundIndex: number, index: number, cellIndex: number, gift: number, rewardIndex: number }> }, session: BackendSession) {
|
||||
async saveGood(msg: { data: Array<{ activityId: number, roundIndex: number, index: number, cellIndex: number, rewardIndex: number }> }, session: BackendSession) {
|
||||
const { data } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
@@ -92,7 +91,7 @@ export class SelfServiceShopHandler {
|
||||
const funcs: number[] = session.get('funcs');
|
||||
|
||||
for (let obj of data) {
|
||||
await ActivitySelfServiceGoodsModel.addGoods(obj.activityId, roleId, obj.roundIndex, obj.index, obj.cellIndex, obj.gift, obj.rewardIndex);
|
||||
await ActivitySelfServiceGoodsModel.addGoods(obj.activityId, roleId, obj.roundIndex, obj.index, obj.cellIndex, obj.rewardIndex);
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS, { data });
|
||||
|
||||
Reference in New Issue
Block a user