Skip to content

Commit 3f7c32c

Browse files
committed
test SPS delete
1 parent 9727710 commit 3f7c32c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/main/java/ch/ethz/seb/sps/server/datalayer/dao/impl/SessionDAOBatis.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,12 +704,16 @@ public Long getNumberOfScreenshots(final String uuid, final FilterMap filterMap)
704704
public Result<Boolean> hasAnySessionData(Collection<Long> groupIds) {
705705
return Result.tryCatch(() -> {
706706

707+
System.out.println("*********************** hasAnySessionData groupIds: " + groupIds);
708+
707709
List<Long> sessionIds = this.sessionRecordMapper
708710
.selectIdsByExample()
709711
.where(groupId, isIn(groupIds))
710712
.build()
711713
.execute();
712714

715+
System.out.println("*********************** hasAnySessionData sessionIds: " + sessionIds);
716+
713717
if (sessionIds == null || sessionIds.isEmpty()) {
714718
return false;
715719
}
@@ -720,6 +724,8 @@ public Result<Boolean> hasAnySessionData(Collection<Long> groupIds) {
720724
.build()
721725
.execute();
722726

727+
System.out.println("*********************** hasAnySessionData dataNum: " + dataNum);
728+
723729
return dataNum != null && dataNum.intValue() != 0;
724730
});
725731
}

src/main/java/ch/ethz/seb/sps/server/servicelayer/impl/SessionServiceImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public Result<Collection<EntityKey>> closeAllSessions(final Collection<EntityKey
186186
@Override
187187
public boolean hasAnySessionDataForExam(final String examUUID) {
188188
Long pk = examDAO.modelIdToPK(examUUID);
189+
System.out.println("*********************** requestDelete pk: " + pk);
189190
if (pk != null) {
190191
return this.groupDAO
191192
.allIdsForExamsIds(List.of())

src/main/java/ch/ethz/seb/sps/server/weblayer/AdminExamController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public Exam create(
101101
produces = MediaType.APPLICATION_JSON_VALUE)
102102

103103
public Collection<EntityKey> requestDelete(@PathVariable final String modelId) {
104-
System.out.println("*********************** requestDelete modelId: " + modelId);
105104
if (!this.sessionService.hasAnySessionDataForExam(modelId)) {
106105
return super.hardDelete(modelId);
107106
} else {

0 commit comments

Comments
 (0)