-
Notifications
You must be signed in to change notification settings - Fork 2
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
11 changed files
with
195 additions
and
11 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/com/bit/lotte/flower/user/admin/dto/StoreManagerApplicationData.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,21 @@ | ||
package com.bit.lotte.flower.user.admin.dto; | ||
|
||
|
||
import com.bit.lotte.flower.user.common.valueobject.StoreId; | ||
import java.time.LocalDateTime; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
|
||
@Getter | ||
public class StoreManagerApplicationData { | ||
private StoreId key; | ||
private String storeManagerName; | ||
private String storeManagerBusinessNumber; | ||
private LocalDateTime requestDate; | ||
} |
4 changes: 3 additions & 1 deletion
4
...er/user/admin/dto/SettlementResponse.java → ...dmin/dto/response/SettlementResponse.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
18 changes: 18 additions & 0 deletions
18
...ava/com/bit/lotte/flower/user/admin/dto/response/StoreManagerApplicationFormResponse.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,18 @@ | ||
package com.bit.lotte.flower.user.admin.dto.response; | ||
|
||
import com.bit.lotte.flower.user.admin.dto.StoreManagerApplicationData; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
public class StoreManagerApplicationFormResponse { | ||
|
||
private Integer totalCnt; | ||
private List<StoreManagerApplicationData> data; | ||
} |
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
15 changes: 15 additions & 0 deletions
15
...a/com/bit/lotte/flower/user/admin/http/feign/GetUserApplicationsByStatusFeignRequest.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.bit.lotte.flower.user.admin.http.feign; | ||
|
||
import com.bit.lotte.flower.user.common.valueobject.StoreManagerStatus; | ||
import java.util.List; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
@FeignClient(name = "get-store-manager-applications", url = "${service.auth.domain}") | ||
public interface GetUserApplicationsByStatusFeignRequest { | ||
|
||
@GetMapping("/store-manager/{status}") | ||
public List<Long> getStoreManagerApplications(@PathVariable StoreManagerStatus status); | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
...main/java/com/bit/lotte/flower/user/admin/http/message/GetUserApplicationByIdRequest.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,10 @@ | ||
package com.bit.lotte.flower.user.admin.http.message; | ||
|
||
import com.bit.lotte.flower.user.common.valueobject.StoreManagerStatus; | ||
import java.util.List; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public interface GetUserApplicationByIdRequest { | ||
public List<Long> request(StoreManagerStatus storeManagerStatus); | ||
} |
21 changes: 21 additions & 0 deletions
21
.../java/com/bit/lotte/flower/user/admin/http/message/GetUserApplicationByIdRequestImpl.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,21 @@ | ||
package com.bit.lotte.flower.user.admin.http.message; | ||
|
||
import com.bit.lotte.flower.user.admin.http.feign.GetUserApplicationsByStatusFeignRequest; | ||
import com.bit.lotte.flower.user.common.valueobject.StoreManagerStatus; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
public class GetUserApplicationByIdRequestImpl implements | ||
GetUserApplicationByIdRequest { | ||
|
||
private final GetUserApplicationsByStatusFeignRequest feignRequest; | ||
|
||
|
||
@Override | ||
public List<Long> request(StoreManagerStatus storeManagerStatus) { | ||
return feignRequest.getStoreManagerApplications(storeManagerStatus); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/bit/lotte/flower/user/admin/service/GetStoreManagerApplicationService.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,50 @@ | ||
package com.bit.lotte.flower.user.admin.service; | ||
|
||
|
||
import com.bit.lotte.flower.user.admin.dto.StoreManagerApplicationData; | ||
import com.bit.lotte.flower.user.admin.dto.response.StoreManagerApplicationFormResponse; | ||
import com.bit.lotte.flower.user.common.valueobject.StoreManagerStatus; | ||
import com.bit.lotte.flower.user.social.repository.FindSocialUserByLongIdService; | ||
import com.bit.lotte.flower.user.store.entity.StoreManager; | ||
import com.bit.lotte.flower.user.store.repository.StoreManagerJpaRepository; | ||
import com.bit.lotte.flower.user.store.service.FindStoreMangerService; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import javax.transaction.Transactional; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.stereotype.Component; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
public class GetStoreManagerApplicationService { | ||
|
||
private final FindStoreMangerService findStoreMangerService; | ||
|
||
@Transactional | ||
public StoreManagerApplicationFormResponse getApplications(List<Long> storeManagerIdList, | ||
Pageable pageable) { | ||
|
||
List<StoreManager> storeManagerListByStatus = new ArrayList<>(); | ||
|
||
for (Long id : storeManagerIdList) { | ||
storeManagerListByStatus.add(findStoreMangerService.findByLongId(id)); | ||
} | ||
|
||
List < StoreManagerApplicationData > data = mapToData(storeManagerListByStatus); | ||
|
||
return StoreManagerApplicationFormResponse.builder().data(data).totalCnt(data.size()).build(); | ||
|
||
} | ||
|
||
public List<StoreManagerApplicationData> mapToData(List<StoreManager> managerList) { | ||
List<StoreManagerApplicationData> applicationDataList = new ArrayList<>(); | ||
for (StoreManager storeManager : managerList) { | ||
applicationDataList.add(StoreManagerApplicationData.builder() | ||
.requestDate(storeManager.getUpdatedAt()).storeManagerName(storeManager.getName()) | ||
.storeManagerBusinessNumber(storeManager.getBusinessNumberImage()).build()); | ||
} | ||
return applicationDataList; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/bit/lotte/flower/user/common/entity/BaseEntity.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,28 @@ | ||
package com.bit.lotte.flower.user.common.entity; | ||
|
||
import java.time.LocalDateTime; | ||
import javax.persistence.Column; | ||
import javax.persistence.EntityListeners; | ||
import javax.persistence.MappedSuperclass; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
@Getter | ||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class BaseEntity { | ||
|
||
@CreatedDate | ||
@Column(name = "created_at") | ||
private LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
@Column(name = "updated_at") | ||
private LocalDateTime updatedAt; | ||
|
||
@Column(name = "is_deleted") | ||
private Boolean isDeleted; | ||
} | ||
|
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