dotnet-user
This commit is contained in:
parent
41b5be3056
commit
0afa53889d
1 changed files with 30 additions and 3 deletions
|
|
@ -208,6 +208,33 @@ export class PermissionController extends Controller {
|
||||||
return new HttpSuccess(res);
|
return new HttpSuccess(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API permission (dotnet api)
|
||||||
|
* @summary permission (dotnet api)
|
||||||
|
* @param {string} action action
|
||||||
|
* @param {string} system authSysId
|
||||||
|
* @param {string} profileId profileId
|
||||||
|
*/
|
||||||
|
@Get("dotnet-user/{action}/{system}/{profileId}")
|
||||||
|
public async dotnetUser(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
@Path() action: string,
|
||||||
|
@Path() system: string,
|
||||||
|
@Path() profileId: string,
|
||||||
|
) {
|
||||||
|
if (!["CREATE", "DELETE", "GET", "LIST", "UPDATE"].includes(action)) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "Action ไม่ถูกต้อง");
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await new permission().PermissionOrgByUser(
|
||||||
|
req,
|
||||||
|
system.toLocaleUpperCase(),
|
||||||
|
action,
|
||||||
|
profileId,
|
||||||
|
);
|
||||||
|
return new HttpSuccess(res);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("org")
|
@Get("org")
|
||||||
public async listAuthSysOrg(@Request() request: RequestWithUser) {
|
public async listAuthSysOrg(@Request() request: RequestWithUser) {
|
||||||
const redisClient = await this.redis.createClient({
|
const redisClient = await this.redis.createClient({
|
||||||
|
|
@ -254,7 +281,7 @@ export class PermissionController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("user/{id}")
|
@Get("user/{id}")
|
||||||
public async listOrgUser(@Request() request: RequestWithUser,@Path() id: string) {
|
public async listOrgUser(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
const redisClient = await this.redis.createClient({
|
const redisClient = await this.redis.createClient({
|
||||||
host: REDIS_HOST,
|
host: REDIS_HOST,
|
||||||
port: REDIS_PORT,
|
port: REDIS_PORT,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue