This commit is contained in:
2025-12-23 22:47:20 +03:30
parent 3a9d58ae94
commit 7504ea7e98
3 changed files with 77 additions and 0 deletions
+6
View File
@@ -64,6 +64,12 @@ namespace xIdentityService.Constants
SetAvatar,
#endregion
//
#region Search ...
[StringValue("Account/OpenToSearch/Query")]
QueryOpenToSearchProfiles,
#endregion
//
#region Registration ...
[StringValue("Account/CanRegisterUserName/{userName}")]
+14
View File
@@ -122,6 +122,20 @@ namespace xIdentityService.Interfaces
);
#endregion
//
#region Search ...
/// <summary>
/// Query Open To Search User Profiles ...
/// </summary>
/// <param name="tokens">requested user's identifiers</param>
/// <param name="query">how to filter results based on <see>XQuery</see> structure</param>
/// <returns>an instance of <see>XQueryResult</see> of <see>XUserProfileDto</see></returns>
Task<XQueryResult<XUserProfileDto>> QueryOpenToSearchUsers(
XTokenResponse tokens,
XQuery query
);
#endregion
//
#region Registration ...
Task<bool> CanRegister(string userSelectByParam);
+57
View File
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using xHttpService.Constants;
using xHttpService.Extensions;
using xIdentityModels.Dtos;
using xIdentityModels.Models;
using xIdentityService.Constants;
using xModels.Dtos;
namespace xIdentityService.Providers
{
public partial class XIdentityProvider
{
//
#region Actions ...
/// <summary>
/// Query Open To Search User Profiles ...
/// </summary>
/// <param name="tokens">requested user's identifiers</param>
/// <param name="query">how to filter results based on <see>XQuery</see> structure</param>
/// <returns>an instance of <see>XQueryResult</see> of <see>XUserProfileDto</see></returns>
public async Task<XQueryResult<XUserProfileDto>> QueryOpenToSearchUsers(
XTokenResponse tokens,
XQuery query
)
{
//
// Validate Args ...
await validationProvider
.GroupValidationBuilder()
.AddNotNull(tokens, query)
.AddNotEmpty(tokens.AccessToken)
.ValidateGroupAsync();
//
var client = GetRestClient(tokens);
//
var request = GetRestRequet(XApiAccountEndpoint.QueryOpenToSearchProfiles);
//
// Attach XQuery to Request ...
request = request.AttachXQuery(query);
//
var response = await RunRestRequest<XQueryResult<XUserProfileDto>>(
client,
request,
XHttpMethod.GET
);
return response;
}
#endregion
}
}