-
Notifications
You must be signed in to change notification settings - Fork 3
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 #210 from TrandPick/development
트렌드픽 배포 v.1.0.1
- Loading branch information
Showing
14 changed files
with
78 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
- 'Dockerfile' | ||
- 'readme.md' | ||
branches: | ||
- 'development' | ||
- 'main' | ||
jobs: | ||
build: | ||
name: 빌드 | ||
|
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
20 changes: 2 additions & 18 deletions
20
src/main/java/project/trendpick_pro/domain/recommend/controller/RecommendController.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,37 +1,21 @@ | ||
package project.trendpick_pro.domain.recommend.controller; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import project.trendpick_pro.domain.common.base.rq.Rq; | ||
import project.trendpick_pro.domain.recommend.entity.Recommend; | ||
import project.trendpick_pro.domain.recommend.service.RecommendService; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
public class RecommendController { | ||
|
||
private final RecommendService recommendService; | ||
private final Rq rq; | ||
|
||
@PreAuthorize("isAuthenticated()") | ||
@GetMapping("/admin/caculate") | ||
public String caculate(){ | ||
// recommendService.select(); | ||
recommendService.select(); | ||
return "redirect:/trendpick/products/list"; | ||
} | ||
|
||
@PreAuthorize("isAuthenticated()") | ||
@GetMapping("/admin/getrecommendset") | ||
public String getRecommend(Model model, @RequestParam("page") int offset){ | ||
model.addAttribute("recommend", recommendService.getFindAll(rq.CheckMember().get(), offset)); | ||
return "main"; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,9 +87,6 @@ public void run(String... args) { | |
} | ||
CreateSubCategories(mainCategoryService, subCategoryService); | ||
|
||
em.flush(); | ||
em.clear(); | ||
|
||
JoinForm admin = JoinForm.builder() | ||
.email("[email protected]") | ||
.password("12345") | ||
|
@@ -198,19 +195,7 @@ public void run(String... args) { | |
Rsmember1.connectAddress("서울특별시 어디구 어디로 123"); | ||
recommendService.select(Rsmember1.getEmail()); | ||
} | ||
JoinForm member = JoinForm.builder() | ||
.email("[email protected]") | ||
.password("12345") | ||
.username("sooho") | ||
.phoneNumber("010-1234-1234") | ||
.state("MEMBER") | ||
.tags(tags) | ||
.build(); | ||
Member Rsmember1 = memberService.register(member).getData(); | ||
Rsmember1.connectAddress("서울특별시 진짜 주인공 123"); | ||
memberRepository.save(Rsmember1); | ||
|
||
recommendService.select(Rsmember1.getEmail()); | ||
JoinForm member2 = JoinForm.builder() | ||
.email("[email protected]") | ||
.password("12345") | ||
|
@@ -281,6 +266,20 @@ public void run(String... args) { | |
productRepository.save(product); | ||
} | ||
} | ||
|
||
JoinForm member = JoinForm.builder() | ||
.email("[email protected]") | ||
.password("12345") | ||
.username("sooho") | ||
.phoneNumber("010-1234-1234") | ||
.state("MEMBER") | ||
.tags(tags) | ||
.build(); | ||
Member Rsmember1 = memberService.register(member).getData(); | ||
Rsmember1.connectAddress("서울특별시 진짜 주인공 123"); | ||
memberRepository.save(Rsmember1); | ||
recommendService.select(Rsmember1.getEmail()); | ||
|
||
//==장바구니 데이터==// | ||
cartService.addItemToCart(memberService.findByEmail("[email protected]").get(), new CartItemRequest(1L,5)); | ||
cartService.addItemToCart(memberService.findByEmail("[email protected]").get(), new CartItemRequest(2L,3)); | ||
|
@@ -333,6 +332,9 @@ public void run(String... args) { | |
reviewRepository.save(review3); | ||
Review review4 = Review.of (rr, memberService.findByEmail("[email protected]").get(), product2, mainFile); | ||
reviewRepository.save(review4); | ||
|
||
em.flush(); | ||
em.clear(); | ||
} | ||
}; | ||
} | ||
|
32 changes: 32 additions & 0 deletions
32
src/main/java/project/trendpick_pro/global/jmeter/JmeterController.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 project.trendpick_pro.global.jmeter; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpSession; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import project.trendpick_pro.domain.member.entity.Member; | ||
import project.trendpick_pro.domain.member.entity.dto.MemberInfoDto; | ||
import project.trendpick_pro.domain.member.repository.MemberRepository; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/jmeter") | ||
public class JmeterController { | ||
|
||
private final MemberRepository memberRepository; | ||
|
||
@GetMapping("/member/info") | ||
public MemberInfoDto getMemberInfo(HttpServletRequest request) { | ||
HttpSession session = request.getSession(false); | ||
if (session == null || session.getAttribute("memberId") == null) { | ||
throw new RuntimeException("세션이 없거나 로그인되어 있지 않습니다."); | ||
} | ||
|
||
Long memberId = (Long) session.getAttribute("memberId"); | ||
// memberId를 사용하여 회원 정보를 조회하고 MemberInfoDto 객체를 생성하여 반환합니다. | ||
Member member = memberRepository.findById(memberId).get(); | ||
return MemberInfoDto.of(member); | ||
} | ||
} |
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