✨ feat(37需求): 评论引导记录
This commit is contained in:
@@ -215,18 +215,7 @@ export class ChatHandler {
|
|||||||
if (!accuseRec) return resResult(STATUS.WRONG_PARMS);
|
if (!accuseRec) return resResult(STATUS.WRONG_PARMS);
|
||||||
return resResult(STATUS.SUCCESS, accuseRec);
|
return resResult(STATUS.SUCCESS, accuseRec);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setPushMsgTrigger(msg: { isClosePush: boolean }, session: BackendSession) {
|
|
||||||
const roleId = session.get('roleId');
|
|
||||||
const { isClosePush } = msg;
|
|
||||||
|
|
||||||
let role = await RoleModel.setPushMsgOpen(roleId, isClosePush);
|
|
||||||
if(!role) return resResult(STATUS.ROLE_NOT_FOUND);
|
|
||||||
return resResult(STATUS.SUCCESS, {
|
|
||||||
isClosePushPush: role.isClosePush
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 客户端推送消息
|
// 客户端推送消息
|
||||||
async debugPushMessage(msg: { uid: number }, session: BackendSession) {
|
async debugPushMessage(msg: { uid: number }, session: BackendSession) {
|
||||||
let dic = gameData.dicPushMessage.get(SDK_PUSH_MSG_TYPE.GUILD_ACTIVITY_START);
|
let dic = gameData.dicPushMessage.get(SDK_PUSH_MSG_TYPE.GUILD_ACTIVITY_START);
|
||||||
|
|||||||
@@ -503,6 +503,28 @@ export class RoleHandler {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setPushMsgTrigger(msg: { isClosePush: boolean }, session: BackendSession) {
|
||||||
|
const roleId = session.get('roleId');
|
||||||
|
const { isClosePush } = msg;
|
||||||
|
|
||||||
|
let role = await RoleModel.setPushMsgOpen(roleId, isClosePush);
|
||||||
|
if(!role) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||||
|
return resResult(STATUS.SUCCESS, {
|
||||||
|
isClosePushPush: role.isClosePush
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async setHasComment(msg: { hasComment: boolean }, session: BackendSession) {
|
||||||
|
const roleId = session.get('roleId');
|
||||||
|
const { hasComment } = msg;
|
||||||
|
|
||||||
|
let role = await RoleModel.setHasComment(roleId, hasComment);
|
||||||
|
if(!role) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||||
|
return resResult(STATUS.SUCCESS, {
|
||||||
|
hasComment: role.hasComment
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 防沉迷调试用,推送窗口
|
// 防沉迷调试用,推送窗口
|
||||||
async debugPlayerTime(msg: { type: number }, session: BackendSession) {
|
async debugPlayerTime(msg: { type: number }, session: BackendSession) {
|
||||||
let { type } = msg;
|
let { type } = msg;
|
||||||
|
|||||||
@@ -1994,11 +1994,16 @@ export function checkRouteParam(route: string, msg: any) {
|
|||||||
if(!isDevelopEnv() && !checkNaturalNumbers(msg.id, msg.count)) return false;
|
if(!isDevelopEnv() && !checkNaturalNumbers(msg.id, msg.count)) return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "chat.chatHandler.setPushMsgTrigger":
|
case "role.roleHandler.setPushMsgTrigger":
|
||||||
{
|
{
|
||||||
if(!isBoolean(msg.isClosePush)) return false;
|
if(!isBoolean(msg.isClosePush)) return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "role.roleHandler.setHasComment":
|
||||||
|
{
|
||||||
|
if(!isBoolean(msg.hasComment)) return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'activity.activityHandler.debugActivityMemory':
|
case 'activity.activityHandler.debugActivityMemory':
|
||||||
case 'activity.popUpShopHandler.debugPushPopUpShop':
|
case 'activity.popUpShopHandler.debugPushPopUpShop':
|
||||||
case 'activity.popUpShopHandler.debugPushPopUpInterval':
|
case 'activity.popUpShopHandler.debugPushPopUpInterval':
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export enum FRIEND_SHIP_SELECT {
|
|||||||
GET_FRIEND_VALUE = 'friendValue friendLv'
|
GET_FRIEND_VALUE = 'friendValue friendLv'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'artifacts', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation', 'activityItems', 'customerLink', 'isClosePush'];
|
export const ENTERY_ROLE_PICK = ['roleId', 'roleName', 'serverId', 'ce', 'topLineupCe', 'coin', 'lv', 'exp', 'vLv', 'gold', 'heros', 'jewels', 'artifacts', 'consumeGoods', 'title', 'teraphs', 'showLineup', 'heads', 'head', 'frames', 'frame', 'spines', 'spine', 'hasGuild', 'guildCode', 'todayZeroPoint', 'apJson', 'skins', 'totalPay', 'guide', 'hasInit', 'renameCnt', 'totalCost', 'guildName', 'isVip', 'createTime', 'ipLocation', 'activityItems', 'customerLink', 'isClosePush', 'hasComment'];
|
||||||
|
|
||||||
export enum SURVEY_SELECT {
|
export enum SURVEY_SELECT {
|
||||||
FIND = '-__v -_id -surveyName -roleIndex -reward -mailContent -receivedRole -createdAt -updatedAt'
|
FIND = '-__v -_id -surveyName -roleIndex -reward -mailContent -receivedRole -createdAt -updatedAt'
|
||||||
|
|||||||
@@ -351,6 +351,9 @@ export default class Role extends BaseModel {
|
|||||||
// 是否打开推送
|
// 是否打开推送
|
||||||
@prop({ required: false })
|
@prop({ required: false })
|
||||||
isClosePush: boolean;
|
isClosePush: boolean;
|
||||||
|
// 是否评论过
|
||||||
|
@prop({ required: false })
|
||||||
|
hasComment: boolean;
|
||||||
|
|
||||||
public static async findAllByUid(uid: number, getters = false, virtuals = true) {
|
public static async findAllByUid(uid: number, getters = false, virtuals = true) {
|
||||||
const role: RoleType[] = await RoleModel.find({ 'userInfo.uid': uid }).select('roleId roleName serverId head frame spine heads frames spines lv updatedAt createTime').lean({ getters, virtuals });
|
const role: RoleType[] = await RoleModel.find({ 'userInfo.uid': uid }).select('roleId roleName serverId head frame spine heads frames spines lv updatedAt createTime').lean({ getters, virtuals });
|
||||||
@@ -850,6 +853,11 @@ export default class Role extends BaseModel {
|
|||||||
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $set: { isClosePush } }, { new: true }).select('-_id roleId isClosePush').lean();
|
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $set: { isClosePush } }, { new: true }).select('-_id roleId isClosePush').lean();
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async setHasComment(roleId: string, hasComment: boolean) {
|
||||||
|
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $set: { hasComment } }, { new: true }).select('-_id roleId hasComment').lean();
|
||||||
|
return role;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RoleModel = getModelForClass(Role);
|
export const RoleModel = getModelForClass(Role);
|
||||||
|
|||||||
Reference in New Issue
Block a user