reverse
This commit is contained in:
parent
ae07699006
commit
9d167d0050
3 changed files with 20 additions and 20 deletions
|
|
@ -32,7 +32,7 @@ export class PermissionController extends Controller {
|
|||
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||
private redis = require("redis");
|
||||
|
||||
@Get("list")
|
||||
@Get("")
|
||||
public async getPermission(@Request() request: RequestWithUser) {
|
||||
const redisClient = await this.redis.createClient({
|
||||
host: REDIS_HOST,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import { Profile } from "../entities/Profile";
|
|||
import { viewRegistryOfficer } from "../entities/view/viewRegistryOfficer";
|
||||
import { viewRegistryEmployee } from "../entities/view/viewRegistryEmployee";
|
||||
import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster";
|
||||
import { sendWebSocket } from "../services/webSocket";
|
||||
// import { sendWebSocket } from "../services/webSocket";
|
||||
|
||||
@Route("api/v1/org/report")
|
||||
@Tags("Report")
|
||||
|
|
@ -3538,10 +3538,10 @@ export class ReportController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
const metaData = { template: "report2", reportName: "report2", data: { data } };
|
||||
sendWebSocket(metaData)
|
||||
// const metaData = { template: "report2", reportName: "report2", data: { data } };
|
||||
// sendWebSocket(metaData)
|
||||
|
||||
// return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
|
||||
return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { WebSocket } from "ws";
|
||||
import { wss } from "../app";
|
||||
// import { WebSocket } from "ws";
|
||||
// import { wss } from "../app";
|
||||
|
||||
export async function sendWebSocket(data:any){
|
||||
wss.clients.forEach((client: any) => {
|
||||
if (client.readyState === WebSocket.OPEN) {
|
||||
const message = JSON.stringify(data);
|
||||
console.log("📤 Sending data to client:", message);
|
||||
client.send(message, (err:any) => {
|
||||
if (err) {
|
||||
console.error("❌ Error sending message:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// export async function sendWebSocket(data:any){
|
||||
// wss.clients.forEach((client: any) => {
|
||||
// if (client.readyState === WebSocket.OPEN) {
|
||||
// const message = JSON.stringify(data);
|
||||
// console.log("📤 Sending data to client:", message);
|
||||
// client.send(message, (err:any) => {
|
||||
// if (err) {
|
||||
// console.error("❌ Error sending message:", err);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
Loading…
Add table
Add a link
Reference in a new issue