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