-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/main/java/com/sopterm/makeawish/repository/abuse/AbuseLogRepository.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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.sopterm.makeawish.repository.abuse; | ||
|
||
import com.sopterm.makeawish.domain.abuse.AbuseLog; | ||
import com.sopterm.makeawish.domain.user.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface AbuseLogRepository extends JpaRepository<AbuseLog, Long> { | ||
@Query(value = "SELECT COUNT(AL) FROM ABUSE_LOG AL WHERE AL.user_id = :userId and AL.created_at >= (now() - interval '7 days')", nativeQuery = true) | ||
Integer countAbuseLogByUserIdDuringWeekend(@Param("userId") Long userId); | ||
|
||
void deleteByUser(User user); | ||
} |
2 changes: 2 additions & 0 deletions
2
src/main/java/com/sopterm/makeawish/repository/abuse/AbuseUserRepository.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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package com.sopterm.makeawish.repository.abuse; | ||
|
||
import com.sopterm.makeawish.domain.abuse.AbuseUser; | ||
import com.sopterm.makeawish.domain.user.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface AbuseUserRepository extends JpaRepository<AbuseUser, Long> { | ||
Optional<AbuseUser> findAbuseUserByUserId(Long userId); | ||
void deleteByUser(User user); | ||
} |
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