团购:基础接口

This commit is contained in:
luying
2022-10-09 19:11:29 +08:00
parent 9ba3081e54
commit 2d3a1c7c30
16 changed files with 542 additions and 5 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
import { Channel, pinus } from "pinus";
import { CHANNEL_PREFIX, PUSH_BATCH, PUSH_INTERVAL, PUSH_ROUTE, STATUS } from "../consts";
import { genCode, resResult } from "../pubUtils/util";
import { getCityChannelSid, getGuildChannelSid, getWorldChannelSid, groupRoomId } from "./chatService";
import { getCityChannelSid, getGuildChannelSid, getWorldChannelSid, groupRoomId, getGroupShopSid } from "./chatService";
import { getAllOnlineRoles, getRoleOnlineInfo } from "./redisService";
import { errlogger, infologger } from '../util/logger';
import { MsgEncrypt } from "../pubUtils/sysUtil";
@@ -64,6 +64,12 @@ export async function sendMessageToCity(cityId: number, route: string, data: any
await pinus.app.rpc.chat.chatRemote.pushMessage.toServer(channelSid, roomId, route, data);
}
export async function sendMessageToGroupShopWithSuc(route: string, data: any) {
let channelSid = await getGroupShopSid();
let roomId = groupRoomId(CHANNEL_PREFIX.GROUP_SHOP);
await pinus.app.rpc.chat.chatRemote.pushMessage.toServer(channelSid, roomId, route, resResult(STATUS.SUCCESS, data));
}
export async function sendMessageToUserWithSuc(roleId: string, route: string, data: any, sid?: string) {
await sendMessageToUser(roleId, route, resResult(STATUS.SUCCESS, data), sid);
}