-
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 #41 from LminWoo99/msa-develop
ver 2.0.0
- Loading branch information
Showing
68 changed files
with
929 additions
and
329 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ntProject/common/config/JwtTokenUtil.java → ...ject/common/config/auth/JwtTokenUtil.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
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
59 changes: 59 additions & 0 deletions
59
PlantBackend/src/main/java/Plant/PlantProject/common/config/kafka/KafkaProducerConfig.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,59 @@ | ||
package Plant.PlantProject.common.config.kafka; | ||
|
||
import Plant.PlantProject.dto.response.NotificationEventDto; | ||
import com.google.common.collect.ImmutableMap; | ||
import org.apache.kafka.clients.producer.ProducerConfig; | ||
import org.apache.kafka.common.serialization.StringSerializer; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.kafka.annotation.EnableKafka; | ||
import org.springframework.kafka.core.DefaultKafkaProducerFactory; | ||
import org.springframework.kafka.core.KafkaTemplate; | ||
import org.springframework.kafka.core.ProducerFactory; | ||
import org.springframework.kafka.support.serializer.JsonSerializer; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@EnableKafka | ||
@Configuration | ||
public class KafkaProducerConfig { | ||
//Kafka ProduceFactory를 생성하는 Bean 메서드 | ||
@Value("${kafka.url}") | ||
private String kafkaServerUrl; | ||
@Bean | ||
public ProducerFactory<String, String> producerFactory() { | ||
return new DefaultKafkaProducerFactory<>(producerConfigurations()); | ||
} // Kafka Producer 구성을 위한 설정값들을 포함한 맵을 반환하는 메서드 | ||
@Bean | ||
public Map<String, Object> producerConfigurations() { | ||
return ImmutableMap.<String, Object>builder() | ||
.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaServerUrl) | ||
.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class) | ||
.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class) | ||
.build(); | ||
} | ||
// KafkaTemplate을 생성하는 Bean 메서드 | ||
@Bean | ||
public KafkaTemplate<String, String> kafkaTemplate() { | ||
return new KafkaTemplate<>(producerFactory()); | ||
} | ||
@Bean | ||
public ProducerFactory<String, NotificationEventDto> notificationProducerFactory() { | ||
return new DefaultKafkaProducerFactory<>(producerConfigurations()); | ||
} | ||
@Bean | ||
public KafkaTemplate<String, NotificationEventDto> notificationKafkaTemplate() { | ||
return new KafkaTemplate<>(notificationProducerFactory()); | ||
} | ||
@Bean | ||
public ProducerFactory<String, Long> deletePostProducerFactory() { | ||
return new DefaultKafkaProducerFactory<>(producerConfigurations()); | ||
} | ||
@Bean | ||
public KafkaTemplate<String, Long> deletePostKafkaTemplate() { | ||
return new KafkaTemplate<>(deletePostProducerFactory()); | ||
} | ||
|
||
} |
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
37 changes: 0 additions & 37 deletions
37
PlantBackend/src/main/java/Plant/PlantProject/common/messagequeue/KafkaProducer.java
This file was deleted.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
PlantBackend/src/main/java/Plant/PlantProject/common/util/SearchParam.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 Plant.PlantProject.common.util; | ||
|
||
import com.querydsl.core.types.Order; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum SearchParam { | ||
MANAGE("manage"), | ||
CATEGORY("category"); | ||
|
||
|
||
|
||
|
||
private final String paramKey; | ||
|
||
SearchParam(String paramKey) { | ||
this.paramKey = paramKey; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
PlantBackend/src/main/java/Plant/PlantProject/controller/keyword/KeywordController.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,39 @@ | ||
package Plant.PlantProject.controller.keyword; | ||
|
||
import Plant.PlantProject.dto.request.KeywordRequestDto; | ||
import Plant.PlantProject.dto.response.KeywordResponseDto; | ||
import Plant.PlantProject.service.keyword.KeywordService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class KeywordController { | ||
private final KeywordService keywordService; | ||
|
||
@GetMapping("/keyword/{memberNo}") | ||
@Operation(summary = "유저 기능- 설정한 키워드 조회", description = "유저가 설정한 키워드 조회 조회 할 수 있는 API") | ||
private ResponseEntity<List<KeywordResponseDto>> getKeywordList(@PathVariable("memberNo") Integer memberNo) { | ||
|
||
List<KeywordResponseDto> keywordList = keywordService.getKeywordList(memberNo); | ||
return ResponseEntity.ok().body(keywordList); | ||
} | ||
@PostMapping("/keyword") | ||
@Operation(summary = "유저 기능- 키워드 설정", description = "유저가 알림을 받기 위한 키워드 설정 할 수 있는 API") | ||
private ResponseEntity<Long> saveKeyWord(@RequestBody KeywordRequestDto keywordRequestDto) { | ||
|
||
Long keyWordId = keywordService.saveKeyWord(keywordRequestDto); | ||
return ResponseEntity.ok().body(keyWordId); | ||
} | ||
@DeleteMapping("/keyword/{keywordId}") | ||
@Operation(summary = "유저 기능- 설정한 키워드 삭제", description = "유저가 설정한 키워드 삭제할 수 있는 API") | ||
private void getKeywordList(@PathVariable("keywordId") Long keywordId) { | ||
|
||
keywordService.deleteKeyWord(keywordId); | ||
} | ||
|
||
} |
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
7 changes: 3 additions & 4 deletions
7
PlantBackend/src/main/java/Plant/PlantProject/controller/tradeboard/GoodsController.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
4 changes: 2 additions & 2 deletions
4
...tBackend/src/main/java/Plant/PlantProject/controller/tradeboard/TradeBoardController.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
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
2 changes: 1 addition & 1 deletion
2
PlantBackend/src/main/java/Plant/PlantProject/controller/user/EmailController.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
6 changes: 3 additions & 3 deletions
6
PlantBackend/src/main/java/Plant/PlantProject/controller/user/MemberController.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
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.