|
|
@ -17,16 +17,18 @@ import {
|
|
|
|
Errors,
|
|
|
|
Errors,
|
|
|
|
DataNotFoundError,
|
|
|
|
DataNotFoundError,
|
|
|
|
EntityError,
|
|
|
|
EntityError,
|
|
|
|
|
|
|
|
db,
|
|
|
|
} from 'tailchat-server-sdk';
|
|
|
|
} from 'tailchat-server-sdk';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
generateRandomNumStr,
|
|
|
|
generateRandomNumStr,
|
|
|
|
generateRandomStr,
|
|
|
|
generateRandomStr,
|
|
|
|
getEmailAddress,
|
|
|
|
getEmailAddress,
|
|
|
|
} from '../../../lib/utils';
|
|
|
|
} from '../../../lib/utils';
|
|
|
|
import { Types } from 'mongoose';
|
|
|
|
|
|
|
|
import type { TFunction } from 'i18next';
|
|
|
|
import type { TFunction } from 'i18next';
|
|
|
|
import _ from 'lodash';
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isValidObjectId, Types } = db;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 用户服务
|
|
|
|
* 用户服务
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -543,6 +545,9 @@ class UserService extends TcService {
|
|
|
|
async getUserInfoList(ctx: PureContext<{ userIds: string[] }>) {
|
|
|
|
async getUserInfoList(ctx: PureContext<{ userIds: string[] }>) {
|
|
|
|
const userIds = ctx.params.userIds;
|
|
|
|
const userIds = ctx.params.userIds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (userIds.some((userId) => !isValidObjectId(userId))) {
|
|
|
|
|
|
|
|
throw new EntityError('Include invalid userId');
|
|
|
|
|
|
|
|
}
|
|
|
|
const list = await Promise.all(
|
|
|
|
const list = await Promise.all(
|
|
|
|
userIds.map((userId) =>
|
|
|
|
userIds.map((userId) =>
|
|
|
|
ctx.call('user.getUserInfo', {
|
|
|
|
ctx.call('user.getUserInfo', {
|
|
|
|