Table of Contents

Class UsersController

Namespace
Builvero.Api.Controllers
Assembly
Builvero.Api.dll

Provides API endpoints for searching and retrieving user profiles.

[ApiController]
[Route("api/users")]
[Authorize]
public class UsersController : ControllerBase
Inheritance
UsersController
Inherited Members

Remarks

All endpoints require authentication (JWT token). This controller provides:

  • Searching users by name, skills, or other criteria with pagination
  • Retrieving detailed user profile information

Search results and profile data are filtered based on the requesting user's role. Regular users see limited information, while admins and moderators may see additional details. Profile photo URLs are automatically converted to presigned URLs (15-minute TTL) for secure access.

Constructors

UsersController(IUserSearchService)

Initializes a new instance of the UsersController class.

public UsersController(IUserSearchService userSearchService)

Parameters

userSearchService IUserSearchService

Service for user search operations.

Methods

GetUserProfile(Guid, CancellationToken)

Retrieves detailed profile information for a specific user.

[HttpGet("{id}")]
public Task<ActionResult<UserSearchResultDto>> GetUserProfile(Guid id, CancellationToken cancellationToken)

Parameters

id Guid

The unique identifier of the user whose profile to retrieve.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<UserSearchResultDto>>

200 OK: Returns UserSearchResultDto with complete user profile information

404 Not Found: User not found

400 Bad Request: Error retrieving user profile

Remarks

Requires authentication. Returns detailed profile information including skills, builder tags, education, and work experience. The amount of information returned depends on the requesting user's role. Profile photo URLs are converted to presigned URLs (15-minute TTL) for secure access.

SearchUsers(UserSearchRequest, CancellationToken)

Searches for users with pagination and optional filtering.

[HttpGet("search")]
public Task<ActionResult<object>> SearchUsers(UserSearchRequest request, CancellationToken cancellationToken)

Parameters

request UserSearchRequest

The search request containing search term, pagination parameters, and optional filters.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ActionResult<object>>

200 OK: Returns { "users": [...], "totalCount": int, "page": int, "pageSize": int }

400 Bad Request: Error searching users

Remarks

Requires authentication. Supports searching by name, skills, and other criteria. Search is case-insensitive. Results are filtered based on the requesting user's role. Regular users see limited information, while admins and moderators may see additional details. Profile photo URLs are converted to presigned URLs.