mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Change event attribute mapping logic and error handling
Event attribute mapping logic was moved to service layer from the api layer and a created a meaningful error message.
This commit is contained in:
parent
da2d95e7ac
commit
e643db08d1
@ -607,18 +607,18 @@ public class AnalyticsArtifactsManagementServiceImpl
|
||||
}
|
||||
|
||||
/**
|
||||
* This will set payload of event attributes to the DTO
|
||||
* This will set payload of event attribute's mapping to the DTO
|
||||
*
|
||||
* @param attributes list of event attributes
|
||||
* @return DTO with all the event attributes
|
||||
*/
|
||||
private EventStreamAttributeDto[] addEventAttributesToDto(List<Attribute> attributes) {
|
||||
EventStreamAttributeDto[] eventStreamAttributeDtos = new EventStreamAttributeDto[attributes.size()];
|
||||
for (int i = 0; i < attributes.size(); i++) {
|
||||
for (Attribute attribute : attributes) {
|
||||
EventStreamAttributeDto eventStreamAttributeDto = new EventStreamAttributeDto();
|
||||
eventStreamAttributeDto.setAttributeName(attributes.get(i).getName());
|
||||
eventStreamAttributeDto.setAttributeType(attributes.get(i).getType().toString());
|
||||
eventStreamAttributeDtos[i] = eventStreamAttributeDto;
|
||||
eventStreamAttributeDto.setAttributeName(attribute.getName());
|
||||
eventStreamAttributeDto.setAttributeType(attribute.getType().toString());
|
||||
|
||||
}
|
||||
return eventStreamAttributeDtos;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user