work on qm and added disabled to operetions
This commit is contained in:
parent
2011c4c83f
commit
38bd15cad8
8 changed files with 67 additions and 181 deletions
|
|
@ -87,15 +87,26 @@ export function QueueSchedule(
|
|||
}
|
||||
|
||||
/**
|
||||
* Disabled decorator - marks a handler as disabled for auto-registration
|
||||
* Handlers marked with @Disabled() will be skipped during auto-registration
|
||||
* Disabled decorator - marks a handler or operation as disabled
|
||||
* Can be used on:
|
||||
* - Classes: Entire handler will be skipped during auto-registration
|
||||
* - Methods: Individual operations will be skipped during registration
|
||||
*/
|
||||
export function Disabled() {
|
||||
return function <T extends { new (...args: any[]): {} }>(target: T, _context?: any) {
|
||||
// Store disabled flag on the constructor
|
||||
(target as any).__disabled = true;
|
||||
|
||||
return target;
|
||||
return function (target: any, propertyKey?: string, descriptor?: PropertyDescriptor): any {
|
||||
if (propertyKey) {
|
||||
// Method decorator - mark specific operation as disabled
|
||||
const constructor = target.constructor;
|
||||
if (!constructor.__disabledOperations) {
|
||||
constructor.__disabledOperations = [];
|
||||
}
|
||||
constructor.__disabledOperations.push(propertyKey);
|
||||
return descriptor;
|
||||
} else {
|
||||
// Class decorator - mark entire handler as disabled
|
||||
(target as any).__disabled = true;
|
||||
return target;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue