chore: project detail join approve

This commit is contained in:
xiaojunnuo
2026-02-28 12:13:31 +08:00
parent 6163c3f08e
commit 8a4e981931
19 changed files with 449 additions and 72 deletions
@@ -0,0 +1,60 @@
import { Constants, isEnterprise } from '@certd/lib-server';
import { Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
import { In } from 'typeorm';
import { AuthService } from '../../../modules/sys/authority/service/auth-service.js';
import { UserService } from '../../../modules/sys/authority/service/user-service.js';
import { BasicController } from '../../basic/code-controller.js';
/**
* 通知
*/
@Provide()
@Controller('/api/basic/user')
export class BasicUserController extends BasicController {
@Inject()
service: UserService;
@Inject()
authService: AuthService;
getService(): UserService {
return this.service;
}
@Post('/getSimpleUserByIds', { summary: Constants.per.authOnly })
async getSimpleUserByIds(@Body('ids') ids: number[]) {
if(!isEnterprise()){
throw new Error('非企业模式不能获取用户信息');
}
const users = await this.service.find({
select: {
id: true,
username: true,
nickName: true,
mobile: true,
phoneCode: true,
},
where: {
id: In(ids),
},
});
return this.ok(users);
}
@Post('/getSimpleUsers', {summary: Constants.per.authOnly})
async getSimpleUsers() {
if(!isEnterprise()){
throw new Error('非企业模式不能获取所有用户信息');
}
const users = await this.service.find({
select: {
id: true,
username: true,
nickName: true,
mobile: true,
phoneCode: true,
},
});
return this.ok(users);
}
}