Skip to content

Commit

Permalink
EPMRPP-89420 implement organizations sort and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Feb 27, 2024
1 parent 47c516c commit 10e04ac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
*/


import com.epam.ta.reportportal.entity.enums.OrganizationType;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
Expand All @@ -36,15 +38,23 @@
public class OrganizationResource {

@NotNull
@JsonProperty(value = "organizationId", required = true)
private Long organizationId;
@JsonProperty(value = "id", required = true)
private Long id;

@NotNull
@JsonProperty(value = "organizationName", required = true)
private String organizationName;
@JsonProperty(value = "name", required = true)
private String name;

@NotNull
@JsonProperty(value = "organizationSlug", required = true)
private String organizationSlug;
@JsonProperty(value = "slug", required = true)
private String slug;

@NotNull
@JsonProperty(value = "type", required = true)
private OrganizationType type;

@NotNull
@JsonProperty(value = "creationDate", required = true)
private Date creationDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author Andrei Piankouski
*/
@RestController
@RequestMapping("/organization")
@RequestMapping("/v1/organization")
public class OrganizationController {

private final GetOrganizationHandler getOrganizationHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.epam.ta.reportportal.ws.converter.converters;

import static com.epam.ta.reportportal.commons.EntityUtils.TO_DATE;

import com.epam.ta.reportportal.entity.organization.Organization;
import com.epam.ta.reportportal.model.OrganizationResource;
import java.util.function.Function;
Expand All @@ -30,13 +32,15 @@ private OrganizationConverter() {
}


public static final Function<Organization, OrganizationResource> TO_ORGANIZATION_RESOURCE = org -> {

OrganizationResource orgResource = new OrganizationResource();
orgResource.setOrganizationId(org.getId());
orgResource.setOrganizationName(org.getName());
orgResource.setOrganizationSlug(org.getSlug());
public static final Function<Organization, OrganizationResource> TO_ORGANIZATION_RESOURCE =
org -> {
OrganizationResource orgResource = new OrganizationResource();
orgResource.setId(org.getId());
orgResource.setName(org.getName());
orgResource.setSlug(org.getSlug());
orgResource.setType(org.getOrganizationType());
orgResource.setCreationDate(TO_DATE.apply(org.getCreationDate()));

return orgResource;
};
return orgResource;
};
}

0 comments on commit 10e04ac

Please sign in to comment.