-
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
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...countApp/domain/household/adapter/in/web/controller/GetHouseholdInviteCodeController.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,32 @@ | ||
package com.connect.accountApp.domain.household.adapter.in.web.controller; | ||
|
||
import com.connect.accountApp.domain.household.application.port.in.GetHouseholdUseCase; | ||
import com.connect.accountApp.global.common.adapter.in.web.response.SuccessResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.security.core.userdetails.UserDetails; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/api/v1/household") | ||
@RequiredArgsConstructor | ||
public class GetHouseholdInviteCodeController { | ||
|
||
private final GetHouseholdUseCase getHouseholdHomeUseCase; | ||
|
||
|
||
@GetMapping("/inviteCode") | ||
public ResponseEntity getHouseholdHome(@AuthenticationPrincipal UserDetails userDetails) { | ||
|
||
String userEmail = userDetails.getUsername(); | ||
|
||
String householdInviteCode = getHouseholdHomeUseCase.getHouseholdInviteCode(userEmail); | ||
|
||
return ResponseEntity.ok(SuccessResponse.create200SuccessResponse(householdInviteCode)); | ||
} | ||
|
||
|
||
} |
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