From 05c74a836f93b92da634c8b8f6a480f0137b4254 Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:15:58 +0300 Subject: [PATCH] EPMRPP- 95615 new users endpoint (#1057) * EPMRPP-95615 support full_name criteria --- .../ta/reportportal/binary/impl/DataStoreUtils.java | 2 +- .../reportportal/commons/querygen/FilterTarget.java | 13 +++++++++++++ .../querygen/constant/UserCriteriaConstant.java | 10 +++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java b/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java index 2876fb1eb..98ce5c2a6 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java @@ -41,7 +41,7 @@ public class DataStoreUtils { static final String ROOT_USER_PHOTO_DIR = "users"; - static final String ATTACHMENT_CONTENT_TYPE = "attachmentContentType"; + public static final String ATTACHMENT_CONTENT_TYPE = "attachmentContentType"; static final String PROJECT_PATH = "project-data"; diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index 6736a9351..cb73123f6 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -106,11 +106,15 @@ import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_UNIQUE_ID; import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_UUID; import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.RETRY_PARENT; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_ACCOUNT_TYPE; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_ACTIVE; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EMAIL; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EXPIRED; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EXTERNALID; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EXTERNAL_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_FULLNAME; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_FULL_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_INSTANCE_ROLE; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_LAST_LOGIN; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_ROLE; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_SYNCHRONIZATION_DATE; @@ -378,14 +382,21 @@ protected Field idField() { new CriteriaHolderBuilder().newBuilder(CRITERIA_UUID, USERS.UUID, UUID.class).get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_EXTERNAL_ID, USERS.EXTERNAL_ID, String.class) .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_EXTERNALID, USERS.EXTERNAL_ID, String.class) + .get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTIVE, USERS.ACTIVE, Boolean.class) .get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class).get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_EMAIL, USERS.EMAIL, String.class).get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_FULL_NAME, USERS.FULL_NAME, String.class) .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_FULLNAME, USERS.FULL_NAME, String.class) + .get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_ROLE, USERS.ROLE, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_INSTANCE_ROLE, USERS.ROLE, String.class) + .get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_TYPE, USERS.TYPE, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ACCOUNT_TYPE, USERS.TYPE, String.class).get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_EXPIRED, USERS.EXPIRED, Boolean.class).get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, PROJECT_USER.PROJECT_ID, Long.class).get(), @@ -416,6 +427,8 @@ protected Collection selectFields() { USERS.ACTIVE, USERS.FULL_NAME, USERS.TYPE, + USERS.CREATED_AT, + USERS.UPDATED_AT, USERS.ATTACHMENT, USERS.ATTACHMENT_THUMBNAIL, USERS.EMAIL, diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java index 5c4a6830d..14805b522 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java @@ -21,14 +21,18 @@ */ public final class UserCriteriaConstant { - public static final String CRITERIA_EXTERNAL_ID = "externalId"; + public static final String CRITERIA_EXTERNALID = "externalId"; // TODO: for removal + public static final String CRITERIA_EXTERNAL_ID = "external_id"; public static final String CRITERIA_ACTIVE = "active"; public static final String CRITERIA_USER = "user"; public static final String CRITERIA_ROLE = "role"; - public static final String CRITERIA_TYPE = "type"; - public static final String CRITERIA_FULL_NAME = "fullName"; + public static final String CRITERIA_INSTANCE_ROLE = "instance_role"; // TODO: for removal + public static final String CRITERIA_TYPE = "type"; // TODO: for removal + public static final String CRITERIA_ACCOUNT_TYPE = "account_type"; + public static final String CRITERIA_FULL_NAME = "fullName"; // TODO: for removal + public static final String CRITERIA_FULLNAME = "full_name"; public static final String CRITERIA_EMAIL = "email"; public static final String CRITERIA_EXPIRED = "expired"; public static final String CRITERIA_LAST_LOGIN = "lastLogin";