Skip to content

Commit

Permalink
[feat] implements controller
Browse files Browse the repository at this point in the history
  • Loading branch information
PicturePark1101 committed Jul 9, 2024
1 parent a48450c commit eeea465
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.hankki.hankkiserver.api.favorite.controller;

import lombok.RequiredArgsConstructor;
import org.hankki.hankkiserver.api.dto.HankkiResponse;
import org.hankki.hankkiserver.api.favorite.service.FavoriteQueryService;
import org.hankki.hankkiserver.api.favorite.service.response.FavoriteFindResponse;
import org.hankki.hankkiserver.common.code.CommonSuccessCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1")
public class FavoriteController {

private final FavoriteQueryService favoriteQueryService;

@GetMapping("/favorites/{favoriteId}")
public HankkiResponse<FavoriteFindResponse> getFavorite(@PathVariable(name = "favoriteId") long favoriteId) {
return HankkiResponse.success(CommonSuccessCode.OK, favoriteQueryService.findFavorite(favoriteId));
}
}

0 comments on commit eeea465

Please sign in to comment.