com.arextest.web.model.mapper.UserMapperImpl Maven / Gradle / Ivy
The newest version!
package com.arextest.web.model.mapper;
import com.arextest.web.model.contract.contracts.login.ModifyUserFavoriteAppRequestType;
import com.arextest.web.model.contract.contracts.login.QueryUserFavoriteAppResponseType;
import com.arextest.web.model.contract.contracts.login.UpdateUserProfileRequestType;
import com.arextest.web.model.contract.contracts.login.UserProfileResponseType;
import com.arextest.web.model.dao.mongodb.UserCollection;
import com.arextest.web.model.dto.UserDto;
import java.util.ArrayList;
import java.util.List;
/*
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-12-23T06:09:22+0000",
comments = "version: 1.5.5.Final, compiler: javac, environment: Java 21.0.5 (Eclipse Adoptium)"
)
*/
public class UserMapperImpl implements UserMapper {
@Override
public UserDto dtoFromDao(UserCollection dao) {
if ( dao == null ) {
return null;
}
UserDto userDto = new UserDto();
userDto.setId( dao.getId() );
userDto.setUserName( dao.getUserName() );
userDto.setVerificationCode( dao.getVerificationCode() );
userDto.setVerificationTime( dao.getVerificationTime() );
userDto.setProfile( dao.getProfile() );
List list = dao.getFavoriteApps();
if ( list != null ) {
userDto.setFavoriteApps( new ArrayList( list ) );
}
userDto.setStatus( dao.getStatus() );
return userDto;
}
@Override
public UserProfileResponseType contractFromDto(UserDto dto) {
if ( dto == null ) {
return null;
}
UserProfileResponseType userProfileResponseType = new UserProfileResponseType();
userProfileResponseType.setUserName( dto.getUserName() );
userProfileResponseType.setProfile( dto.getProfile() );
return userProfileResponseType;
}
@Override
public UserDto dtoFromContract(UpdateUserProfileRequestType request) {
if ( request == null ) {
return null;
}
UserDto userDto = new UserDto();
userDto.setUserName( request.getUserName() );
userDto.setProfile( request.getProfile() );
return userDto;
}
@Override
public QueryUserFavoriteAppResponseType queryUserFavoriteAppFromDto(UserDto dto) {
if ( dto == null ) {
return null;
}
QueryUserFavoriteAppResponseType queryUserFavoriteAppResponseType = new QueryUserFavoriteAppResponseType();
queryUserFavoriteAppResponseType.setUserName( dto.getUserName() );
List list = dto.getFavoriteApps();
if ( list != null ) {
queryUserFavoriteAppResponseType.setFavoriteApps( new ArrayList( list ) );
}
return queryUserFavoriteAppResponseType;
}
@Override
public UserDto dtoFromModifyUserFavoriteApp(ModifyUserFavoriteAppRequestType request) {
if ( request == null ) {
return null;
}
UserDto userDto = new UserDto();
userDto.setUserName( request.getUserName() );
return userDto;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy