-
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.
Merge pull request #175 from nhnacademy-be4-My-Books/feature/order
Feature/order 레스트독 수정
- Loading branch information
Showing
14 changed files
with
33,115 additions
and
11,085 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
46 changes: 46 additions & 0 deletions
46
src/main/java/store/mybooks/front/home/controller/HomeRestController.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,46 @@ | ||
package store.mybooks.front.home.controller; | ||
|
||
import java.util.Objects; | ||
import javax.servlet.http.HttpServletRequest; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import store.mybooks.front.home.dto.response.UserCheckResponse; | ||
import store.mybooks.front.utils.CookieUtils; | ||
|
||
/** | ||
* packageName : store.mybooks.front.order.controller<br> | ||
* fileName : HomeRestController<br> | ||
* author : minsu11<br> | ||
* date : 3/27/24<br> | ||
* description : | ||
* ===========================================================<br> | ||
* DATE AUTHOR NOTE<br> | ||
* -----------------------------------------------------------<br> | ||
* 3/27/24 minsu11 최초 생성<br> | ||
*/ | ||
@RestController | ||
@RequiredArgsConstructor | ||
public class HomeRestController { | ||
|
||
/** | ||
* methodName : checkUser<br> | ||
* author : minsu11<br> | ||
* description : 비회원의 주문내역을 화면에 보여주기 전에 유저인지 아닌지 확이. | ||
* | ||
* @param request the request | ||
* @return the response entity | ||
*/ | ||
@GetMapping("/home/user/identity") | ||
public ResponseEntity<UserCheckResponse> checkUser(HttpServletRequest request) { | ||
UserCheckResponse response = new UserCheckResponse(false); | ||
if (Objects.nonNull(CookieUtils.getIdentityCookieValue(request))) { | ||
response.changeCheckResult(true); | ||
} | ||
return ResponseEntity.status(HttpStatus.OK) | ||
.body(response); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/store/mybooks/front/home/dto/response/UserCheckResponse.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,25 @@ | ||
package store.mybooks.front.home.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* packageName : store.mybooks.front.home.dto.response<br> | ||
* fileName : UserCheckResponse<br> | ||
* author : minsu11<br> | ||
* date : 3/27/24<br> | ||
* description : | ||
* ===========================================================<br> | ||
* DATE AUTHOR NOTE<br> | ||
* -----------------------------------------------------------<br> | ||
* 3/27/24 minsu11 최초 생성<br> | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public class UserCheckResponse { | ||
private Boolean checkResult; | ||
|
||
public void changeCheckResult(Boolean checkResult) { | ||
this.checkResult = checkResult; | ||
} | ||
} |
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.