Skip to content

Commit

Permalink
Merge pull request #34 from kusitms-28th-Meetup-E/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
eojinny authored Nov 23, 2023
2 parents 692e645 + d781a33 commit 8c731f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public class Member {
private String birth;
private String gender;

@OneToMany(fetch = FetchType.LAZY)
private List<Subscribe> subscribeList = new ArrayList<>();
// @OneToMany(fetch = FetchType.LAZY)
// private List<Subscribe> subscribeList = new ArrayList<>();

public void signUp(SignUpRequest signUpRequest) {
this.nickname = signUpRequest.getNickname();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public SubscribeRes subscribe(String socialId,Long topicId, Long issueId) {

}

public Boolean isSubscriber(String socialId, Long topicId, Long issueId) {
Member member = memberQueryService.getMemberBySocialId(socialId);

return subscribeQueryService.isAbleToSubscribe(member);

}

// 마이페이지에 보여줄 내 구독 목록 & contentService와 feign 통신 .
public SubscribeMemberDto getAllSubscribeByMember(String socialId) {
Member member = memberQueryService.getMemberBySocialId(socialId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public ResponseEntity<SuccessResponse<SubscribeRes>> subscribe(@RequestHeader(va
@PathVariable("topicId") Long topicId, @PathVariable("issueId") Long issueId) {
return ResponseEntity.ok(SuccessResponse.create(SUBSCRIBE_SUCCESS.getMessage(), this.subscribeUseCase.subscribe(socialId, topicId, issueId)));
}
@GetMapping("/topic/{topicId}/issue/{issueId}/subscribe")
public ResponseEntity<SuccessResponse<Boolean>> issubscribe(@RequestHeader(value = "user-id") String socialId,
@PathVariable("topicId") Long topicId, @PathVariable("issueId") Long issueId) {
return ResponseEntity.ok(SuccessResponse.create(SUBSCRIBE_SUCCESS.getMessage(), this.subscribeUseCase.isSubscriber(socialId, topicId, issueId)));
}

@DeleteMapping("/topic/{topicId}/issue/{issueId}/subscribe")
public ResponseEntity<SuccessResponse<SubscribeRes>> unSubscribe(@RequestHeader(value = "user-id") String socialId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public TopicExchange topic() {
public Jackson2JsonMessageConverter producerJackson2MessageConverter() {
return new Jackson2JsonMessageConverter();
}

@Bean
public RabbitTemplate rabbitTemplate(final ConnectionFactory connectionFactory) {
final RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
Expand Down

0 comments on commit 8c731f6

Please sign in to comment.