打脸公告:添加返回数据
This commit is contained in:
20
game-server/app/services/activity/popNoticeService.ts
Normal file
20
game-server/app/services/activity/popNoticeService.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { PopNoticeData } from "../../domain/activityField/popNotice";
|
||||
import { getRoleCreateTime, getServerCreateTime } from "../redisService";
|
||||
import { getActivityById } from "./activityService";
|
||||
|
||||
/**
|
||||
* 玩家活动数据
|
||||
*
|
||||
* @param {number} serverId 区Id
|
||||
* @param {number} activityId 活动Id
|
||||
* @param {string} roleId 角色Id
|
||||
*
|
||||
*/
|
||||
export async function getPopNoticeData(serverId: number, activityId: number, roleId: string) {
|
||||
let activityData = await getActivityById(activityId);
|
||||
let createTime = await getRoleCreateTime(roleId);
|
||||
let serverTime = await getServerCreateTime(serverId);
|
||||
|
||||
let playerData = new PopNoticeData(activityData, createTime, serverTime);
|
||||
return playerData;
|
||||
}
|
||||
@@ -58,6 +58,7 @@ export enum ACTIVITY_TYPE {
|
||||
GUILD_PAY = 43, // 军团充值人数
|
||||
SHOP = 44, // 限时商店
|
||||
GUIDE_GACHA = 45, // 500抽
|
||||
POP_NOTICE = 46, // 打脸公告
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
39
shared/domain/activityField/popNotice.ts
Normal file
39
shared/domain/activityField/popNotice.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { ActivityModelType } from "../../db/Activity";
|
||||
import { ActivityBase } from "./activityField";
|
||||
|
||||
interface PopNoticeInDb {
|
||||
bg: string; // 背景图片
|
||||
canClose: boolean; // 是否可以选择今天不再弹出
|
||||
sort: number; // 活动的排序,越大的越前
|
||||
skip: string; // 前往
|
||||
sysType: number; // dic_zyz_systemOpenTime的id,功能开启
|
||||
timePosition: string; // 控制公告持续时间的显示位置'&'表示不显示持续时间
|
||||
}
|
||||
|
||||
/**
|
||||
* 打脸公告
|
||||
*/
|
||||
export class PopNoticeData extends ActivityBase {
|
||||
bg: string; // 背景图片
|
||||
canClose: boolean; // 是否可以选择今天不再弹出
|
||||
sort: number; // 活动的排序,越大的越前
|
||||
skip: string; // 前往
|
||||
sysType: number; // dic_zyz_systemOpenTime的id,功能开启
|
||||
timePosition: string; // 控制公告持续时间的显示位置'&'表示不显示持续时间
|
||||
|
||||
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
|
||||
super(activityData, createTime, serverTime)
|
||||
this.initData(activityData.data)
|
||||
}
|
||||
|
||||
public initData(data: string) {
|
||||
let dataObj: PopNoticeInDb = JSON.parse(data);
|
||||
this.bg = dataObj.bg;
|
||||
this.canClose = dataObj.canClose;
|
||||
this.sort = dataObj.sort;
|
||||
this.sysType = dataObj.sysType;
|
||||
this.skip = dataObj.skip;
|
||||
this.timePosition = dataObj.timePosition;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -244,5 +244,11 @@
|
||||
"activityType": 45,
|
||||
"name": "GUIDE_GACHA",
|
||||
"string": "500抽"
|
||||
},
|
||||
{
|
||||
"id": 46,
|
||||
"activityType": 46,
|
||||
"name": "POP_NOTICE",
|
||||
"string": "打脸公告"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user