Skip to content

Commit

Permalink
Merge pull request #38 from oven-2023/recommendation
Browse files Browse the repository at this point in the history
change array type
  • Loading branch information
see101702 authored Oct 21, 2023
2 parents 5f2a646 + 284f665 commit bb293b2
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ public List<WorkListDto> getRecommendWorkList(String dataFromFlask) throws BaseE


ObjectMapper objectMapper = new ObjectMapper();
long[] numpArray = objectMapper.readValue(dataFromFlask, long[].class);
String[] stringArray = objectMapper.readValue(dataFromFlask, String[].class);

long[] longArray = new long[stringArray.length];
for (int i = 0; i < stringArray.length; i++) {
longArray[i] = Long.parseLong(stringArray[i]);
}

List<Work> recommendations = new ArrayList<Work>();

for (int i = 0; i < numpArray.length; i++) {
recommendations.add(workRepository.findById(numpArray[i]).get());
for (int i = 0; i < longArray.length; i++) {
recommendations.add(workRepository.findById(longArray[i]).get());
}

List<WorkListDto> recommendWorkDtoList = recommendations
Expand Down

0 comments on commit bb293b2

Please sign in to comment.