Skip to content

Develop#9

Merged
Codespilot merged 2 commits into
mainfrom
develop
May 26, 2026
Merged

Develop#9
Codespilot merged 2 commits into
mainfrom
develop

Conversation

@Codespilot

Copy link
Copy Markdown
Member

No description provided.

…eation and password change, and update UserApplicationService with async methods for user operations
…tration and password change; improve mapping configurations for user roles and authorities
Copilot AI review requested due to automatic review settings May 26, 2026 02:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to extend the identity service with initial “account/user” application APIs (register/profile/password change), expands the User creation domain event payload, and relocates token-grant DTOs into the application layer.

Changes:

  • Added UserApplicationService APIs and an AccountController with endpoints for registration, profile retrieval, and password change.
  • Updated domain user creation to accept nickname/email/phone and emit an expanded UserCreatedEvent.
  • Moved TokenGrantRequestDto/TokenGrantResponseDto usage from interfaces.dto to application.dto, updating controllers/services accordingly.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
identity/src/main/java/io/theurl/identity/persistence/repository/UserRepositoryImpl.java Adds JPA EntityManager injection and modifies findByAnyOf mapping logic.
identity/src/main/java/io/theurl/identity/persistence/query/UserDetailQuery.java Introduces a mediator query type for user profile details.
identity/src/main/java/io/theurl/identity/persistence/profile/UserMapProfile.java Expands ModelMapper mappings/providers for User, UserRole, and UserAuthority.
identity/src/main/java/io/theurl/identity/persistence/model/UserDetail.java Adds a persistence model intended for profile/detail reads.
identity/src/main/java/io/theurl/identity/interfaces/controller/UserController.java Adds a controller scaffold wired to UserApplicationService.
identity/src/main/java/io/theurl/identity/interfaces/controller/AuthController.java Updates imports to use application-layer token DTOs.
identity/src/main/java/io/theurl/identity/interfaces/controller/AccountController.java Adds account endpoints (register/profile/password change).
identity/src/main/java/io/theurl/identity/domain/event/UserUnlockedEvent.java Makes the event class final and removes a no-op override.
identity/src/main/java/io/theurl/identity/domain/event/UserCreatedEvent.java Expands event payload fields and switches to Lombok constructor generation.
identity/src/main/java/io/theurl/identity/domain/aggregate/User.java Updates User.create(...) signature and raises expanded UserCreatedEvent.
identity/src/main/java/io/theurl/identity/application/implement/UserApplicationServiceImpl.java Implements create/profile/password-change orchestration via mediator.
identity/src/main/java/io/theurl/identity/application/implement/AuthApplicationServiceImpl.java Updates imports to use application-layer token DTOs.
identity/src/main/java/io/theurl/identity/application/handler/UserCreateCommandHandler.java Uses the updated User.create(...) API.
identity/src/main/java/io/theurl/identity/application/dto/UserProfileResponseDto.java Adds a response DTO placeholder for profile API.
identity/src/main/java/io/theurl/identity/application/dto/UserPasswordChangeRequestDto.java Adds DTO for password change requests.
identity/src/main/java/io/theurl/identity/application/dto/UserCreateRequestDto.java Adds DTO for user creation requests.
identity/src/main/java/io/theurl/identity/application/dto/TokenGrantResponseDto.java Changes package to application.dto.
identity/src/main/java/io/theurl/identity/application/dto/TokenGrantRequestDto.java Changes package to application.dto.
identity/src/main/java/io/theurl/identity/application/contract/UserApplicationService.java Defines async user APIs (create/profile/password change).
identity/src/main/java/io/theurl/identity/application/contract/AuthApplicationService.java Updates imports to use application-layer token DTOs.
framework/src/main/java/io/theurl/framework/configure/MediatorConfiguration.java Minor refactor of async event publishing lambda.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 72 to +76
return repository.findByAnyOf(username, email, phone)
.map(entity -> mapper.map(entity, User.class))
.map(entity ->{
System.out.println(entity);
return mapper.map(entity, User.class);
})
Comment on lines +19 to +20
@PersistenceContext
private EntityManager context;
Comment on lines +38 to +41
public CompletableFuture<UserProfileResponseDto> getProfileAsync() {
var query = new UserDetailQuery(1L);
return mediator.executeAsync(query)
.thenApply(userDetail -> mapper.map(userDetail, UserProfileResponseDto.class));

@Override
public CompletableFuture<Void> changePasswordAsync(String oldPassword, String newPassword) {
mediator.executeAsync(new UserAuthInfoQuery("id", ""))
Comment on lines +62 to +63
var command = new UserPasswordChangeCommand(1L, newPassword, "change");
return mediator.sendAsync(command);
if (phone != null && !phone.isEmpty()) {
user.setPhone(phone);
}
user.raiseEvent(new UserCreatedEvent(username, nickname, email, phone));
@@ -0,0 +1,4 @@
package io.theurl.identity.persistence.model;

public class UserDetail {
Comment on lines +2 to +3

public class UserProfileResponseDto {
Comment on lines +3 to +20
import io.theurl.identity.application.contract.UserApplicationService;
import io.theurl.identity.application.dto.UserCreateRequestDto;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {
private final UserApplicationService service;

public UserController(UserApplicationService service) {
this.service = service;
}


@Codespilot Codespilot merged commit 047c919 into main May 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants