com.payu.notification.client.mapper.MboaSmsMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ms-notification-client Show documentation
Show all versions of ms-notification-client Show documentation
Module client du micro service notification
The newest version!
package com.payu.notification.client.mapper;
import com.payu.notification.client.mboasms.request.MboaSmsRequest;
import com.payu.notification.client.mboasms.response.MboaSmsResponse;
import com.payu.notification.client.model.enums.SmsStatus;
import com.payu.notification.client.model.request.SmsRequest;
import com.payu.notification.client.model.response.SmsResponse;
import java.util.List;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
@Mapper(componentModel = "spring")
public interface MboaSmsMapper {
@Mapping(source = "phoneNumberList", target = "phoneNumbers", qualifiedByName = "getPhoneNumbers")
MboaSmsRequest toMboaSmsRequest(SmsRequest smsRequest);
@Mapping(source = "success", target = "status", qualifiedByName = "getStatus")
SmsResponse toSmsResponse(MboaSmsResponse mboaSmsResponse);
@Named("getStatus")
public static SmsStatus getStatus(boolean success) {
return success ? SmsStatus.SUCCESS : SmsStatus.FAILED;
}
@Named("getPhoneNumbers")
public static String getPhoneNumbers(List phoneNumberList) {
return String.join(",", phoneNumberList);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy