85 lines
2.4 KiB
Plaintext
85 lines
2.4 KiB
Plaintext
|
|
### FILE: C:\Users\hkhazaeeasl\Documents\Projets\XProjects\xSaherelmWorkspace\Modules\xAiService\Constants\ConfigurationNodeNames.cs
|
|
|
|
namespace xAiService.Constants
|
|
{
|
|
public partial struct ConfigurationNodeNames
|
|
{
|
|
public const string AI_SERVICE_NODE = "AIServiceConfiguration";
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\hkhazaeeasl\Documents\Projets\XProjects\xSaherelmWorkspace\Modules\xAiService\Constants\XAiServiceConstants.cs
|
|
|
|
namespace xAiService.Constants
|
|
{
|
|
public struct XAiServiceConstants
|
|
{
|
|
//
|
|
// Service Extensions Log Tag ...
|
|
public const string XAiServiceDILogTag = "XAiService";
|
|
|
|
//
|
|
// File Provider Identifiers ...
|
|
public const string XAiProjectFilesIdentifier = "AiPrjF";
|
|
public const string XAiMessageFilesIdentifier = "AiMsgF";
|
|
public const string XMetaDataFileIdsIdentifier = "FileIds";
|
|
public const string XAiConversationFilesIdentifier = "AiCnvrF";
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\hkhazaeeasl\Documents\Projets\XProjects\xSaherelmWorkspace\Modules\xAiService\DI\XDIHelperExtension.cs
|
|
|
|
namespace xAiService.DI
|
|
{
|
|
public static partial class XDIHelperExtension
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\hkhazaeeasl\Documents\Projets\XProjects\xSaherelmWorkspace\Modules\xAiService\Extensions\XAiServiceExtensions.cs
|
|
|
|
using xCommons.Extensions;
|
|
using xExceptions.Constants;
|
|
using xIdentityModels.Models;
|
|
|
|
namespace xAiService.Extensions
|
|
{
|
|
public static class XAiServiceExtensions
|
|
{
|
|
/// <summary>
|
|
/// Validate User Info ...
|
|
/// </summary>
|
|
/// <param name="source"></param>
|
|
/// <returns></returns>
|
|
public static bool IsValid(this XUserClaimsInfoDto source)
|
|
{
|
|
//
|
|
var result =
|
|
!source.IsNullOrDefault() &&
|
|
!source.UserId.IsNullOrEmpty() &&
|
|
!source.AccessToken.IsNullOrEmpty();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validate User Info ...
|
|
/// </summary>
|
|
/// <param name="source"></param>
|
|
/// <param name="invalidException"></param>
|
|
public static void Validate(
|
|
this XUserClaimsInfoDto source,
|
|
XException invalidException = XException.InvalidArgs
|
|
)
|
|
{
|
|
//
|
|
var isValid = source.IsValid();
|
|
if (!isValid)
|
|
{
|
|
invalidException.Throw();
|
|
}
|
|
}
|
|
}
|
|
}
|