-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
5b8f67a
commit b14f5ed
Showing
43 changed files
with
634 additions
and
160 deletions.
There are no files selected for viewing
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
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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/com/gt/genti/adapter/in/web/SettlementController.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,44 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import static com.gt.genti.other.util.ApiUtils.*; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.gt.genti.application.service.PictureGenerateWorkService; | ||
import com.gt.genti.domain.enums.PictureGenerateRequestStatus; | ||
import com.gt.genti.dto.PictureGenerateRequestBriefResponseDto; | ||
import com.gt.genti.dto.PictureGenerateRequestDetailResponseDto; | ||
import com.gt.genti.dto.PictureGenerateResponseSubmitDto; | ||
import com.gt.genti.dto.SettlementResponseDto; | ||
import com.gt.genti.dto.UpdateMemoRequestDto; | ||
import com.gt.genti.dto.UpdatePictureUrlRequestDto; | ||
import com.gt.genti.other.auth.UserDetailsImpl; | ||
import com.gt.genti.service.SettlementService; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/api/creators") | ||
@RequiredArgsConstructor | ||
public class SettlementController { | ||
private final SettlementService settlementService; | ||
@GetMapping("/settlements") | ||
public ResponseEntity<ApiResult<List<SettlementResponseDto>>> getMySettlements( | ||
@AuthenticationPrincipal UserDetailsImpl userDetails) { | ||
//TODO 출금내역또한 나와야한다. | ||
// edited at 2024-05-19 | ||
// author 서병렬 | ||
|
||
return success(settlementService.getAllSettlements(userDetails.getId())); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/gt/genti/application/service/DepositService.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.gt.genti.application.service; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import com.gt.genti.domain.Deposit; | ||
import com.gt.genti.domain.User; | ||
import com.gt.genti.repository.DepositRepository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class DepositService { | ||
private final DepositRepository depositRepository; | ||
|
||
public Deposit createDeposit(User user) { | ||
Deposit newDeposit = new Deposit(user); | ||
return depositRepository.save(newDeposit); | ||
|
||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/gt/genti/application/service/MatchingRegistry.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,29 @@ | ||
package com.gt.genti.application.service; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class MatchingRegistry { | ||
private final ConcurrentHashMap<Long, List<Long>> matchRecord = new ConcurrentHashMap<>(); | ||
|
||
public void add(Long requestId, Long creatorId) { | ||
if (matchRecord.containsKey(requestId)) { | ||
matchRecord.get(requestId).add(creatorId); | ||
} else { | ||
List<Long> newCreatorList = new ArrayList<>(); | ||
newCreatorList.add(creatorId); | ||
matchRecord.put(requestId, newCreatorList); | ||
} | ||
} | ||
|
||
public List<Long> getMatchedCreatorBefore(Long requestId) { | ||
if (matchRecord.containsKey(requestId)) { | ||
return matchRecord.get(requestId); | ||
} | ||
return new ArrayList<>(); | ||
} | ||
} |
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.