Search in sources :

Example 76 with ModelMapper

use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.

the class Translators method translate.

public static UsersEntity translate(CreateUserRequest x) {
    final ModelMapper modelMapper = new ModelMapper();
    final UsersEntity user = modelMapper.map(x, UsersEntity.class);
    return user;
}
Also used : UsersEntity(it.istat.mec.users.domain.UsersEntity) ModelMapper(org.modelmapper.ModelMapper)

Example 77 with ModelMapper

use of org.modelmapper.ModelMapper in project catalogo-strumenti by istat-methodology.

the class Translators method translate.

public static UsersDto translate(Optional<UsersEntity> optional) {
    final ModelMapper modelMapper = new ModelMapper();
    final UsersDto dTO = modelMapper.map(optional, UsersDto.class);
    return dTO;
}
Also used : UsersDto(it.istat.mec.users.dto.UsersDto) ModelMapper(org.modelmapper.ModelMapper)

Example 78 with ModelMapper

use of org.modelmapper.ModelMapper in project spring-boot-backend-template by paakmau.

the class BookServiceTests method initAll.

@BeforeAll
static void initAll() {
    ModelMapper modelMapper = new ModelMapper();
    books = Arrays.asList(new Book(1L, "Book 1", "Author 1"), new Book(2L, "Book 2", "Author 2"), new Book(3L, "Book 3", "Author 3"));
    bookDtos = books.stream().map(b -> modelMapper.map(b, BookDto.class)).collect(Collectors.toList());
}
Also used : BookDto(com.example.demo.dto.BookDto) Book(com.example.demo.entity.Book) ModelMapper(org.modelmapper.ModelMapper) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 79 with ModelMapper

use of org.modelmapper.ModelMapper in project paascloud-master by paascloud.

the class UacLogServiceImpl method saveOperationLog.

@Override
public Integer saveOperationLog(OperationLogDto operationLogDto) {
    // 根据uri 查询url对应的权限
    UacAction uacAction = uacActionService.matchesByUrl(operationLogDto.getRequestUrl());
    if (uacAction != null) {
        operationLogDto.setActionCode(uacAction.getActionCode());
        operationLogDto.setActionName(uacAction.getActionName());
        operationLogDto.setActionId(uacAction.getId());
    }
    ModelMapper modelMapper = new ModelMapper();
    UacLog uacLog = modelMapper.map(operationLogDto, UacLog.class);
    uacLog.setId(generateId());
    // 获取操作位置
    String locationById = opcRpcService.getLocationById(operationLogDto.getIp());
    uacLog.setLocation(locationById);
    return uacLogMapper.insertSelective(uacLog);
}
Also used : UacAction(com.paascloud.provider.model.domain.UacAction) UacLog(com.paascloud.provider.model.domain.UacLog) ModelMapper(org.modelmapper.ModelMapper)

Example 80 with ModelMapper

use of org.modelmapper.ModelMapper in project paascloud-master by paascloud.

the class UacUserTokenServiceImpl method updateUacUserToken.

@Override
public void updateUacUserToken(UserTokenDto tokenDto, LoginAuthDto loginAuthDto) {
    UacUserToken uacUserToken = new ModelMapper().map(tokenDto, UacUserToken.class);
    uacUserToken.setUpdateInfo(loginAuthDto);
    uacUserTokenMapper.updateByPrimaryKeySelective(uacUserToken);
    OAuth2ClientProperties[] clients = securityProperties.getOauth2().getClients();
    int accessTokenValidateSeconds = clients[0].getAccessTokenValidateSeconds();
    updateRedisUserToken(uacUserToken.getAccessToken(), accessTokenValidateSeconds, tokenDto);
}
Also used : UacUserToken(com.paascloud.provider.model.domain.UacUserToken) OAuth2ClientProperties(com.paascloud.security.core.properties.OAuth2ClientProperties) ModelMapper(org.modelmapper.ModelMapper)

Aggregations

ModelMapper (org.modelmapper.ModelMapper)164 Bean (org.springframework.context.annotation.Bean)24 ArrayList (java.util.ArrayList)18 Date (java.util.Date)6 Map (java.util.Map)5 Optional (java.util.Optional)5 Actor (com.management.entities.Actor)4 CinemaTheatre (com.management.entities.CinemaTheatre)4 Event (com.management.entities.Event)4 Performance (com.management.entities.Performance)4 Props (com.management.entities.Props)4 User (com.management.entities.User)4 List (java.util.List)4 PutMessageRequestType (no.difi.meldingsutveksling.noarkexchange.schema.PutMessageRequestType)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 Actorperformances (com.management.entities.Actorperformances)3 FanZone (com.management.entities.FanZone)3 Friendslist (com.management.entities.Friendslist)3 Hall (com.management.entities.Hall)3