This commit is contained in:
root 2025-07-12 23:21:56 +08:00
parent ca779ce66b
commit 89279259de
1 changed files with 8 additions and 21 deletions

View File

@ -230,7 +230,7 @@ export class ResourceCategoryServiceV2 {
ai_prompt: updates.ai_prompt,
color: updates.color,
is_active: updates.is_active,
user_id: userId || this.defaultUserId,
user_id: userId || this.getCurrentUserId(),
verbose: false,
json_output: true
}
@ -257,7 +257,7 @@ export class ResourceCategoryServiceV2 {
const params: CategoryDeleteRequest = {
category_id: categoryId,
hard_delete: hardDelete,
user_id: userId || this.defaultUserId,
user_id: userId || this.getCurrentUserId(),
verbose: false,
json_output: true
}
@ -283,7 +283,7 @@ export class ResourceCategoryServiceV2 {
try {
const params: CategorySearchRequest = {
query,
user_id: this.defaultUserId,
user_id: this.getCurrentUserId(),
include_cloud: true,
limit: 50,
verbose: false,
@ -312,7 +312,7 @@ export class ResourceCategoryServiceV2 {
try {
const params: CategoryColorRequest = {
color,
user_id: this.defaultUserId,
user_id: this.getCurrentUserId(),
include_cloud: true,
limit: 50,
verbose: false,
@ -366,7 +366,7 @@ export class ResourceCategoryServiceV2 {
try {
const params: CategoryBatchCreateRequest = {
categories,
user_id: userId || this.defaultUserId,
user_id: userId || this.getCurrentUserId(),
verbose: false,
json_output: true
}
@ -391,7 +391,7 @@ export class ResourceCategoryServiceV2 {
static async getCategoryCount(includeCloud = true, userId?: string): Promise<number> {
try {
const params: CategoryListRequest = {
user_id: userId || this.defaultUserId,
user_id: userId || this.getCurrentUserId(),
include_cloud: includeCloud,
verbose: false,
json_output: true
@ -418,7 +418,7 @@ export class ResourceCategoryServiceV2 {
try {
const params: CategoryGetRequest = {
category_id: categoryId,
user_id: userId || this.defaultUserId,
user_id: userId || this.getCurrentUserId(),
verbose: false,
json_output: true
}
@ -444,7 +444,7 @@ export class ResourceCategoryServiceV2 {
try {
const params: CategoryGetRequest = {
category_id: categoryId,
user_id: userId || this.defaultUserId,
user_id: userId || this.getCurrentUserId(),
verbose: false,
json_output: true
}
@ -463,17 +463,4 @@ export class ResourceCategoryServiceV2 {
}
}
/**
* ID
*/
static setDefaultUserId(userId: string) {
this.defaultUserId = userId
}
/**
* ID
*/
static getDefaultUserId(): string {
return this.defaultUserId
}
}