Skip to content

Commit

Permalink
fix: challenge softdelete 전략 잠시 삭제 #261
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbonai06 committed Nov 2, 2022
1 parent 3b32acd commit f69c5ef
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 29 deletions.
26 changes: 13 additions & 13 deletions src/main/java/com/ceos/bankids/controller/ChallengeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ public CommonResponse<ProgressDTO> patchProgress(@AuthenticationPrincipal User a
return CommonResponse.onSuccess(progressDTO);
}

@ApiOperation(value = "자녀 측 돈길 히스토리")
@GetMapping(value = "/history", produces = "application/json; charset=utf-8")
public CommonResponse<List<ChallengeDTO>> getChallengeHistory(
@AuthenticationPrincipal User authUser, @RequestParam String status) {

log.info("api = 자녀 측 돈길 히스토리 가져오기, user = {}, status = {}", authUser, status);

List<ChallengeDTO> challengeHistoryDTOList = challengeMapper.readChallengeHistoryMapper(
authUser,
status);

return CommonResponse.onSuccess(challengeHistoryDTOList);
}
// @ApiOperation(value = "자녀 측 돈길 히스토리")
// @GetMapping(value = "/history", produces = "application/json; charset=utf-8")
// public CommonResponse<List<ChallengeDTO>> getChallengeHistory(
// @AuthenticationPrincipal User authUser, @RequestParam String status) {
//
// log.info("api = 자녀 측 돈길 히스토리 가져오기, user = {}, status = {}", authUser, status);
//
// List<ChallengeDTO> challengeHistoryDTOList = challengeMapper.readChallengeHistoryMapper(
// authUser,
// status);
//
// return CommonResponse.onSuccess(challengeHistoryDTOList);
// }
}
6 changes: 2 additions & 4 deletions src/main/java/com/ceos/bankids/domain/Challenge.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Getter
@Setter
Expand All @@ -41,8 +39,8 @@
@DynamicInsert
@DynamicUpdate
@ToString(exclude = {"progressList", "challengeUserList"})
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE challenge SET deleted_at = CURRENT_TIMESTAMP where id = ?")
//@Where(clause = "deleted_at is Null")
//@SQLDelete(sql = "UPDATE challenge SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class Challenge extends AbstractTimestamp {

@Id
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/ceos/bankids/domain/ChallengeUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Entity
@Getter
@Setter
@Table(name = "ChallengeUser")
@NoArgsConstructor
@EqualsAndHashCode(of = "id")
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE challenge_user SET deleted_at = CURRENT_TIMESTAMP where id = ?")
//@Where(clause = "deleted_at is Null")
//@SQLDelete(sql = "UPDATE challenge_user SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class ChallengeUser extends AbstractTimestamp {

@Id
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/ceos/bankids/domain/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Getter
@Setter
Expand All @@ -30,8 +28,8 @@
@NoArgsConstructor
@DynamicUpdate
@EqualsAndHashCode(of = "id")
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE comment SET deleted_at = CURRENT_TIMESTAMP where id = ?")
//@Where(clause = "deleted_at is Null")
//@SQLDelete(sql = "UPDATE comment SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class Comment {

@Id
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/ceos/bankids/domain/Progress.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Entity
@Getter
Expand All @@ -29,8 +27,8 @@
@NoArgsConstructor
@DynamicInsert
@EqualsAndHashCode(of = "id")
@Where(clause = "deleted_at is Null")
@SQLDelete(sql = "UPDATE progress SET deleted_at = CURRENT_TIMESTAMP where id = ?")
//@Where(clause = "deleted_at is Null")
//@SQLDelete(sql = "UPDATE progress SET deleted_at = CURRENT_TIMESTAMP where id = ?")
public class Progress extends AbstractTimestamp {

@Id
Expand Down

0 comments on commit f69c5ef

Please sign in to comment.