Merge pull request #774 from iceljc/master

add comments
This commit is contained in:
iceljc 2024-12-03 18:56:14 -06:00 committed by GitHub
commit bfdccd7b9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 0 deletions

View file

@ -15,4 +15,9 @@ public class RoleFilter
{
return new RoleFilter();
}
public bool IsInit()
{
return Names.IsNullOrEmpty();
}
}

View file

@ -1,3 +1,19 @@
/*****************************************************************************
Copyright 2024 Written by Jicheng Lu. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************/
using BotSharp.Core.Infrastructures;
namespace BotSharp.Core.SideCar.Services;

View file

@ -1,3 +1,19 @@
/*****************************************************************************
Copyright 2024 Written by Jicheng Lu. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************/
using BotSharp.Abstraction.Conversations.Enums;
namespace BotSharp.Core.Conversations.Services;

View file

@ -39,7 +39,15 @@ public class RoleService : IRoleService
public async Task<IEnumerable<Role>> GetRoles(RoleFilter filter)
{
var db = _services.GetRequiredService<IBotSharpRepository>();
var roles = db.GetRoles(filter);
if (filter.IsInit() && roles.IsNullOrEmpty())
{
await RefreshRoles();
await Task.Delay(100);
roles = db.GetRoles(filter);
}
return roles;
}

View file

@ -1,3 +1,19 @@
/*****************************************************************************
Copyright 2024 Written by Jicheng Lu. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************/
using BotSharp.Abstraction.Infrastructures.Enums;
using BotSharp.Abstraction.MLTasks;
using BotSharp.Abstraction.Options;