Skip to content

Commit 3699ae7

Browse files
committed
EPMRPP-89198 organizations routing refactor
1 parent c800793 commit 3699ae7

File tree

3 files changed

+16
-95
lines changed

3 files changed

+16
-95
lines changed

src/main/java/com/epam/ta/reportportal/ws/model/ActivityResource.java

Lines changed: 9 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@
2222
import io.swagger.annotations.ApiModelProperty;
2323
import java.util.Date;
2424
import javax.validation.constraints.NotNull;
25+
import lombok.Getter;
26+
import lombok.Setter;
27+
import lombok.ToString;
2528

2629
/**
2730
* JSON Representation of Report Portal's Activity domain object.
2831
*
2932
* @see <a href="http://en.wikipedia.org/wiki/HATEOAS">HATEOAS Description</a>
3033
*/
3134
@JsonInclude(Include.NON_NULL)
35+
@Getter
36+
@Setter
37+
@ToString
3238
public class ActivityResource {
3339

3440
@NotNull
@@ -69,104 +75,13 @@ public class ActivityResource {
6975
@JsonProperty(value = "projectName")
7076
private String projectName;
7177

78+
@JsonProperty(value = "projectKey")
79+
private String projectKey;
80+
7281
@JsonProperty(value = "details")
7382
private Object details;
7483

7584
@JsonProperty(value = "objectName")
7685
private String objectName;
7786

78-
public Long getId() {
79-
return id;
80-
}
81-
82-
public void setId(Long id) {
83-
this.id = id;
84-
}
85-
86-
public String getUser() {
87-
return user;
88-
}
89-
90-
public void setUser(String user) {
91-
this.user = user;
92-
}
93-
94-
public Long getLoggedObjectId() {
95-
return loggedObjectId;
96-
}
97-
98-
public void setLoggedObjectId(Long loggedObjectId) {
99-
this.loggedObjectId = loggedObjectId;
100-
}
101-
102-
public Date getLastModified() {
103-
return lastModified;
104-
}
105-
106-
public void setLastModified(Date lastModified) {
107-
this.lastModified = lastModified;
108-
}
109-
110-
public String getActionType() {
111-
return actionType;
112-
}
113-
114-
public void setActionType(String actionType) {
115-
this.actionType = actionType;
116-
}
117-
118-
public String getObjectType() {
119-
return objectType;
120-
}
121-
122-
public void setObjectType(String objectType) {
123-
this.objectType = objectType;
124-
}
125-
126-
public Long getProjectId() {
127-
return projectId;
128-
}
129-
130-
public void setProjectId(Long projectId) {
131-
this.projectId = projectId;
132-
}
133-
134-
public String getProjectName() {
135-
return projectName;
136-
}
137-
138-
public void setProjectName(String projectName) {
139-
this.projectName = projectName;
140-
}
141-
142-
public Object getDetails() {
143-
return details;
144-
}
145-
146-
public void setDetails(Object details) {
147-
this.details = details;
148-
}
149-
150-
public String getObjectName() {
151-
return objectName;
152-
}
153-
154-
public void setObjectName(String objectName) {
155-
this.objectName = objectName;
156-
}
157-
158-
@Override
159-
public String toString() {
160-
return "ActivityResource{" + "id=" + id
161-
+ ", user='" + user + '\''
162-
+ ", loggedObjectId='" + loggedObjectId + '\''
163-
+ ", lastModified=" + lastModified
164-
+ ", actionType='" + actionType + '\''
165-
+ ", objectType='" + objectType + '\''
166-
+ ", projectId=" + projectId
167-
+ ", projectName='" + projectName + '\''
168-
+ ", objectName='" + objectName + '\''
169-
+ ", details=" + details
170-
+ '}';
171-
}
17287
}

src/main/java/com/epam/ta/reportportal/ws/model/ErrorType.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ public enum ErrorType {
189189
*/
190190
CLUSTER_NOT_FOUND(40428, "Cluster '{}' not found"),
191191

192+
/**
193+
* If specified by id Organization not found
194+
*/
195+
ORGANIZATION_NOT_FOUND(40429, "Organization '{}' not found. Did you use correct Organization ID?"),
196+
192197
/**
193198
* Common error in case if object not found
194199
*/

src/main/java/com/epam/ta/reportportal/ws/model/ValidationConstraints.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ public class ValidationConstraints {
8181
public static final int MIN_NUMBER_OF_LOG_LINES = -1;
8282
public static final String HEX_COLOR_REGEXP = "#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$";
8383
public static final String PROJECT_NAME_REGEXP = "[a-zA-Z0-9-_]+";
84+
public static final String PROJECT_SLUG_REGEXP = "^[a-z0-9-_]+$";
8485

85-
private ValidationConstraints() {
86+
private ValidationConstraints() {
8687

8788
}
8889

0 commit comments

Comments
 (0)