-
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.
✨ feat(admin): add user static and user detail (#208)
- Loading branch information
1 parent
3fb5e95
commit 24772b1
Showing
23 changed files
with
653 additions
and
119 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...eetdrop-admin-server/src/main/java/com/depromeet/apis/item/repository/ItemRepository.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,14 +1,20 @@ | ||
package com.depromeet.apis.item.repository; | ||
|
||
import com.depromeet.item.Item; | ||
import com.depromeet.user.User; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
import java.util.List; | ||
|
||
public interface ItemRepository extends JpaRepository<Item, Long> { | ||
|
||
@Query(value = "select i from Item i join fetch i.song s join fetch s.album a join fetch a.artist ar join fetch i.itemLocation il join fetch il.villageArea va join fetch i.user u", | ||
countQuery = "select count(i) from Item i") | ||
Page<Item> findAll(Pageable pageable); | ||
|
||
@Query(value = "select i from Item i join fetch i.song s join fetch s.album a join fetch a.artist ar join fetch i.itemLocation il join fetch il.villageArea va join fetch i.user u where u = :user order by i.createdAt desc ") | ||
List<Item> findByUser(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
37 changes: 37 additions & 0 deletions
37
...admin-server/src/main/java/com/depromeet/apis/user/controller/UserStaticalController.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.depromeet.apis.user.controller; | ||
|
||
import com.depromeet.apis.user.dto.UserAllStaticCountDto; | ||
import com.depromeet.apis.user.dto.UserSignUpCountRequestDto; | ||
import com.depromeet.apis.user.dto.UserSignUpCountResponseDto; | ||
import com.depromeet.apis.user.service.UserStaticService; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/users/statical") | ||
@RequiredArgsConstructor | ||
public class UserStaticalController { | ||
|
||
private final UserStaticService userService; | ||
|
||
@GetMapping("/signup/count") | ||
public ResponseEntity<List<UserSignUpCountResponseDto>> getUserSignUpCount( | ||
UserSignUpCountRequestDto userSignUpCountRequestDto | ||
) { | ||
var response = userService.getUserSignUpCount(userSignUpCountRequestDto); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@GetMapping("/all/count") | ||
public ResponseEntity<UserAllStaticCountDto> getAllUserCount() { | ||
var response = userService.getAllUserCount(); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...tdrop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserActivityResponseDto.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
public class UserActivityResponseDto { | ||
private String title; | ||
private String content; | ||
} |
14 changes: 14 additions & 0 deletions
14
...eetdrop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserAllStaticCountDto.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
public class UserAllStaticCountDto { | ||
private Long allUserCount; | ||
private int todayUserCount; | ||
private int dropUserCount; | ||
} |
17 changes: 17 additions & 0 deletions
17
...drop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserBasicInfoResponseDto.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
public class UserBasicInfoResponseDto { | ||
private Long id; | ||
private String nickname; | ||
private String idfv; | ||
private LocalDateTime createdAt; | ||
} |
4 changes: 0 additions & 4 deletions
4
...reetdrop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserCountResponseDto.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...rop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserDetailInfoResponseDto.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
public class UserDetailInfoResponseDto { | ||
private int allDropCount; | ||
private String mainDropLocation; | ||
private String dropLocations; | ||
private String interestGenre; | ||
} |
16 changes: 16 additions & 0 deletions
16
...eetdrop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserDetailResponseDto.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
public class UserDetailResponseDto { | ||
private UserBasicInfoResponseDto userBasicInfo; | ||
private UserDetailInfoResponseDto userDetailInfo; | ||
private List<UserActivityResponseDto> userActivity; | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...rop-admin-server/src/main/java/com/depromeet/apis/user/dto/UserSignUpCountRequestDto.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Getter | ||
@Setter | ||
public class UserSignUpCountRequestDto { | ||
private LocalDateTime startDate = LocalDateTime.now().minusDays(7); | ||
private LocalDateTime endDate = LocalDateTime.now(); | ||
} |
4 changes: 4 additions & 0 deletions
4
...op-admin-server/src/main/java/com/depromeet/apis/user/dto/UserSignUpCountResponseDto.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.depromeet.apis.user.dto; | ||
|
||
public record UserSignUpCountResponseDto(String date, Long count) { | ||
} |
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
Oops, something went wrong.