Skip to content

Commit e8b401b

Browse files
authored
Merge pull request #11 from yesitha/dev-yesitha
Update MaterialServiceImpl.java
2 parents cacde6e + 7896a11 commit e8b401b

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

resource-management/resource-management-service/src/main/java/com/itgura/service/impl/MaterialServiceImpl.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -304,40 +304,7 @@ private String signPolicyWithPrivateKey(String base64EncodedPolicy) throws Excep
304304

305305
return Base64.getEncoder().encodeToString(signedBytes);
306306
}
307-
@Override
308-
public MaterialResponseDto getMaterialById(UUID materialId) {
309-
try {
310-
UserResponseDto loggedUserDetails = userDetailService.getLoggedUserDetails(UserUtil.extractToken());
311-
312-
if (loggedUserDetails == null) {
313-
throw new ValueNotExistException("User not found");
314-
}else{
315-
Material material = materialRepository.findById(materialId).orElseThrow(()
316-
-> new ValueNotExistException("Material not found with id " + materialId));
317-
MaterialResponseDto dto = MaterialMapper.INSTANCE.toDto(material);
318-
return dto;
319-
}
320-
}catch (Exception e) {
321-
throw new RuntimeException(e);
322-
}
323-
}
324307

325-
@Override
326-
public List<MaterialResponseDto> getAllMaterialBySessionId(UUID sessionId) {
327-
try {
328-
UserResponseDto loggedUserDetails = userDetailService.getLoggedUserDetails(UserUtil.extractToken());
329-
330-
if (loggedUserDetails == null) {
331-
throw new ValueNotExistException("User not found");
332-
}else{
333-
List<Material> allBySessionContentId = materialRepository.findAllBySession_ContentId(sessionId);
334-
List<MaterialResponseDto> dtos = MaterialMapper.INSTANCE.toDtoList(allBySessionContentId);
335-
return dtos;
336-
}
337-
}catch (Exception e) {
338-
throw new RuntimeException(e);
339-
}
340-
}
341308

342309
private String urlEncode(String value) {
343310

0 commit comments

Comments
 (0)