Compare commits

..

12 Commits

Author SHA1 Message Date
lsh9672
e4e3265646 feat : 수정
Some checks failed
Analytics CI / build-and-push (push) Has been cancelled
2025-06-20 09:31:05 +09:00
lsh9672
fe15d55f45 feat : 수정 2025-06-20 09:22:45 +09:00
lsh9672
451a69534d feat : 회원가입시, 역할 저장. 2025-06-19 16:48:25 +09:00
UNGGU0704
af48eb2528 Fix: Eventhub 파티션 고정 2025-06-19 16:04:40 +09:00
UNGGU0704
09517a1ff0 Fix: 리뷰 연동 제한 일수 변경 2025-06-19 15:55:09 +09:00
youbeen
a155f6470f param update 2025-06-19 15:23:15 +09:00
youbeen
e53b67c66c store Search 2025-06-19 15:18:49 +09:00
youbeen
0289976085 store category 2025-06-19 14:55:22 +09:00
haneuljeong98
c866b7606a Merge branch 'main' of https://github.com/dg04-hi/hi-backend 2025-06-19 14:04:24 +09:00
youbeen
b4e3ccc51c category store 2025-06-19 13:47:07 +09:00
haneuljeong98
5056f388cf release 2025-06-19 13:42:43 +09:00
haneuljeong98
914b8201e8 feat 2025-06-19 13:29:35 +09:00
10 changed files with 90 additions and 8 deletions

View File

@ -1,5 +1,7 @@
package com.ktds.hi;
import java.util.TimeZone;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
@ -17,6 +19,9 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
public class AnalyticsApplication {
public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
SpringApplication.run(AnalyticsApplication.class, args);
}
}

View File

@ -25,7 +25,7 @@ public interface AiFeedbackJpaRepository extends JpaRepository<AiFeedbackEntity,
/**
* 매장 ID로 최신 AI 피드백 조회
*/
@Query("SELECT af FROM AiFeedbackEntity af WHERE af.storeId = :storeId ORDER BY af.createdAt DESC LIMIT 1")
@Query("SELECT af FROM AiFeedbackEntity af WHERE af.storeId = :storeId ORDER BY af.generatedAt DESC LIMIT 1")
Optional<AiFeedbackEntity> findLatestByStoreId(@Param("storeId") Long storeId);
/**

View File

@ -34,4 +34,10 @@ public class SignupRequest {
@Pattern(regexp = "^010-\\d{4}-\\d{4}$", message = "전화번호 형식이 올바르지 않습니다")
@Schema(description = "전화번호", example = "010-1234-5678")
private String phone;
@NotBlank(message = "역할분류는 필수입니다")
@Size(min = 2, max = 20, message = "역할분류는 2-20자 사이여야 합니다")
@Schema(description = "역할", example = "OWNER")
private String role;
}

View File

@ -45,7 +45,7 @@ public class MemberServiceImpl implements MemberService {
.password(passwordEncoder.encode(request.getPassword()))
.nickname(request.getNickname())
.phone(request.getPhone())
.role("USER")
.role(request.getRole())
.build();
MemberEntity savedMember = memberRepository.save(member);

View File

@ -4,6 +4,7 @@ import com.azure.messaging.eventhubs.EventData;
import com.azure.messaging.eventhubs.EventDataBatch;
import com.azure.messaging.eventhubs.EventHubClientBuilder;
import com.azure.messaging.eventhubs.EventHubProducerClient;
import com.azure.messaging.eventhubs.models.CreateBatchOptions;
import com.azure.messaging.eventhubs.models.SendOptions;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ktds.hi.store.biz.usecase.in.ExternalIntegrationUseCase;
@ -68,6 +69,7 @@ public class ExternalIntegrationInteractor implements ExternalIntegrationUseCase
throw new BusinessException("지원하지 않는 플랫폼입니다: " + request.getPlatform());
}
log.info(request.getPlatform() + " 요청 Data : " + request.toString());
// 동기화 이벤트 발행
publishSyncEvent(storeId, request.getPlatform(), syncedCount);
@ -252,11 +254,10 @@ public class ExternalIntegrationInteractor implements ExternalIntegrationUseCase
EventData eventData = new EventData(payloadJson);
// 🔥 파티션 4번에 보내기 위한 SendOptions 설정
SendOptions sendOptions = new SendOptions();
sendOptions.setPartitionId("4");
// EventDataBatch 사용
EventDataBatch batch = producer.createBatch();
CreateBatchOptions batchOptions = new CreateBatchOptions();
batchOptions.setPartitionId("4"); // 배치 전체의 파티션 고정
EventDataBatch batch = producer.createBatch(batchOptions); // 옵션 적용된 배치 생성
if (batch.tryAdd(eventData)) {
producer.send(batch);
log.info("동기화 이벤트 발행 성공: storeId={}, platform={}, syncedCount={}",

View File

@ -98,6 +98,48 @@ public class StoreService implements StoreUseCase {
public String getAllTags(Long storeId){
return storeJpaRepository.findById(storeId).get().getTagsJson();
}
@Override
public List<StoreListResponse> getSearchStoreName(String storeName){
List<StoreEntity> stores = storeJpaRepository.finByStoreNameContaining(storeName);
return stores.stream()
.map(store -> StoreListResponse.builder()
.storeId(store.getId())
.storeName(store.getStoreName())
.address(store.getAddress())
.category(store.getCategory())
.rating(store.getRating())
.reviewCount(store.getReviewCount())
.status("운영중")
.tagJson(store.getTagsJson())
.imageUrl(store.getImageUrl())
.operatingHours(store.getOperatingHours())
.build())
.collect(Collectors.toList());
}
@Override
public List<StoreListResponse> getCategoryStores(String category){
List<StoreEntity> stores = storeJpaRepository.findByCategory(category);
return stores.stream()
.map(store -> StoreListResponse.builder()
.storeId(store.getId())
.storeName(store.getStoreName())
.address(store.getAddress())
.category(store.getCategory())
.rating(store.getRating())
.reviewCount(store.getReviewCount())
.status("운영중")
.tagJson(store.getTagsJson())
.imageUrl(store.getImageUrl())
.operatingHours(store.getOperatingHours())
.build())
.collect(Collectors.toList());
}
@Override
public List<StoreListResponse> getAllStores() {

View File

@ -33,6 +33,10 @@ public interface StoreUseCase {
List<StoreListResponse> getAllStores();
List<StoreListResponse> getCategoryStores(String category);
List<StoreListResponse> getSearchStoreName(String storeName);
String getAllTags(Long storeId);
/**

View File

@ -59,6 +59,8 @@ public class StoreController {
.body(ApiResponse.success(response, "매장이 성공적으로 등록되었습니다."));
}
@Operation(summary = "내 매장 목록 조회", description = "점주가 등록한 매장 목록을 조회합니다.")
@GetMapping("/my")
@PreAuthorize("hasRole('OWNER')")
@ -71,6 +73,8 @@ public class StoreController {
return ResponseEntity.ok(ApiResponse.success(responses, "내 매장 목록 조회 완료"));
}
@GetMapping("/stores/all")
@Operation(summary = "매장 전체 리스트")
public ResponseEntity<ApiResponse<List<StoreListResponse>>> getAllStores() {
@ -79,6 +83,24 @@ public class StoreController {
return ResponseEntity.ok(ApiResponse.success(responses));
}
@Operation(summary = "매장 조회", description = "가게 검색한 매장 목록을 조회합니다.")
@GetMapping("/search/storeName/{storeName}")
public ResponseEntity<ApiResponse<List<StoreListResponse>>> getSearchStores(
HttpServletRequest httpRequest, @PathVariable String storeName) {
List<StoreListResponse> responses = storeUseCase.getSearchStoreName(storeName);
return ResponseEntity.ok(ApiResponse.success(responses));
}
@GetMapping("/stores/category/{category}")
@Operation(summary = "카테고리에 해당하는 매장")
public ResponseEntity<ApiResponse<List<StoreListResponse>>> getStoreCategories(@PathVariable String category) {
List<StoreListResponse> responses = storeUseCase.getCategoryStores(category);
return ResponseEntity.ok(ApiResponse.success(responses));
}
@GetMapping("/stores/{storeId}/tags")
@Operation(summary = "매장 전체 리스트")
public ResponseEntity<String> getStoreTags(@PathVariable Long storeId) {

View File

@ -82,7 +82,7 @@ public class ExternalPlatformAdapter implements ExternalPlatformPort {
Map<String, Object> requestBody = new HashMap<>();
requestBody.put("store_id", externalStoreId);
requestBody.put("days_limit", 1000);
requestBody.put("days_limit", 365);
requestBody.put("max_time", 300);
HttpHeaders headers = new HttpHeaders();

View File

@ -46,6 +46,8 @@ public interface StoreJpaRepository extends JpaRepository<StoreEntity, Long> {
*/
List<StoreEntity> findByCategory(String category);
@Query("SELECT s FROM StoreEntity s WHERE s.storeName like %:storeName%")
List<StoreEntity> finByStoreNameContaining(@Param("storeName") String storeName);
/**
* 상태로 매장 조회
*/