Skip to content

Commit

Permalink
Merge pull request #58 from marinesnow34/img
Browse files Browse the repository at this point in the history
Feat: 가게 이벤트 구현
  • Loading branch information
marinesnow34 authored Nov 22, 2023
2 parents 055a1a3 + 8906620 commit 9cd16bd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.web.bind.annotation.RestController;

import com.readyvery.readyverydemo.src.store.dto.StoreDetailRes;
import com.readyvery.readyverydemo.src.store.dto.StoreEventRes;
import com.readyvery.readyverydemo.src.store.dto.StoreMenuRes;

import lombok.RequiredArgsConstructor;
Expand All @@ -29,4 +30,10 @@ public ResponseEntity<StoreMenuRes> getStoreMenu(@PathVariable("storeId") Long s
StoreMenuRes storeMenuRes = storeService.getStoreMenu(storeId);
return new ResponseEntity<>(storeMenuRes, HttpStatus.OK);
}

@GetMapping("/{storeId}/event")
public ResponseEntity<StoreEventRes> getStoreEvent(@PathVariable("storeId") Long storeId) {
StoreEventRes storeEvent = storeService.getStoreEvent(storeId);
return new ResponseEntity<>(storeEvent, HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.readyvery.readyverydemo.src.store;

import com.readyvery.readyverydemo.src.store.dto.StoreDetailRes;
import com.readyvery.readyverydemo.src.store.dto.StoreEventRes;
import com.readyvery.readyverydemo.src.store.dto.StoreMenuRes;

public interface StoreService {
StoreDetailRes getStoreDetail(Long storeId);

StoreMenuRes getStoreMenu(Long storeId);

StoreEventRes getStoreEvent(Long storeId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.readyvery.readyverydemo.global.exception.BusinessLogicException;
import com.readyvery.readyverydemo.global.exception.ExceptionCode;
import com.readyvery.readyverydemo.src.store.dto.StoreDetailRes;
import com.readyvery.readyverydemo.src.store.dto.StoreEventRes;
import com.readyvery.readyverydemo.src.store.dto.StoreMapper;
import com.readyvery.readyverydemo.src.store.dto.StoreMenuRes;

Expand Down Expand Up @@ -35,4 +36,10 @@ public StoreMenuRes getStoreMenu(Long storeId) {
return storeMapper.storeToStoreMenuRes(store);
}

@Override
public StoreEventRes getStoreEvent(Long storeId) {
Store store = getStore(storeId);
return storeMapper.storeToStoreEventRes(store);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.readyvery.readyverydemo.src.store.dto;

import lombok.Builder;
import lombok.Getter;

@Getter
@Builder
public class StoreEventRes {
private String eventImgUrl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ private MenuItemDto foodieToMenuItems(Foodie foodie) {
.hit(foodie.isHit())
.build();
}

public StoreEventRes storeToStoreEventRes(Store store) {
return StoreEventRes.builder()
.eventImgUrl(store.getAdImgUrl())
.build();
}
}

0 comments on commit 9cd16bd

Please sign in to comment.