优化:抽象推送方法

This commit is contained in:
luying
2022-04-08 20:38:54 +08:00
parent a64faac7cd
commit f486a8d8a5
38 changed files with 475 additions and 1257 deletions

View File

@@ -65,19 +65,6 @@ export async function getTeraphStrengthenResult(role: RoleType, count: number, d
return { times, consumes: check.getConsume(), criAttr }
}
/**
*
* @param channel
* @param user
*/
export function addUserToChannel(channel: Channel, user: ChannelUser) {
const users = channel.getMembers();
const { uid, sid } = user;
if (users.indexOf(uid) === -1) {
channel.add(uid, sid);
}
}
export async function getSimpleRoleInfo(roleId: string) {
if (!roleId) return null;
let role = await RoleModel.findByRoleId(roleId, ROLE_SELECT.SHOW_SIMPLE, true);