mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
Use Java 8 style annotations
This commit is contained in:
@@ -5,17 +5,15 @@ import org.mapstruct.AfterMapping;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.Mappings;
|
||||
import sonia.scm.group.Group;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mapper
|
||||
public abstract class GroupDtoToGroupMapper {
|
||||
@Mappings({
|
||||
@Mapping(target = "creationDate", ignore = true),
|
||||
@Mapping(target = "lastModified", ignore = true)
|
||||
})
|
||||
|
||||
@Mapping(target = "creationDate", ignore = true)
|
||||
@Mapping(target = "lastModified", ignore = true)
|
||||
public abstract Group map(GroupDto groupDto);
|
||||
|
||||
@AfterMapping
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import org.apache.shiro.authc.credential.PasswordService;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.Context;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Named;
|
||||
import sonia.scm.user.User;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -18,11 +21,9 @@ public abstract class UserDtoToUserMapper {
|
||||
@Inject
|
||||
private PasswordService passwordService;
|
||||
|
||||
@Mappings({
|
||||
@Mapping(source = "password", target = "password", qualifiedByName = "encrypt"),
|
||||
@Mapping(target = "creationDate", ignore = true),
|
||||
@Mapping(target = "lastModified", ignore = true)
|
||||
})
|
||||
@Mapping(source = "password", target = "password", qualifiedByName = "encrypt")
|
||||
@Mapping(target = "creationDate", ignore = true)
|
||||
@Mapping(target = "lastModified", ignore = true)
|
||||
public abstract User map(UserDto userDto, @Context String originalPassword);
|
||||
|
||||
@Named("encrypt")
|
||||
|
||||
Reference in New Issue
Block a user