MicronautUserController

@ExecuteOn(value = "blocking")
@Controller(value = "/users/")
class MicronautUserController(services: UserServices, paymentClient: PaymentService, emailConfirmationKafkaClient: EmailConfirmationClient) : UserAPI.GetUserAPI<HttpResponse<GetUserResponse>> , UserAPI.RegisterUserAPI<HttpResponse<RegisterUserResponse>> , UserAPI.LoginUserAPI<HttpResponse<LoginUserResponse>> , UserAPI.UpdateUserPasswordAPI<HttpResponse<UpdateUserPasswordResponse>> , UserAPI.UpdateUserInfoAPI<HttpResponse<UpdateUserInfoResponse>> , UserAPI.DeleteUserAPI<HttpResponse<DeleteUserResponse>> , UserAPI.EmailVerificationAPI<HttpResponse<VerifyEmailResponse>>

Micronaut HTTP controller for the user-service inbound web adapter.

This controller exposes user-related HTTP endpoints and delegates business operations to application inbound ports. It is responsible for:

  • validating incoming request payloads at the HTTP boundary

  • mapping DTOs to domain objects via UserDTOFactory

  • translating use-case results into HTTP response codes and messages

The controller intentionally avoids domain logic so the application and domain layers remain independent from transport concerns.

Constructors

Link copied to clipboard
constructor(services: UserServices, paymentClient: PaymentService, emailConfirmationKafkaClient: EmailConfirmationClient)

Functions

Link copied to clipboard
@Delete(value = "{id}/")
open override fun deleteUser(@PathVariable id: String): HttpResponse<DeleteUserResponse>

Handles DELETE users/{id}/.

Link copied to clipboard
@Get(value = "/")
fun get(): HttpResponse<ProcessPaymentResponse>

Lightweight diagnostic endpoint that exercises the payment client.

Link copied to clipboard
@Get(value = "{id}/")
open override fun getUser(@PathVariable id: String): HttpResponse<GetUserResponse>

Handles GET users/{id}/.

Link copied to clipboard
@Post(value = "login/")
open override fun loginUser(@Body request: LoginUserRequest): HttpResponse<LoginUserResponse>

Handles POST users/login/.

Link copied to clipboard
@Post(value = "register/")
open override fun registerUser(@Body request: RegisterUserRequest): HttpResponse<RegisterUserResponse>

Handles POST users/register/.

Link copied to clipboard
@Patch(value = "update-info/")
open override fun updateUserInfo(@Body request: UpdateUserInfoRequest): HttpResponse<UpdateUserInfoResponse>

Handles PATCH users/update-info/.

Link copied to clipboard
@Patch(value = "update-password/")
open override fun updateUserPassword(@Body request: UpdateUserPasswordRequest): HttpResponse<UpdateUserPasswordResponse>

Handles POST users/update-password/.

Link copied to clipboard
@Get(value = "verify-email/")
open override fun verifyEmail(@Body request: VerifyEmailRequest): HttpResponse<VerifyEmailResponse>

Handles email verification using the one-time key received by the user.