mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
chore: auto
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {Inject, Provide, Scope, ScopeEnum} from '@midwayjs/core';
|
||||
import {InjectEntityModel} from '@midwayjs/typeorm';
|
||||
import {Repository} from 'typeorm';
|
||||
import { In, Repository } from "typeorm";
|
||||
import {AccessGetter, BaseService, PageReq, PermissionException, ValidateException} from '../../../index.js';
|
||||
import {AccessEntity} from '../entity/access.js';
|
||||
import {AccessDefine, accessRegistry, newAccess} from '@certd/pipeline';
|
||||
@@ -175,4 +175,27 @@ export class AccessService extends BaseService<AccessEntity> {
|
||||
getDefineByType(type: string) {
|
||||
return accessRegistry.getDefine(type);
|
||||
}
|
||||
|
||||
|
||||
async getSimpleByIds(ids: number[], userId: any) {
|
||||
if (ids.length === 0) {
|
||||
return [];
|
||||
}
|
||||
if (!userId) {
|
||||
return [];
|
||||
}
|
||||
return await this.repository.find({
|
||||
where: {
|
||||
id: In(ids),
|
||||
userId,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
type: true,
|
||||
userId:true
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user