-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPIK-441] Split feedback score name endpoints
- Loading branch information
1 parent
0469227
commit 18ae3cd
Showing
20 changed files
with
503 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/opik-backend/src/main/java/com/comet/opik/api/queryparams/UUIDListParamConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.comet.opik.api.queryparams; | ||
|
||
import jakarta.ws.rs.ext.ParamConverter; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import java.util.stream.Collectors; | ||
|
||
public class UUIDListParamConverter implements ParamConverter<List<UUID>> { | ||
|
||
@Override | ||
public List<UUID> fromString(String value) { | ||
if (value == null || value.trim().isEmpty()) { | ||
return List.of(); // Return an empty list if no value is provided | ||
} | ||
return Arrays.stream(value.split(",")) | ||
.map(String::trim) | ||
.map(UUID::fromString) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@Override | ||
public String toString(List<UUID> value) { | ||
return value.stream() | ||
.map(UUID::toString) | ||
.collect(Collectors.joining(",")); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...-backend/src/main/java/com/comet/opik/api/queryparams/UUIDListParamConverterProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.comet.opik.api.queryparams; | ||
|
||
import jakarta.ws.rs.ext.ParamConverter; | ||
import jakarta.ws.rs.ext.ParamConverterProvider; | ||
import jakarta.ws.rs.ext.Provider; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.List; | ||
|
||
@Provider | ||
public class UUIDListParamConverterProvider implements ParamConverterProvider { | ||
|
||
@Override | ||
@SuppressWarnings("unchecked") | ||
public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, | ||
java.lang.annotation.Annotation[] annotations) { | ||
if (rawType.equals(List.class) && genericType.getTypeName().contains("UUID")) { | ||
return (ParamConverter<T>) new UUIDListParamConverter(); | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 0 additions & 71 deletions
71
...pik-backend/src/main/java/com/comet/opik/api/resources/v1/priv/FeedbackScoreResource.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.